cURL / Mailing Lists / curl-library / Single Mail


Mom, I got a dns cache in my face!

From: Daniel Stenberg <>
Date: Thu, 17 Jan 2002 00:59:24 +0100 (MET)

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

Sterling, are you up for a fix?

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