#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)
{
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))