mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
IsPipeliningPossible: fixed for http2
This commit is contained in:
parent
8b38fcf2f6
commit
193251794a
15
lib/url.c
15
lib/url.c
@ -2810,21 +2810,26 @@ static bool SocketIsDead(curl_socket_t sock)
|
|||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IsPipeliningPossible() returns TRUE if the options set would allow
|
||||||
|
* pipelining/multiplexing and the connection is using a HTTP protocol.
|
||||||
|
*/
|
||||||
static bool IsPipeliningPossible(const struct SessionHandle *handle,
|
static bool IsPipeliningPossible(const struct SessionHandle *handle,
|
||||||
const struct connectdata *conn)
|
const struct connectdata *conn)
|
||||||
{
|
{
|
||||||
/* If a HTTP protocol and pipelining is enabled */
|
/* If a HTTP protocol and pipelining is enabled */
|
||||||
if((conn->handler->protocol & PROTO_FAMILY_HTTP) &&
|
if(conn->handler->protocol & PROTO_FAMILY_HTTP) {
|
||||||
Curl_pipeline_wanted(handle->multi, CURLPIPE_ANY)) {
|
|
||||||
|
|
||||||
if((handle->set.httpversion != CURL_HTTP_VERSION_1_0) &&
|
if(Curl_pipeline_wanted(handle->multi, CURLPIPE_HTTP1) &&
|
||||||
|
(handle->set.httpversion != CURL_HTTP_VERSION_1_0) &&
|
||||||
(handle->set.httpreq == HTTPREQ_GET ||
|
(handle->set.httpreq == HTTPREQ_GET ||
|
||||||
handle->set.httpreq == HTTPREQ_HEAD))
|
handle->set.httpreq == HTTPREQ_HEAD))
|
||||||
/* didn't ask for HTTP/1.0 and a GET or HEAD */
|
/* didn't ask for HTTP/1.0 and a GET or HEAD */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if(conn->httpversion == 20)
|
if(Curl_pipeline_wanted(handle->multi, CURLPIPE_MULTIPLEX) &&
|
||||||
/* talking HTTP/2 */
|
(handle->set.httpversion == CURL_HTTP_VERSION_2_0))
|
||||||
|
/* allows HTTP/2 */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user