cURL / Mailing Lists / curl-library / Single Mail


Re: Mom, I got a dns cache in my face!

From: Sterling Hughes <>
Date: Thu, 17 Jan 2002 00:55:54 +0100

> Hey (Sterling)!
> This took me a few hours to sort out, please bear with me. We're passed
> midnight with an hour.
> We need to involve the port number in the DNS cache (when we run on
> IPv6-enabled hosts at least), or we need to ignore the port number in the
> 'addrinfo' and always replace it with our own. The later would mean a really
> crude hack.
> That's because we use getaddrinfo() to get host information, and that
> function takes port number as an argument. It then returns a linked list with
> information, in which the port number is stored (later used for connection).
> The current dns cache only cares about the host name. Alas, when we try to
> ftp to a IP number and wans to use PASV or EPSV and ask the server for
> another port to connect to...
> Yes, the cache returns the same info as the last lookup did, which then uses
> the *former* port number and not the new one that we wanna lookup now. So
> then after having issued the PASV or EPSV command, curl connects to the
> original port once again and not to the new port just opened for the data
> connection.
> Sterling, are you up for a fix?

    Ok, sure... Go to bed ;), I'll try and get it done be for morning...
    I'm thinking hostcache entry that looks like::
    i thought of doing this before, then forgot :)

> --
> Daniel Stenberg -- curl groks URLs --
Received on 2002-01-17