Re: ws2_32: sendmsg on OS/X and BSD returns EMSGSIZE error for size 0
Aric Stewart <aric(a)codeweavers.com> writes:
@@ -1781,6 +1781,9 @@ static int WS2_send( int fd, struct ws2_async *wsa ) wsa->iovec[wsa->first_iovec].iov_len -= n; } } + /* BSD and OS/X return EMSGSIZE if hdr.msg_iovlen is 0 */ + else if ( hdr.msg_iovlen == 0 && errno == EMSGSIZE) + ret = 0;
This should never happen. We should always have at least one iov at that point, the callers should make sure of that. -- Alexandre Julliard julliard(a)winehq.org
I was seeing this coming through WS2_async_send. I will investigate and give you a better code path that is resulting in this. -aric On 3/4/11 10:47 AM, Alexandre Julliard wrote:
Aric Stewart<aric(a)codeweavers.com> writes:
@@ -1781,6 +1781,9 @@ static int WS2_send( int fd, struct ws2_async *wsa ) wsa->iovec[wsa->first_iovec].iov_len -= n; } } + /* BSD and OS/X return EMSGSIZE if hdr.msg_iovlen is 0 */ + else if ( hdr.msg_iovlen == 0&& errno == EMSGSIZE) + ret = 0;
This should never happen. We should always have at least one iov at that point, the callers should make sure of that.
Looks like WS2_ConnectEx is at fault. It is being called with a sendBuf of NULL which results in n_iovecs and first_iovec being set to 0 resulting in a len of 0. I see no evidence of checking for this case along that codepath. -aric On 3/4/11 10:47 AM, Alexandre Julliard wrote:
Aric Stewart<aric(a)codeweavers.com> writes:
@@ -1781,6 +1781,9 @@ static int WS2_send( int fd, struct ws2_async *wsa ) wsa->iovec[wsa->first_iovec].iov_len -= n; } } + /* BSD and OS/X return EMSGSIZE if hdr.msg_iovlen is 0 */ + else if ( hdr.msg_iovlen == 0&& errno == EMSGSIZE) + ret = 0;
This should never happen. We should always have at least one iov at that point, the callers should make sure of that.
Aric Stewart <aric(a)codeweavers.com> writes:
Looks like WS2_ConnectEx is at fault.
It is being called with a sendBuf of NULL which results in n_iovecs and first_iovec being set to 0 resulting in a len of 0.
Most likely it shouldn't be trying to send anything in that case. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Aric Stewart