1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 05:52:48 -05:00

Make pq_empty_on_to_front_of more general.

It's really just a concatenator for a pair of linked lists, but
unhelpfully restricted in which of the lists it replaces with the
output. Better to have a three-argument function that puts the output
wherever you like, whether it overlaps either or neither one of the
inputs.
This commit is contained in:
Simon Tatham
2018-09-19 20:30:40 +01:00
parent 04226693e3
commit 6a5d4d083a
3 changed files with 66 additions and 17 deletions

4
ssh.c
View File

@ -8846,8 +8846,10 @@ static void do_ssh2_connection(void *vctx)
* matches any of the table entries we've just modified will go to
* the right handler function, and won't come here to confuse us.
*/
if (pq_empty_on_to_front_of(&ssh->pq_ssh2_connection, &ssh->pq_full))
if (pq_peek(&ssh->pq_ssh2_connection)) {
pq_concatenate(&ssh->pq_full, &ssh->pq_ssh2_connection, &ssh->pq_full);
queue_idempotent_callback(&ssh->pq_full_consumer);
}
/*
* Now the connection protocol is properly up and running, with