mirror of
https://github.com/curl/curl.git
synced 2026-08-24 12:33:37 +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
|
|
@ -164,7 +164,7 @@ static CURLcode dynhds_add_custom(struct Curl_easy *data,
|
|||
|
||||
void Curl_http_proxy_get_destination(struct Curl_cfilter *cf,
|
||||
const char **phostname,
|
||||
int *pport, bool *pipv6_ip)
|
||||
uint16_t *pport, bool *pipv6_ip)
|
||||
{
|
||||
DEBUGASSERT(cf);
|
||||
DEBUGASSERT(cf->conn);
|
||||
|
|
@ -199,14 +199,14 @@ CURLcode Curl_http_proxy_create_CONNECT(struct httpreq **preq,
|
|||
struct cf_proxy_ctx *ctx = cf->ctx;
|
||||
const char *hostname = NULL;
|
||||
char *authority = NULL;
|
||||
int port;
|
||||
uint16_t port;
|
||||
bool ipv6_ip;
|
||||
CURLcode result;
|
||||
struct httpreq *req = NULL;
|
||||
|
||||
Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip);
|
||||
|
||||
authority = curl_maprintf("%s%s%s:%d", ipv6_ip ? "[" : "", hostname,
|
||||
authority = curl_maprintf("%s%s%s:%u", ipv6_ip ? "[" : "", hostname,
|
||||
ipv6_ip ? "]" : "", port);
|
||||
if(!authority) {
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue