From 4f6fdd41b9e341a13481a07b53f312efc5831a34 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 8 Nov 2019 08:43:33 +0000 Subject: [PATCH] h2 client: no point resetting ah Resetting the ah and waiting a bit is the right strategy at the end of http/1.1 client transaction. But it's wrong for h2... drop the ah instead if it's the end of a client transaction on h2. --- lib/roles/http/client/client-http.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/roles/http/client/client-http.c b/lib/roles/http/client/client-http.c index fc7e20c15..a2347143c 100644 --- a/lib/roles/http/client/client-http.c +++ b/lib/roles/http/client/client-http.c @@ -637,8 +637,17 @@ lws_http_transaction_completed_client(struct lws *wsi) n = _lws_generic_transaction_completed_active_conn(wsi); - if (wsi->http.ah) - _lws_header_table_reset(wsi->http.ah); + if (wsi->http.ah) { + if (wsi->client_h2_substream) + /* + * As an h2 client, once we did our transaction, that is + * it for us. Further transactions will happen as new + * SIDs on the connection. + */ + __lws_header_table_detach(wsi, 0); + else + _lws_header_table_reset(wsi->http.ah); + } wsi->http.rx_content_length = 0; if (!n || !wsi->http.ah)