diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-06-23 14:02:54 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-06-23 15:13:27 +0200 |
commit | ff1c37cbe37db360adc9b50128ae8abf225fda2d (patch) | |
tree | 7a58f5642f893876aa100b648d504b85323d770b /lib | |
parent | abbc5d6044f95ba84acaae6912b2d097c6b435d1 (diff) | |
download | curl-ff1c37cbe37db360adc9b50128ae8abf225fda2d.tar.gz |
url: make sure pushed streams get an allocated download buffer
Follow-up to c4e6968127e876b0
When a new transfer is created, as a resuly of an acknowledged push,
that transfer needs a download buffer allocated.
Closes #5590
Diffstat (limited to 'lib')
-rw-r--r-- | lib/multi.c | 9 | ||||
-rw-r--r-- | lib/multiif.h | 1 | ||||
-rw-r--r-- | lib/url.c | 5 |
3 files changed, 11 insertions, 4 deletions
diff --git a/lib/multi.c b/lib/multi.c index 121a44593..b106c9495 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1642,10 +1642,11 @@ static CURLcode protocol_connect(struct connectdata *conn, } /* - * preconnect() is called immediately before a connect starts. When a redirect - * is followed, this is then called multiple times during a single transfer. + * Curl_preconnect() is called immediately before a connect starts. When a + * redirect is followed, this is then called multiple times during a single + * transfer. */ -static CURLcode preconnect(struct Curl_easy *data) +CURLcode Curl_preconnect(struct Curl_easy *data) { if(!data->state.buffer) { data->state.buffer = malloc(data->set.buffer_size + 1); @@ -1763,7 +1764,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, case CURLM_STATE_CONNECT: /* Connect. We want to get a connection identifier filled in. */ /* init this transfer. */ - result = preconnect(data); + result = Curl_preconnect(data); if(result) break; diff --git a/lib/multiif.h b/lib/multiif.h index c07587baf..7d574df92 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -37,6 +37,7 @@ void Curl_detach_connnection(struct Curl_easy *data); bool Curl_multiplex_wanted(const struct Curl_multi *multi); void Curl_set_in_callback(struct Curl_easy *data, bool value); bool Curl_is_in_callback(struct Curl_easy *easy); +CURLcode Curl_preconnect(struct Curl_easy *data); /* Internal version of curl_multi_init() accepts size parameters for the socket and connection hashes */ @@ -3981,6 +3981,11 @@ CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn) { struct SingleRequest *k = &data->req; + /* if this is a pushed stream, we need this: */ + CURLcode result = Curl_preconnect(data); + if(result) + return result; + if(conn) { conn->bits.do_more = FALSE; /* by default there's no curl_do_more() to use */ |