summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Chen <justinchen00@github.invalid.com>2016-04-14 21:42:11 +0800
committerAndy Green <andy@warmcat.com>2016-04-14 21:42:11 +0800
commitedb92ee3c75fac5e25723d9e4dd6417f02222cb0 (patch)
tree26c958931de5afb11834af9629739ecd9d861ea8
parentc06ea5c7d7484d3978d2626f19741e3ecb6c0acb (diff)
downloadlibwebsockets-edb92ee3c75fac5e25723d9e4dd6417f02222cb0.tar.gz
libwebsockets-edb92ee3c75fac5e25723d9e4dd6417f02222cb0.tar.bz2
libwebsockets-edb92ee3c75fac5e25723d9e4dd6417f02222cb0.zip
recv treat zero return as error
https://github.com/warmcat/libwebsockets/issues/475
-rw-r--r--lib/output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/output.c b/lib/output.c
index 0d850ebe..11f88e82 100644
--- a/lib/output.c
+++ b/lib/output.c
@@ -622,7 +622,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 ||