summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-05-12 21:58:46 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-05-12 22:34:15 +0200
commit2e7d7a22048a33bbb77051426de0c6a8ca62e326 (patch)
tree8d9300fa8a10b2fdc526755d1bd529563c927dcf
parentc3d7db4ecb2f8a0b22bd7cdf54ef10c119ebcc48 (diff)
downloadcurl-2e7d7a22048a33bbb77051426de0c6a8ca62e326.tar.gz
http2: getsock fix for uploads
When there's an upload in progress, make sure to wait for the socket to become writable. Detected-by: steini2000 on github Bug: #2520
-rw-r--r--lib/http2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 770ebdab5..58f4c9920 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -108,6 +108,7 @@ static int http2_perform_getsock(const struct connectdata *conn,
int numsocks)
{
const struct http_conn *c = &conn->proto.httpc;
+ struct SingleRequest *k = &conn->data->req;
int bitmap = GETSOCK_BLANK;
(void)numsocks;
@@ -119,7 +120,9 @@ static int http2_perform_getsock(const struct connectdata *conn,
always be ready for one */
bitmap |= GETSOCK_READSOCK(FIRSTSOCKET);
- if(nghttp2_session_want_write(c->h2))
+ /* we're still uploading or the HTTP/2 layer wants to send data */
+ if((k->keepon & KEEP_SEND|KEEP_SEND_PAUSE) == KEEP_SEND) ||
+ nghttp2_session_want_write(c->h2))
bitmap |= GETSOCK_WRITESOCK(FIRSTSOCKET);
return bitmap;