]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Make asynchronous agent_query() requests cancellable.
authorSimon Tatham <anakin@pobox.com>
Sun, 29 Jan 2017 20:24:15 +0000 (20:24 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 29 Jan 2017 20:25:04 +0000 (20:25 +0000)
commiteb2fe29fc975b19a3b3692fced03559e705881d9
tree73f6750fb5895e33834acb81d5d76ff231aa6381
parentf864265e393f4279045ca59d7eb9b03352766cde
Make asynchronous agent_query() requests cancellable.

Now, instead of returning a boolean indicating whether the query has
completed or is still pending, agent_query() returns NULL to indicate
that the query _has_ completed, and if it hasn't, it returns a pointer
to a context structure representing the pending query, so that the
latter can be used to cancel the query if (for example) you later
decide you need to free the thing its callback was using as a context.

This should fix a potential race-condition segfault if you overload an
agent forwarding channel and then close it abruptly. (Which nobody
will be doing for sensible purposes, of course! But I ran across this
while stress-testing other aspects of agent forwarding.)
Recipe
aqsync.c [new file with mode: 0644]
pageant.c
putty.h
ssh.c
unix/uxagentc.c
windows/winpgntc.c