public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: AF_INET and AF_LOCAL: recv_internal: fix MSG_WAITALL support
@ 2020-10-23 12:23 Ken Brown
0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2020-10-23 12:23 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3752ab804bda1cbb38b5da91db8cf14f8bdefa2f
commit 3752ab804bda1cbb38b5da91db8cf14f8bdefa2f
Author: Ken Brown via Cygwin-patches <cygwin-patches@cygwin.com>
Date: Mon Oct 12 14:02:13 2020 -0400
Cygwin: AF_INET and AF_LOCAL: recv_internal: fix MSG_WAITALL support
If MSG_WAITALL is set, recv_internal calls WSARecv or WSARecvFrom in a
loop, in an effort to fill all the scatter-gather buffers. The test
for whether all the buffers are full was previously incorrect.
Diff:
---
winsup/cygwin/fhandler_socket_inet.cc | 2 +-
winsup/cygwin/fhandler_socket_local.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/fhandler_socket_inet.cc b/winsup/cygwin/fhandler_socket_inet.cc
index 71e92e341..bc08d3cf1 100644
--- a/winsup/cygwin/fhandler_socket_inet.cc
+++ b/winsup/cygwin/fhandler_socket_inet.cc
@@ -1208,7 +1208,7 @@ fhandler_socket_inet::recv_internal (LPWSAMSG wsamsg, bool use_recvmsg)
--wsacnt;
}
}
- if (!wret)
+ if (!wsacnt)
break;
}
else if (WSAGetLastError () != WSAEWOULDBLOCK)
diff --git a/winsup/cygwin/fhandler_socket_local.cc b/winsup/cygwin/fhandler_socket_local.cc
index 8bfba225a..c94bf828f 100644
--- a/winsup/cygwin/fhandler_socket_local.cc
+++ b/winsup/cygwin/fhandler_socket_local.cc
@@ -1212,7 +1212,7 @@ fhandler_socket_local::recv_internal (LPWSAMSG wsamsg, bool use_recvmsg)
--wsacnt;
}
}
- if (!wret)
+ if (!wsacnt)
break;
}
else if (WSAGetLastError () != WSAEWOULDBLOCK)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-23 12:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-23 12:23 [newlib-cygwin] Cygwin: AF_INET and AF_LOCAL: recv_internal: fix MSG_WAITALL support Ken Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).