From e5eb3a1ca14cf38028d076b06701792af954c90b Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 5 Sep 2001 22:04:19 +0000 Subject: [PATCH] Fix the intermittent fault in the socket layer that was occasionally bombing out X forwarding. It turns out to be a workaround for YET ANOTHER useless WinSock implementation. Arrgh! git-svn-id: svn://svn.tartarus.org/sgt/putty@1232 cda61777-01e9-0310-a592-d414129be87e --- winnet.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/winnet.c b/winnet.c index 40f416d8..1a80a80c 100644 --- a/winnet.c +++ b/winnet.c @@ -718,14 +718,15 @@ void try_send(Actual_Socket s) noise_ultralight(nsent); if (nsent <= 0) { err = (nsent < 0 ? WSAGetLastError() : 0); - if ((err == 0 && nsent < 0) || err == WSAEWOULDBLOCK) { + if ((err < WSABASEERR && 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.) + * (Some WinSock send() implementations can return + * <0 but leave no sensible error indication - + * WSAGetLastError() is called but returns zero or + * a small number - so we check that case and treat + * it just like WSAEWOULDBLOCK.) */ s->writable = FALSE; return; -- 2.11.0