http: restore h3 to working condition after connection filter introduction
Follow-up to dafdb20a26
HTTP/3 needs a special filter chain, since it does the TLS handling
itself. This PR adds special setup handling in the HTTP protocol handler
that takes are of it.
When a handler, in its setup method, installs filters, the default
behaviour for managing the filter chain is overridden.
Reported-by: Karthikdasari0423 on github
Fixes #9931
Closes #9945
This commit is contained in:
parent
c7cd781a63
commit
ff8fc809c5
48
lib/http.c
48
lib/http.c
@ -218,6 +218,41 @@ const struct Curl_handler Curl_handler_wss = {
|
||||
|
||||
#endif
|
||||
|
||||
static CURLcode h3_setup_conn(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
#ifdef ENABLE_QUIC
|
||||
/* We want HTTP/3 directly, setup the filter chain ourself,
|
||||
* overriding the default behaviour. */
|
||||
DEBUGASSERT(conn->transport == TRNSPRT_QUIC);
|
||||
|
||||
if(!(conn->handler->flags & PROTOPT_SSL)) {
|
||||
failf(data, "HTTP/3 requested for non-HTTPS URL");
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
if(conn->bits.socksproxy) {
|
||||
failf(data, "HTTP/3 is not supported over a SOCKS proxy");
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
if(conn->bits.httpproxy && conn->bits.tunnel_proxy) {
|
||||
failf(data, "HTTP/3 is not supported over a HTTP proxy");
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUGF(infof(data, "HTTP/3 direct conn setup(conn #%ld, index=%d)",
|
||||
conn->connection_id, FIRSTSOCKET));
|
||||
return Curl_cfilter_socket_set(data, conn, FIRSTSOCKET);
|
||||
|
||||
#else /* ENABLE_QUIC */
|
||||
(void)conn;
|
||||
(void)data;
|
||||
DEBUGF(infof(data, "QUIC is not supported in this build"));
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
#endif /* !ENABLE_QUIC */
|
||||
}
|
||||
|
||||
static CURLcode http_setup_conn(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
@ -234,14 +269,11 @@ static CURLcode http_setup_conn(struct Curl_easy *data,
|
||||
data->req.p.http = http;
|
||||
|
||||
if(data->state.httpwant == CURL_HTTP_VERSION_3) {
|
||||
if(conn->handler->flags & PROTOPT_SSL)
|
||||
/* Only go HTTP/3 directly on HTTPS URLs. It needs a UDP socket and does
|
||||
the QUIC dance. */
|
||||
conn->transport = TRNSPRT_QUIC;
|
||||
else {
|
||||
failf(data, "HTTP/3 requested for non-HTTPS URL");
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
conn->transport = TRNSPRT_QUIC;
|
||||
}
|
||||
|
||||
if(conn->transport == TRNSPRT_QUIC) {
|
||||
return h3_setup_conn(data, conn);
|
||||
}
|
||||
else {
|
||||
if(!CONN_INUSE(conn))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user