Commit 82580b6f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

winsock recvmsg: fix WSARecvFrom usage

Pointed-out-by: Laurent Aimar
parent 20ad5a20
...@@ -185,12 +185,16 @@ ssize_t vlc_recvmsg (int s, struct msghdr *hdr, int flags) ...@@ -185,12 +185,16 @@ ssize_t vlc_recvmsg (int s, struct msghdr *hdr, int flags)
buf[i].buf = hdr->msg_iov[i].iov_base, buf[i].buf = hdr->msg_iov[i].iov_base,
buf[i].len = hdr->msg_iov[i].iov_len; buf[i].len = hdr->msg_iov[i].iov_len;
DWORD recvd; DWORD recvd, dwFlags = flags;
INT fromlen = hdr->msg_namelen;
hdr->msg_controllen = 0; hdr->msg_controllen = 0;
hdr->msg_flags = 0; hdr->msg_flags = 0;
if (WSARecvFrom (s, buf, sizeof (buf) / sizeof (buf[0]), &recvd, flags, int ret = WSARecvFrom (s, buf, sizeof (buf) / sizeof (buf[0]), &recvd,
hdr->msg_name, hdr->msg_namelen, NULL, NULL) == 0) &dwFlags, hdr->msg_name, &fromlen, NULL, NULL);
hdr->msg_namelen = fromlen;
hdr->msg_flags = dwFlags;
if (ret == 0)
return recvd; return recvd;
#ifdef MSG_TRUNC #ifdef MSG_TRUNC
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment