From c9259876d2e1f060640d6273babf62eda8bf93d2 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 15 Feb 2016 19:05:43 +0800 Subject: [PATCH] http_transaction_completed handle two completions in detach reset order Signed-off-by: Andy Green --- lib/server.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/server.c b/lib/server.c index 63c80f53..7bd0f042 100644 --- a/lib/server.c +++ b/lib/server.c @@ -737,11 +737,12 @@ lws_http_transaction_completed(struct lws *wsi) * that is already at least the start of another header set, simply * reset the existing header table and keep it. */ - if (wsi->u.hdr.ah && - wsi->u.hdr.ah->rxpos == wsi->u.hdr.ah->rxlen) - lws_header_table_detach(wsi); - else - lws_header_table_reset(wsi); + if (wsi->u.hdr.ah) { + if (wsi->u.hdr.ah->rxpos == wsi->u.hdr.ah->rxlen) + lws_header_table_detach(wsi); + else + lws_header_table_reset(wsi); + } /* If we're (re)starting on headers, need other implied init */ wsi->u.hdr.ues = URIES_IDLE;