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 ||