recv treat zero return as error

https://github.com/warmcat/libwebsockets/issues/475
This commit is contained in:
Justin Chen 2016-04-14 21:40:53 +08:00 committed by Andy Green
parent f3e9c7347e
commit 30cdb3ac8f

View file

@ -630,7 +630,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 ||