mirror of
https://github.com/curl/curl.git
synced 2026-04-28 19:12:13 +03:00
cf-https-connect: use the passed in dns struct pointer
... instead of digging it out from the connection struct. Plus: simplify struct referencing in the condition. Closes #17092
This commit is contained in:
parent
834836dc14
commit
1102ea9f4b
1 changed files with 11 additions and 11 deletions
|
|
@ -664,22 +664,22 @@ CURLcode Curl_cf_https_setup(struct Curl_easy *data,
|
|||
|
||||
if(conn->bits.tls_enable_alpn) {
|
||||
#ifdef USE_HTTPSRR
|
||||
/* Is there a HTTPSRR and if so, do its ALPNs it apply here?
|
||||
/* Is there a HTTPSRR use its ALPNs here.
|
||||
* We are here after having selected a connection to a host+port and
|
||||
* can no longer change that. Any HTTPSRR advice for other hosts and ports
|
||||
* we need to ignore. */
|
||||
if(conn->dns_entry && conn->dns_entry->hinfo &&
|
||||
!conn->dns_entry->hinfo->no_def_alpn && /* ALPNs are defaults */
|
||||
(!conn->dns_entry->hinfo->target || /* for same host */
|
||||
!conn->dns_entry->hinfo->target[0] ||
|
||||
(conn->dns_entry->hinfo->target[0] == '.' &&
|
||||
!conn->dns_entry->hinfo->target[1])) &&
|
||||
(conn->dns_entry->hinfo->port < 0 || /* for same port */
|
||||
conn->dns_entry->hinfo->port == conn->remote_port)) {
|
||||
struct Curl_https_rrinfo *rr = remotehost ? remotehost->hinfo : NULL;
|
||||
if(rr && !rr->no_def_alpn && /* ALPNs are defaults */
|
||||
(!rr->target || /* for same host */
|
||||
!rr->target[0] ||
|
||||
(rr->target[0] == '.' &&
|
||||
!rr->target[1])) &&
|
||||
(rr->port < 0 || /* for same port */
|
||||
rr->port == conn->remote_port)) {
|
||||
size_t i;
|
||||
for(i = 0; i < CURL_ARRAYSIZE(conn->dns_entry->hinfo->alpns) &&
|
||||
for(i = 0; i < CURL_ARRAYSIZE(rr->alpns) &&
|
||||
alpn_count < CURL_ARRAYSIZE(alpn_ids); ++i) {
|
||||
enum alpnid alpn = conn->dns_entry->hinfo->alpns[i];
|
||||
enum alpnid alpn = rr->alpns[i];
|
||||
if(cf_https_alpns_contain(alpn, alpn_ids, alpn_count))
|
||||
continue;
|
||||
switch(alpn) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue