mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:53:37 +03:00
ftp: retry getpeername for FTP with TCP_FASTOPEN
In the case of TFO, the remote host name is not resolved at the connetion time. For FTP that has lead to missing hostname for the secondary connection. Therefore the name resolution is done at the time, when FTP requires it. Fixes #6252 Closes #6265 Closes #6282
This commit is contained in:
parent
7a6fdd503d
commit
2c0d721215
3 changed files with 71 additions and 46 deletions
11
lib/ftp.c
11
lib/ftp.c
|
|
@ -1940,6 +1940,17 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
|
|||
#endif
|
||||
{
|
||||
/* normal, direct, ftp connection */
|
||||
DEBUGASSERT(ftpc->newhost);
|
||||
|
||||
/* postponed address resolution in case of tcp fastopen */
|
||||
if(conn->bits.tcp_fastopen && !conn->bits.reuse && !ftpc->newhost[0]) {
|
||||
Curl_conninfo_remote(conn, conn->sock[FIRSTSOCKET]);
|
||||
Curl_safefree(ftpc->newhost);
|
||||
ftpc->newhost = strdup(control_address(conn));
|
||||
if(!ftpc->newhost)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
rc = Curl_resolv(conn, ftpc->newhost, ftpc->newport, FALSE, &addr);
|
||||
if(rc == CURLRESOLV_PENDING)
|
||||
/* BLOCKING */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue