recv treat zero return as error
authorJustin Chen <justinchen00@github.invalid.com>
Thu, 14 Apr 2016 13:40:53 +0000 (21:40 +0800)
committerAndy Green <andy@warmcat.com>
Fri, 15 Apr 2016 05:58:24 +0000 (13:58 +0800)
https://github.com/warmcat/libwebsockets/issues/475

lib/output.c

index 9edc28f..420146f 100644 (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 ||