* 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>
* cygthread.cc (cygthread::is): Eliminate.

View File

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