From 3adeca8eca9e8911df2b5f53786835e3d79009d6 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 14 Nov 2014 07:21:02 +0800 Subject: [PATCH] return_http_staus fix http2 defeating body addition Signed-off-by: Andy Green --- lib/server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } /** -- 2.7.4