X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinhsock.c;fp=windows%2Fwinhsock.c;h=1a4ee4d79edc0e83ad166e988f3965d61e56cf06;hb=51732faeb913527f3373e3c77bf66ca414e5bab6;hp=8acb82be61b5493195c26e1600d03b62878a295e;hpb=86b604dd65679d983c06012b377e41c927da3cd6;p=PuTTY.git diff --git a/windows/winhsock.c b/windows/winhsock.c index 8acb82be..1a4ee4d7 100644 --- a/windows/winhsock.c +++ b/windows/winhsock.c @@ -94,7 +94,15 @@ static int handle_stderr(struct handle *h, void *data, int len) static void handle_sentdata(struct handle *h, int new_backlog) { Handle_Socket ps = (Handle_Socket) handle_get_privdata(h); - + + if (new_backlog < 0) { + /* Special case: this is actually reporting an error writing + * to the underlying handle, and our input value is the error + * code itself, negated. */ + plug_closing(ps->plug, win_strerror(-new_backlog), -new_backlog, 0); + return; + } + plug_sent(ps->plug, new_backlog); }