* fhandler_socket.cc (fhandler_socket::recvfrom): Mask flags with
MSG_WINMASK for Windows socket calls. (fhandler_socket::recvmsg): Ditto. (fhandler_socket::sendmsg): Ditto.
This commit is contained in:
parent
6c9a5ebbfc
commit
ddd62ccbd4
|
@ -1,3 +1,11 @@
|
||||||
|
2005-12-08 Pekka Pessi <ppessi@gmail.com>
|
||||||
|
Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_socket.cc (fhandler_socket::recvfrom): Mask flags with
|
||||||
|
MSG_WINMASK for Windows socket calls.
|
||||||
|
(fhandler_socket::recvmsg): Ditto.
|
||||||
|
(fhandler_socket::sendmsg): Ditto.
|
||||||
|
|
||||||
2005-12-07 Christopher Faylor <cgf@timesys.com>
|
2005-12-07 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
* hires.h (hires_ms::initime_ms): Delete.
|
* hires.h (hires_ms::initime_ms): Delete.
|
||||||
|
|
|
@ -1028,12 +1028,14 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
|
||||||
int res = SOCKET_ERROR;
|
int res = SOCKET_ERROR;
|
||||||
DWORD ret = 0;
|
DWORD ret = 0;
|
||||||
|
|
||||||
flags &= MSG_WINMASK;
|
|
||||||
WSABUF wsabuf = { len, (char *) ptr };
|
WSABUF wsabuf = { len, (char *) ptr };
|
||||||
|
|
||||||
if (is_nonblocking () || closed () || async_io ())
|
if (is_nonblocking () || closed () || async_io ())
|
||||||
|
{
|
||||||
|
DWORD lflags = (DWORD) (flags & MSG_WINMASK);
|
||||||
res = WSARecvFrom (get_socket (), &wsabuf, 1, &ret,
|
res = WSARecvFrom (get_socket (), &wsabuf, 1, &ret,
|
||||||
(DWORD *) &flags, from, fromlen, NULL, NULL);
|
&lflags, from, fromlen, NULL, NULL);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HANDLE evt;
|
HANDLE evt;
|
||||||
|
@ -1041,7 +1043,7 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
DWORD lflags = (DWORD) flags;
|
DWORD lflags = (DWORD) (flags & MSG_WINMASK);
|
||||||
res = WSARecvFrom (get_socket (), &wsabuf, 1, &ret, &lflags,
|
res = WSARecvFrom (get_socket (), &wsabuf, 1, &ret, &lflags,
|
||||||
from, fromlen, NULL, NULL);
|
from, fromlen, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
@ -1118,8 +1120,11 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
|
||||||
DWORD ret = 0;
|
DWORD ret = 0;
|
||||||
|
|
||||||
if (is_nonblocking () || closed () || async_io ())
|
if (is_nonblocking () || closed () || async_io ())
|
||||||
|
{
|
||||||
|
DWORD lflags = (DWORD) (flags & MSG_WINMASK);
|
||||||
res = WSARecvFrom (get_socket (), wsabuf, iovcnt, &ret,
|
res = WSARecvFrom (get_socket (), wsabuf, iovcnt, &ret,
|
||||||
(DWORD *) &flags, from, fromlen, NULL, NULL);
|
&lflags, from, fromlen, NULL, NULL);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HANDLE evt;
|
HANDLE evt;
|
||||||
|
@ -1127,7 +1132,7 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
DWORD lflags = (DWORD) flags;
|
DWORD lflags = (DWORD) (flags & MSG_WINMASK);
|
||||||
res = WSARecvFrom (get_socket (), wsabuf, iovcnt, &ret,
|
res = WSARecvFrom (get_socket (), wsabuf, iovcnt, &ret,
|
||||||
&lflags, from, fromlen, NULL, NULL);
|
&lflags, from, fromlen, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
@ -1271,7 +1276,7 @@ fhandler_socket::sendmsg (const struct msghdr *msg, int flags, ssize_t tot)
|
||||||
|
|
||||||
if (is_nonblocking () || closed () || async_io ())
|
if (is_nonblocking () || closed () || async_io ())
|
||||||
res = WSASendTo (get_socket (), wsabuf, iovcnt, &ret,
|
res = WSASendTo (get_socket (), wsabuf, iovcnt, &ret,
|
||||||
flags, (struct sockaddr *) msg->msg_name,
|
flags & MSG_WINMASK, (struct sockaddr *) msg->msg_name,
|
||||||
msg->msg_namelen, NULL, NULL);
|
msg->msg_namelen, NULL, NULL);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1281,7 +1286,7 @@ fhandler_socket::sendmsg (const struct msghdr *msg, int flags, ssize_t tot)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
res = WSASendTo (get_socket (), wsabuf, iovcnt,
|
res = WSASendTo (get_socket (), wsabuf, iovcnt,
|
||||||
&ret, flags,
|
&ret, flags & MSG_WINMASK,
|
||||||
(struct sockaddr *) msg->msg_name,
|
(struct sockaddr *) msg->msg_name,
|
||||||
msg->msg_namelen, NULL, NULL);
|
msg->msg_namelen, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue