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

winsock recvmsg: fix WSARecvFrom usage

Pointed-out-by: Laurent Aimar
(cherry picked from commit 82580b6f)
parent 7efe8f55
...@@ -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