1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 04:22:47 -05:00

Put an optional IdempotentCallback in packet queues.

This means that someone putting things on a packet queue doesn't need
to separately hold a pointer to someone who needs notifying about it,
or remember to call the notification function every time they push
things on the queue. It's all taken care of automatically, without
having to put extra stuff at the call sites.

The precise semantics are that the callback will be scheduled whenever
_new_ packets appear on the queue, but not when packets are removed.
(Because the expectation is that the callback is notifying whoever is
consuming the queue.)
This commit is contained in:
Simon Tatham
2018-09-21 13:16:38 +01:00
parent a703f86731
commit 623c7b720c
2 changed files with 14 additions and 0 deletions

1
ssh.h
View File

@ -85,6 +85,7 @@ typedef struct PktOut {
typedef struct PacketQueueBase {
PacketQueueNode end;
struct IdempotentCallback *ic;
} PacketQueueBase;
typedef struct PktInQueue {