curl / Mailing Lists / curl-library / Single Mail


Re: Avoiding DNS cache sharing

From: Guillaume Quintard <>
Date: Mon, 16 Jul 2018 21:15:23 -0700

On Mon, Jul 16, 2018 at 3:32 PM Daniel Stenberg <> wrote:
> You clearly wanted this email sent to the curl-library mailing list.

Indeed, thank you for correcting that.

> I don't understand what you want and what doesn't work! You said "the data
> goes into the cache and messes things up" and yet you said you explicitly want
> to share the DNS cache between the handles?
> When the CURLOPT_RESOLVE data goes into the cache, then if that cache is set
> to be held by a share object (that shares DNS), that DNS cache is shared
> between all easy handles that uses that same share object.

Sorry, let me try again. The ultimate goal is to have have multiple
threads that will have the same CURLOPT_URL, but that will all connect
to a different IP.

The goal was indeed to have one DNS cache per IP, so that even if a
cache contains multiples entries, at least they'll be the exact same.
But the code I posted didn't work.

Good news is I know why: I apparently needed to also share
the connection pool used the IP:PORT as key but instead it uses
HOST:PORT, right?

Anyway, problem solved, thank you for you time and attention.

Received on 2018-07-17