mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
* fhandler_socket.cc (fhandler_socket::recvfrom): Rearrange loop
so that WSARecvFrom is always called before waiting. (fhandler_socket::recvmsg): Ditto.
This commit is contained in:
parent
4cfacffa79
commit
b6edea61f2
@ -1,3 +1,9 @@
|
|||||||
|
2004-04-01 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_socket.cc (fhandler_socket::recvfrom): Rearrange loop
|
||||||
|
so that WSARecvFrom is always called before waiting.
|
||||||
|
(fhandler_socket::recvmsg): Ditto.
|
||||||
|
|
||||||
2004-04-01 Corinna Vinschen <corinna@vinschen.de>
|
2004-04-01 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* net.cc (wsock_event::wait): Make wsa_err an int. Don't set
|
* net.cc (wsock_event::wait): Make wsa_err an int. Don't set
|
||||||
|
@ -737,14 +737,15 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
|
|||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (!(res = wsock_evt.wait (get_socket (), has_been_closed)))
|
|
||||||
res = WSARecvFrom (get_socket (), &wsabuf, 1,
|
res = WSARecvFrom (get_socket (), &wsabuf, 1,
|
||||||
(ret = 0, &ret), (DWORD *) &flags,
|
(ret = 0, &ret), (DWORD *) &flags,
|
||||||
from, fromlen, NULL, NULL);
|
from, fromlen, NULL, NULL);
|
||||||
}
|
}
|
||||||
while (res == SOCKET_ERROR
|
while (res == SOCKET_ERROR
|
||||||
&& WSAGetLastError () == WSAEWOULDBLOCK
|
&& WSAGetLastError () == WSAEWOULDBLOCK
|
||||||
&& !has_been_closed);
|
&& !has_been_closed
|
||||||
|
&& !(res = wsock_evt.wait (get_socket (),
|
||||||
|
has_been_closed)));
|
||||||
wsock_evt.release (get_socket ());
|
wsock_evt.release (get_socket ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -863,14 +864,15 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
|
|||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (!(res = wsock_evt.wait (get_socket (), has_been_closed)))
|
|
||||||
res = WSARecvFrom (get_socket (), wsabuf, iovcnt,
|
res = WSARecvFrom (get_socket (), wsabuf, iovcnt,
|
||||||
(ret = 0, &ret), (DWORD *) &flags,
|
(ret = 0, &ret), (DWORD *) &flags,
|
||||||
from, fromlen, NULL, NULL);
|
from, fromlen, NULL, NULL);
|
||||||
}
|
}
|
||||||
while (res == SOCKET_ERROR
|
while (res == SOCKET_ERROR
|
||||||
&& WSAGetLastError () == WSAEWOULDBLOCK
|
&& WSAGetLastError () == WSAEWOULDBLOCK
|
||||||
&& !has_been_closed);
|
&& !has_been_closed
|
||||||
|
&& !(res = wsock_evt.wait (get_socket (),
|
||||||
|
has_been_closed)));
|
||||||
wsock_evt.release (get_socket ());
|
wsock_evt.release (get_socket ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user