mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-07 04:02:23 +03:00
curl 2026-06-24 (68720b48)
Code extracted from:
https://github.com/curl/curl.git
at commit 68720b4837284335b2d63cb358f8f6ce65f5bc55 (curl-8_21_0).
This commit is contained in:
1 parent
fe97809d5a
commit
ecbccb29a7
235 files changed
+16601
-11001
No files matched your search
+16
-21
@@ -29,6 +29,7 @@
|
||||
#include "curl_trc.h"
|
||||
#include "cfilters.h"
|
||||
#include "cf-dns.h"
|
||||
#include "cf-setup.h"
|
||||
#include "connect.h"
|
||||
#include "hostip.h"
|
||||
#include "httpsrr.h"
|
||||
@@ -62,7 +63,6 @@ static void cf_hc_baller_discard(struct cf_hc_baller *b,
|
||||
struct Curl_easy *data)
|
||||
{
|
||||
if(b->cf) {
|
||||
Curl_conn_cf_close(b->cf, data);
|
||||
Curl_conn_cf_discard_chain(&b->cf, data);
|
||||
b->cf = NULL;
|
||||
}
|
||||
@@ -304,13 +304,14 @@ static enum alpnid cf_hc_get_httpsrr_alpn(struct Curl_cfilter *cf,
|
||||
size_t i;
|
||||
|
||||
/* Do we have HTTPS-RR information? */
|
||||
rr = Curl_conn_dns_get_https(data, cf->sockindex);
|
||||
rr = Curl_conn_dns_get_https(
|
||||
data, cf->sockindex, Curl_conn_get_destination(cf->conn, cf->sockindex));
|
||||
|
||||
/* We do not support `rr->no_def_alpn`. */
|
||||
if(Curl_httpsrr_applicable(data, rr) && !rr->no_def_alpn) {
|
||||
for(i = 0; i < CURL_ARRAYSIZE(rr->alpns); ++i) {
|
||||
enum alpnid alpn_rr = (enum alpnid)rr->alpns[i];
|
||||
if(alpn_rr == not_this_one) /* don't want this one */
|
||||
if(alpn_rr == not_this_one) /* do not want this one */
|
||||
continue;
|
||||
switch(alpn_rr) {
|
||||
case ALPN_h3:
|
||||
@@ -493,7 +494,8 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf,
|
||||
*done = FALSE;
|
||||
|
||||
if(!ctx->httpsrr_resolved) {
|
||||
ctx->httpsrr_resolved = Curl_conn_dns_resolved_https(data, cf->sockindex);
|
||||
ctx->httpsrr_resolved = Curl_conn_dns_resolved_https(
|
||||
data, cf->sockindex, Curl_conn_get_destination(cf->conn, cf->sockindex));
|
||||
#ifdef DEBUGBUILD
|
||||
if(!ctx->httpsrr_resolved && getenv("CURL_DBG_AWAIT_HTTPSRR")) {
|
||||
CURL_TRC_CF(data, cf, "awaiting HTTPS-RR");
|
||||
@@ -576,7 +578,7 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf,
|
||||
}
|
||||
|
||||
out:
|
||||
CURL_TRC_CF(data, cf, "connect -> %d, done=%d", result, *done);
|
||||
CURL_TRC_CF(data, cf, "connect -> %d, done=%d", (int)result, *done);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -616,7 +618,7 @@ static CURLcode cf_hc_shutdown(struct Curl_cfilter *cf,
|
||||
result = ctx->ballers[i].result;
|
||||
}
|
||||
}
|
||||
CURL_TRC_CF(data, cf, "shutdown -> %d, done=%d", result, *done);
|
||||
CURL_TRC_CF(data, cf, "shutdown -> %d, done=%d", (int)result, *done);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -635,7 +637,8 @@ static CURLcode cf_hc_adjust_pollset(struct Curl_cfilter *cf,
|
||||
continue;
|
||||
result = Curl_conn_cf_adjust_pollset(b->cf, data, ps);
|
||||
}
|
||||
CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %u socks", result, ps->n);
|
||||
CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %u socks", (int)result,
|
||||
ps->n);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -731,18 +734,6 @@ out:
|
||||
return result;
|
||||
}
|
||||
|
||||
static void cf_hc_close(struct Curl_cfilter *cf, struct Curl_easy *data)
|
||||
{
|
||||
CURL_TRC_CF(data, cf, "close");
|
||||
cf_hc_ctx_close(data, cf->ctx);
|
||||
cf->connected = FALSE;
|
||||
|
||||
if(cf->next) {
|
||||
cf->next->cft->do_close(cf->next, data);
|
||||
Curl_conn_cf_discard_chain(&cf->next, data);
|
||||
}
|
||||
}
|
||||
|
||||
static void cf_hc_destroy(struct Curl_cfilter *cf, struct Curl_easy *data)
|
||||
{
|
||||
struct cf_hc_ctx *ctx = cf->ctx;
|
||||
@@ -757,7 +748,6 @@ struct Curl_cftype Curl_cft_http_connect = {
|
||||
CURL_LOG_LVL_NONE,
|
||||
cf_hc_destroy,
|
||||
cf_hc_connect,
|
||||
cf_hc_close,
|
||||
cf_hc_shutdown,
|
||||
cf_hc_adjust_pollset,
|
||||
cf_hc_data_pending,
|
||||
@@ -822,9 +812,14 @@ CURLcode Curl_cf_https_setup(struct Curl_easy *data,
|
||||
|
||||
DEBUGASSERT(conn->scheme->protocol == CURLPROTO_HTTPS);
|
||||
|
||||
/* This filter is intended for HTTPS using ALPN and does
|
||||
* not support HTTPS Eyeballing to a proxy. */
|
||||
if((conn->scheme->protocol != CURLPROTO_HTTPS) ||
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
conn->bits.origin_is_proxy ||
|
||||
#endif
|
||||
!conn->bits.tls_enable_alpn)
|
||||
goto out;
|
||||
goto out;
|
||||
|
||||
result = cf_hc_add(data, conn, sockindex, conn->transport_wanted);
|
||||
|
||||
|
||||
Reference in new issue
Block a user