Another local string.
Some checks failed
CI / ubuntu-latest-html-tests (push) Has been cancelled
CI / ubuntu-latest-no-tls (push) Has been cancelled
CI / ubuntu-latest-mbedtls2 (push) Has been cancelled
CI / ubuntu-latest-openssl-3 (push) Has been cancelled
CI / ubuntu-latest-with-old-std (push) Has been cancelled
CI / ubuntu-20-04-openssl-1-1 (push) Has been cancelled
CI / alpine-mbedtls-3_6_0 (push) Has been cancelled
CI / macOS-13-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-3 (push) Has been cancelled
CI / freebsd-14-openssl-3 (push) Has been cancelled
CI / windows-mbedtls (push) Has been cancelled

This commit is contained in:
2025-08-12 04:00:21 -04:00
parent 2dd41b440e
commit 41be8d8c4f

View File

@ -796,7 +796,6 @@ static void Http_dns_cb(int Status, std::optional< std::vector< std::shared_ptr<
static int Http_get(ChainLink *Info, void *Data1)
{
SocketData_t *S;
char *hostname;
const DilloUrl *url;
S = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, VOIDP2INT(Info->LocalKey)) );
@ -812,20 +811,19 @@ static int Http_get(ChainLink *Info, void *Data1)
} else {
url = S->web->url.get();
}
hostname = dStrdup(URL_HOST(url));
const std::string hostname = URL_HOST(url);
S->connect_port = URL_PORT(url);
S->url = a_Url_dup(S->web->url.get()).release();
if (!dStrAsciiCasecmp(URL_SCHEME(S->url), "https"))
S->flags |= HTTP_SOCKET_TLS;
/* Let the user know what we'll do */
MSG_BW(S->web, 1, "DNS resolving %s", hostname);
MSG_BW(S->web, 1, "DNS resolving %s", hostname.c_str());
/* Let the DNS engine resolve the hostname, and when done,
* we'll try to connect the socket from the callback function */
a_Dns_resolve(hostname, Http_dns_cb, Info->LocalKey);
a_Dns_resolve(hostname.c_str(), Http_dns_cb, Info->LocalKey);
dFree(hostname);
return 0;
}