1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-14 17:47:33 -05:00

Put an optional IdempotentCallback in bufchains.

The callback has the same semantics as for packet queues: it triggers
automatically when data is added to a bufchain, not when it's removed.
This commit is contained in:
Simon Tatham
2018-09-22 08:13:41 +01:00
parent 623c7b720c
commit 06b721ca03
6 changed files with 14 additions and 2 deletions

4
misc.c
View File

@ -707,6 +707,7 @@ void bufchain_init(bufchain *ch)
{
ch->head = ch->tail = NULL;
ch->buffersize = 0;
ch->ic = NULL;
}
void bufchain_clear(bufchain *ch)
@ -758,6 +759,9 @@ void bufchain_add(bufchain *ch, const void *data, int len)
ch->tail = newbuf;
}
}
if (ch->ic)
queue_idempotent_callback(ch->ic);
}
void bufchain_consume(bufchain *ch, int len)