From: Andy Green Date: Thu, 13 Nov 2014 23:21:02 +0000 (+0800) Subject: return_http_staus fix http2 defeating body addition X-Git-Tag: upstream/1.7.3~522 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3adeca8eca9e8911df2b5f53786835e3d79009d6;p=platform%2Fupstream%2Flibwebsockets.git return_http_staus fix http2 defeating body addition Signed-off-by: Andy Green --- diff --git a/lib/server.c b/lib/server.c index 057ad69..1132122 100644 --- a/lib/server.c +++ b/lib/server.c @@ -1038,13 +1038,13 @@ LWS_VISIBLE int libwebsockets_return_http_status( return 1; m = libwebsocket_write(wsi, start, p - start, LWS_WRITE_HTTP_HEADERS); - if (m) - return m; + if (m != (int)(p - start)) + return 1; n = sprintf((char *)start, "

%u

%s", code, html_body); m = libwebsocket_write(wsi, start, n, LWS_WRITE_HTTP); - return m; + return m != n; } /**