From: Robert Ronto Date: Mon, 15 Mar 2021 14:35:10 +0000 (+0100) Subject: http2: don't set KEEP_SEND when there's no more data to be sent X-Git-Tag: curl-7_76_0~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=068661bb028d7c9f08e5d35cf877c9584f9a46e5;p=thirdparty%2Fcurl.git http2: don't set KEEP_SEND when there's no more data to be sent this should fix an issue where curl sometimes doesn't send out a request with authorization info after a 401 is received over http2 Closes #6747 --- diff --git a/lib/http2.c b/lib/http2.c index 01322cb013..70f4caceae 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -1446,13 +1446,15 @@ CURLcode Curl_http2_done_sending(struct Curl_easy *data, H2BUGF(infof(data, "HTTP/2 still wants to send data (easy %p)\n", data)); - /* re-set KEEP_SEND to make sure we are called again */ - k->keepon |= KEEP_SEND; - /* and attempt to send the pending frames */ rv = h2_session_send(data, h2); if(rv != 0) result = CURLE_SEND_ERROR; + + if(nghttp2_session_want_write(h2)) { + /* re-set KEEP_SEND to make sure we are called again */ + k->keepon |= KEEP_SEND; + } } } return result;