Skip to content
Permalink
Browse files

fix for windows (report invalid sendto as a 0 data read)

  • Loading branch information...
ncannasse committed Jan 3, 2014
1 parent 2b667d6 commit 0c5d34909384fcb8c4eea536f4bfe4304af2ced1
Showing with 5 additions and 0 deletions.
  1. +5 −0 libs/std/socket.c
@@ -924,6 +924,11 @@ static value socket_recv_from( value o, value data, value pos, value len, value
ret = recvfrom(val_sock(o), val_string(data) + p , l, MSG_NOSIGNAL, (struct sockaddr*)&saddr, &slen);
if( ret == SOCKET_ERROR ) {
HANDLE_EINTR(recv_from_again);
#ifdef NEKO_WINDOWS
if( WSAGetLastError() == WSAECONNRESET )
ret = 0;
else
#endif
return block_error();
}
alloc_field(addr,f_host,alloc_int32(*(int*)&saddr.sin_addr));

0 comments on commit 0c5d349

Please sign in to comment.
You can’t perform that action at this time.