recv treat zero return as error

https://github.com/warmcat/libwebsockets/issues/475
This commit is contained in:
Justin Chen 2016-04-14 21:42:25 +08:00 committed by Andy Green
parent 1e9c1a5a1a
commit 6406f44b76

View file

@ -576,7 +576,7 @@ lws_ssl_capable_read_no_ssl(struct lws *wsi, unsigned char *buf, int len)
int n;
n = recv(wsi->sock, (char *)buf, len, 0);
if (n >= 0)
if (n > 0)
return n;
#if LWS_POSIX
if (LWS_ERRNO == LWS_EAGAIN ||