* fhandler_socket.cc (fhandler_socket::recvfrom): Use original flags

value in each WSARecvFrom call.
	(fhandler_socket::recvmsg): Ditto.  Reformat slightly.
This commit is contained in:
Corinna Vinschen 2004-05-16 15:38:03 +00:00
parent 0c565ab35b
commit 32880f1e4a
2 changed files with 15 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2004-05-16 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::recvfrom): Use original flags
value in each WSARecvFrom call.
(fhandler_socket::recvmsg): Ditto. Reformat slightly.
2004-05-15 Christopher Faylor <cgf@alum.bu.edu> 2004-05-15 Christopher Faylor <cgf@alum.bu.edu>
* cygthread.cc (cygthread::is): Eliminate. * cygthread.cc (cygthread::is): Eliminate.

View File

@ -843,8 +843,8 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
{ {
do do
{ {
res = WSARecvFrom (get_socket (), &wsabuf, 1, DWORD lflags = (DWORD) flags;
&ret, (DWORD *) &flags, res = WSARecvFrom (get_socket (), &wsabuf, 1, &ret, &lflags,
from, fromlen, NULL, NULL); from, fromlen, NULL, NULL);
} }
while (res == SOCKET_ERROR while (res == SOCKET_ERROR
@ -895,8 +895,7 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
if (!winsock2_active) if (!winsock2_active)
{ {
if (iovcnt == 1) if (iovcnt == 1)
res = recvfrom (iov->iov_base, iov->iov_len, flags, res = recvfrom (iov->iov_base, iov->iov_len, flags, from, fromlen);
from, fromlen);
else else
{ {
if (tot == -1) // i.e. if not pre-calculated by the caller. if (tot == -1) // i.e. if not pre-calculated by the caller.
@ -920,8 +919,7 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
} }
else else
{ {
res = recvfrom (buf, tot, flags, res = recvfrom (buf, tot, flags, from, fromlen);
from, fromlen);
const struct iovec *iovptr = iov; const struct iovec *iovptr = iov;
int nbytes = res; int nbytes = res;
@ -958,9 +956,8 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
DWORD ret; DWORD ret;
if (is_nonblocking () || closed () || async_io ()) if (is_nonblocking () || closed () || async_io ())
res = WSARecvFrom (get_socket (), res = WSARecvFrom (get_socket (), wsabuf, iovcnt, (ret = 0, &ret),
wsabuf, iovcnt, (ret = 0, &ret), (DWORD *) &flags, (DWORD *) &flags, from, fromlen, NULL, NULL);
from, fromlen, NULL, NULL);
else else
{ {
HANDLE evt; HANDLE evt;
@ -968,9 +965,9 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
{ {
do do
{ {
res = WSARecvFrom (get_socket (), wsabuf, iovcnt, DWORD lflags = (DWORD) flags;
&ret, (DWORD *) &flags, res = WSARecvFrom (get_socket (), wsabuf, iovcnt, &ret,
from, fromlen, NULL, NULL); &lflags, from, fromlen, NULL, NULL);
} }
while (res == SOCKET_ERROR while (res == SOCKET_ERROR
&& WSAGetLastError () == WSAEWOULDBLOCK && WSAGetLastError () == WSAEWOULDBLOCK