Commit 481ee636 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

webservices: Don't use MSG_PEEK.

As suggested by Jacek. Signed-off-by: 's avatarHans Leidekker <hans@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent b7cc627c
......@@ -1150,27 +1150,21 @@ static void set_blocking( SOCKET socket, BOOL blocking )
ioctlsocket( socket, FIONBIO, &state );
}
static int sock_peek( SOCKET socket )
static int sock_recv( SOCKET socket, char *buf, int len )
{
int ret;
char byte;
int count, ret;
set_blocking( socket, FALSE );
ret = recv( socket, &byte, 1, MSG_PEEK );
set_blocking( socket, TRUE );
return ret;
}
if ((ret = recv( socket, buf, len, 0 )) <= 0) return ret;
len -= ret;
static int sock_recv( SOCKET socket, char *buf, int len )
{
int count, ret = 0;
set_blocking( socket, FALSE );
for (;;)
{
if ((count = recv( socket, buf + ret, len, 0 )) <= 0) break;
ret += count;
len -= count;
if (sock_peek( socket ) != 1) break;
}
set_blocking( socket, TRUE );
return ret;
}
......
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