From c7dbad66ab7322e3fa23a3e283dd92731901ac30 Mon Sep 17 00:00:00 2001 From: Andrew Canaday Date: Sat, 19 Jul 2014 07:00:52 +0800 Subject: [PATCH] Make sure headers are parsed before proceeding. --- lib/handshake.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/handshake.c b/lib/handshake.c index d30ef930..95e51818 100644 --- a/lib/handshake.c +++ b/lib/handshake.c @@ -88,6 +88,11 @@ http_new: * lws_handshake_server doesn't update len for us. Figure out how * much was read, so that we can proceed appropriately: */ len -= (buf - last_char); + + if (!wsi->hdr_parsing_completed) + /* More header content on the way */ + goto read_ok; + switch (wsi->state) { case WSI_STATE_HTTP: case WSI_STATE_HTTP_HEADERS: