summaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
authorVyron Tsingaras <vyron@google.com>2020-05-15 08:30:18 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-15 15:49:18 +0200
commit34a5400de113f2badfaa338b00cc361b4ab8355a (patch)
tree84c969cac66a68369c26cd00ed0cc108d1605082 /lib/http2.c
parentcac5374298b3e79405bbdabe38941227c73a4c96 (diff)
downloadcurl-34a5400de113f2badfaa338b00cc361b4ab8355a.tar.gz
http2: keep trying to send pending frames after req.upload_done
Fixes #1410 Closes #5401
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 2f279f7cb..e4733c94b 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -1346,10 +1346,11 @@ CURLcode Curl_http2_done_sending(struct connectdata *conn)
struct HTTP *stream = conn->data->req.protop;
+ struct http_conn *httpc = &conn->proto.httpc;
+ nghttp2_session *h2 = httpc->h2;
+
if(stream->upload_left) {
/* If the stream still thinks there's data left to upload. */
- struct http_conn *httpc = &conn->proto.httpc;
- nghttp2_session *h2 = httpc->h2;
stream->upload_left = 0; /* DONE! */
@@ -1359,6 +1360,23 @@ CURLcode Curl_http2_done_sending(struct connectdata *conn)
(void)h2_process_pending_input(conn, httpc, &result);
}
+
+ /* If nghttp2 still has pending frames unsent */
+ if(nghttp2_session_want_write(h2)) {
+ struct Curl_easy *data = conn->data;
+ struct SingleRequest *k = &data->req;
+ int rv;
+
+ 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;
+ }
}
return result;
}