mirror of
https://github.com/curl/curl.git
synced 2026-08-25 11:33:33 +03:00
urldata: connection bit ipv6_ip is wrong
Eliminate `conn->bits.ipv6_ip` The bit was only correct for the first transfer using a connection. Use `data->state.up.hostname` instead in places that need the URL hostname in its original form. Fix parseurlandfillconn() to not modify `data->state.up.hostname` before copying the connection's hostname, but modify the copy instead, leaving the URL hostname intact. Closes #20919
This commit is contained in:
parent
eb5af3a9c7
commit
412cd2577a
8 changed files with 29 additions and 48 deletions
|
|
@ -2422,13 +2422,9 @@ static CURLcode myssh_connect(struct Curl_easy *data, bool *done)
|
|||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
|
||||
if(conn->bits.ipv6_ip) {
|
||||
char ipv6[MAX_IPADR_LEN];
|
||||
curl_msnprintf(ipv6, sizeof(ipv6), "[%s]", conn->host.name);
|
||||
rc = ssh_options_set(sshc->ssh_session, SSH_OPTIONS_HOST, ipv6);
|
||||
}
|
||||
else
|
||||
rc = ssh_options_set(sshc->ssh_session, SSH_OPTIONS_HOST, conn->host.name);
|
||||
rc = ssh_options_set(sshc->ssh_session, SSH_OPTIONS_HOST,
|
||||
(data->state.up.hostname[0] == '[') ?
|
||||
data->state.up.hostname : conn->host.name);
|
||||
|
||||
if(rc != SSH_OK) {
|
||||
failf(data, "Could not set remote host");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue