From: Andy Green Date: Tue, 1 Apr 2014 06:20:44 +0000 (+0800) Subject: truncated send issue independent of LWS_NO_EXTENSIONS 2 X-Git-Tag: upstream/1.7.3~675 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03cf1dde39c680dc24b207add7aaf7d9a0bcc4d3;p=platform%2Fupstream%2Flibwebsockets.git truncated send issue independent of LWS_NO_EXTENSIONS 2 Signed-off-by: Andy Green --- diff --git a/lib/output.c b/lib/output.c index f711f2a..afc93ae 100644 --- a/lib/output.c +++ b/lib/output.c @@ -105,6 +105,10 @@ int lws_issue_raw(struct libwebsocket *wsi, unsigned char *buf, size_t len) #ifndef LWS_NO_EXTENSIONS int m; +#endif + + if (!len) + return 0; if (wsi->truncated_send_len && (buf < wsi->truncated_send_malloc || buf > (wsi->truncated_send_malloc + @@ -114,6 +118,7 @@ int lws_issue_raw(struct libwebsocket *wsi, unsigned char *buf, size_t len) assert(0); } +#ifndef LWS_NO_EXTENSIONS /* * one of the extensions is carrying our data itself? Like mux? */ @@ -639,7 +644,7 @@ send_raw: */ n = lws_issue_raw_ext_access(wsi, buf - pre, len + pre + post); - if (n < 0) + if (n <= 0) return n; if (n == len + pre + post) {