diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-04-25 19:00:57 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-04-25 19:00:57 +0000 |
commit | 8927ddec1687a438354eae6c527da92c6c63b50b (patch) | |
tree | 5f443d4fa1d0ebf681b0ff88dc5ea06c8b8043c9 /lib/ftp.c | |
parent | f6525ae20087290e1ce91839461e671b9ec81cc0 (diff) |
In order to not get problems with DNS cache pruning, we no longer store
any name resolved data in any curl handle struct. That way, we won't mind
if the cache entries are pruned for the next time we need them. We'll just
resolve them again instead.
This changes the Curl_resolv() proto. It modifies the SessionHandle struct
but perhaps most importantly, it'll make the internals somewhat dependent
on the DNS cache not being disabled as that will cripple operations somewhat.
Especially for persistant connections.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -1360,7 +1360,6 @@ CURLcode ftp_use_pasv(struct connectdata *conn) int modeoff; unsigned short connectport; /* the local port connect() should use! */ unsigned short newport; /* remote port, not necessary the local one */ - char *hostdataptr=NULL; /* newhost must be able to hold a full IP-style address in ASCII, which in the IPv6 case means 5*8-1 = 39 letters */ @@ -1450,16 +1449,19 @@ CURLcode ftp_use_pasv(struct connectdata *conn) if(data->change.proxy) { /* * This is a tunnel through a http proxy and we need to connect to the - * proxy again here. We already have the name info for it since the - * previous lookup. + * proxy again here. + * + * We don't want to rely on a former host lookup that might've expired + * now, instead we remake the lookup here and now! */ - addr = conn->hostaddr; + addr = Curl_resolv(data, conn->proxyhost, conn->port); connectport = - (unsigned short)conn->port; /* we connect to the proxy's port */ + (unsigned short)conn->port; /* we connect to the proxy's port */ + } else { /* normal, direct, ftp connection */ - addr = Curl_resolv(data, newhostp, newport, &hostdataptr); + addr = Curl_resolv(data, newhostp, newport); if(!addr) { failf(data, "Can't resolve new host %s:%d", newhostp, newport); return CURLE_FTP_CANT_GET_HOST; |