mirror of
https://github.com/curl/curl.git
synced 2026-08-26 13:43:34 +03:00
urldata: import port types and conn destination format
Convert more `int port` to `uint16_t` port types. Reshuffle ports in connectdata to save some bytes. Change `conn->destination` format to - make it more readable and thus usable in tracing - add the IPv6 scope_id only when not default (global) and make it resemble more the textual format for IPv6 (e.g. suffix '%<scope_id>') Closes #20918
This commit is contained in:
parent
dfadec7ec3
commit
9325eb5fc4
13 changed files with 54 additions and 66 deletions
|
|
@ -1210,12 +1210,12 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl,
|
|||
/* Clear auth if this redirects to a different port number or protocol,
|
||||
unless permitted */
|
||||
if(!data->set.allow_auth_to_other_hosts && (type != FOLLOW_FAKE)) {
|
||||
int port;
|
||||
uint16_t port;
|
||||
bool clear = FALSE;
|
||||
|
||||
if(data->set.use_port && data->state.allow_port)
|
||||
/* a custom port is used */
|
||||
port = (int)data->set.use_port;
|
||||
port = data->set.use_port;
|
||||
else {
|
||||
curl_off_t value;
|
||||
char *portnum;
|
||||
|
|
@ -1228,7 +1228,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl,
|
|||
}
|
||||
p = portnum;
|
||||
curlx_str_number(&p, &value, 0xffff);
|
||||
port = (int)value;
|
||||
port = (uint16_t)value;
|
||||
curlx_free(portnum);
|
||||
}
|
||||
if(port != data->info.conn_remote_port) {
|
||||
|
|
@ -2969,7 +2969,7 @@ static CURLcode http_add_hd(struct Curl_easy *data,
|
|||
#ifndef CURL_DISABLE_ALTSVC
|
||||
case H1_HD_ALT_USED:
|
||||
if(conn->bits.altused && !Curl_checkheaders(data, STRCONST("Alt-Used")))
|
||||
result = curlx_dyn_addf(req, "Alt-Used: %s:%d\r\n",
|
||||
result = curlx_dyn_addf(req, "Alt-Used: %s:%u\r\n",
|
||||
conn->conn_to_host.name,
|
||||
conn->conn_to_port);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue