diff --git a/windows/winhsock.c b/windows/winhsock.c index c8cb46f6..799fd28d 100644 --- a/windows/winhsock.c +++ b/windows/winhsock.c @@ -54,10 +54,11 @@ static int handle_gotdata(struct handle *h, void *data, int len) Handle_Socket ps = (Handle_Socket) handle_get_privdata(h); if (len < 0) { - return plug_closing(ps->plug, "Read error from handle", - 0, 0); + plug_closing(ps->plug, "Read error from handle", 0, 0); + return 0; } else if (len == 0) { - return plug_closing(ps->plug, NULL, 0, 0); + plug_closing(ps->plug, NULL, 0, 0); + return 0; } else { assert(ps->frozen != FROZEN && ps->frozen != THAWING); if (ps->frozen == FREEZING) { @@ -76,7 +77,8 @@ static int handle_gotdata(struct handle *h, void *data, int len) */ return INT_MAX; } else { - return plug_receive(ps->plug, 0, data, len); + plug_receive(ps->plug, 0, data, len); + return 0; } } } @@ -168,7 +170,7 @@ static void handle_socket_unfreeze(void *psv) { Handle_Socket ps = (Handle_Socket) psv; void *data; - int len, new_backlog; + int len; /* * If we've been put into a state other than THAWING since the @@ -188,7 +190,7 @@ static void handle_socket_unfreeze(void *psv) * have the effect of trying to close this socket. */ ps->defer_close = TRUE; - new_backlog = plug_receive(ps->plug, 0, data, len); + plug_receive(ps->plug, 0, data, len); bufchain_consume(&ps->inputdata, len); ps->defer_close = FALSE; if (ps->deferred_close) { @@ -207,7 +209,7 @@ static void handle_socket_unfreeze(void *psv) * Otherwise, we've successfully thawed! */ ps->frozen = UNFROZEN; - handle_unthrottle(ps->recv_h, new_backlog); + handle_unthrottle(ps->recv_h, 0); } }