]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/commitdiff
David Brinegar's workaround for an error reporting problem in some
authorSimon Tatham <anakin@pobox.com>
Thu, 15 Mar 2001 13:25:48 +0000 (13:25 +0000)
committerSimon Tatham <anakin@pobox.com>
Thu, 15 Mar 2001 13:25:48 +0000 (13:25 +0000)
WinSocks.

git-svn-id: http://svn.tartarus.org/sgt/putty@1004 cda61777-01e9-0310-a592-d414129be87e

winnet.c

index 01b4f1badf198b31efda6e696ac3195b2aa39015..131f00a7d8790b1b38667fd62655a742c6e2bffa 100644 (file)
--- a/winnet.c
+++ b/winnet.c
@@ -504,8 +504,15 @@ void try_send(Actual_Socket s) {
         noise_ultralight(nsent);
        if (nsent <= 0) {
            err = (nsent < 0 ? WSAGetLastError() : 0);
-           if (err == WSAEWOULDBLOCK) {
-               /* Perfectly normal: we've sent all we can for the moment. */
+           if ((err==0 && nsent < 0) || err == WSAEWOULDBLOCK) {
+               /*
+                * Perfectly normal: we've sent all we can for the moment.
+                * 
+                * (Apparently some WinSocks can return <0 but
+                * leave no error indication - WSAGetLastError() is
+                * called but returns zero - so we check that case
+                * and treat it just like WSAEWOULDBLOCK.)
+                */
                s->writable = FALSE;
                 return;
            } else if (nsent == 0 ||