summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeonah Moon <seonah1.moon@samsung.com>2019-09-24 15:25:37 +0900
committerSeonah Moon <seonah1.moon@samsung.com>2019-09-24 15:25:39 +0900
commit4f3fa80d379be530352347c7bd7fb87de4e4669f (patch)
treed3a941b22a453b2b795064b45981f8232504ded7
parenta4bb8ac9a00e106b797056bd699547873bd4564b (diff)
downloadcurl-4f3fa80d379be530352347c7bd7fb87de4e4669f.tar.gz
curl-4f3fa80d379be530352347c7bd7fb87de4e4669f.tar.bz2
curl-4f3fa80d379be530352347c7bd7fb87de4e4669f.zip
http2: Stop drain from being permanently set onsubmit/tizen_base/20190924.062848accepted/tizen/base/20190929.221333
Various functions called within Curl_http2_done() can have the side-effect of setting the Easy connection into drain mode (by calling drain_this()). However, the last time we unset this for a transfer (by calling drained_transfer()) is at the beginning of Curl_http2_done(). If the Curl_easy is reused for another transfer, it is then stuck in drain mode permanently, which in practice makes it unable to write any data in the new transfer. This fix moves the last call to drained_transfer() to later in Curl_http2_done(), after the functions that could potentially call for a drain. Fixes #3966 Reported-by: Josie-H Change-Id: I83ee02bf9017c9aa3d27d50580a0f89b8ec1d05d
-rw-r--r--lib/http2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 0c5f6db0b..0c8b59d1a 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -1163,9 +1163,6 @@ void Curl_http2_done(struct connectdata *conn, bool premature)
if(!httpc->h2) /* not HTTP/2 ? */
return;
- if(data->state.drain)
- drained_transfer(data, httpc);
-
if(premature) {
/* RST_STREAM */
if(!nghttp2_submit_rst_stream(httpc->h2, NGHTTP2_FLAG_NONE,
@@ -1177,6 +1174,10 @@ void Curl_http2_done(struct connectdata *conn, bool premature)
httpc->pause_stream_id = 0;
}
}
+
+ if(data->state.drain)
+ drained_transfer(data, httpc);
+
/* -1 means unassigned and 0 means cleared */
if(http->stream_id > 0) {
int rv = nghttp2_session_set_stream_user_data(httpc->h2,