curl / Mailing Lists / curl-users / Single Mail

curl-users

Avoiding DNS cache sharing

From: Guillaume Quintard <guillaume.quintard_at_gmail.com>
Date: Mon, 16 Jul 2018 14:50:26 -0700

Hello everyone,

I have an issue with the DNS cache of one easy handle polluting other
transfers and I was wonder if you could help me.

Here's some background:
- multithreaded application that broadcasts HTTPS request to multiple servers.
- so for each IP, I need to point libcurl to IP while still using the
same CURLOPT_URL, for everyone.
- I started with CURLOPT_RESOLVE but that doesn't work because even
with CURLOPT_DNS_CACHE_TIMEOUT set to 0, the data goes into the cache
and messes things up.
- I should use CURLOPT_CONNECT_TO, I think, but I'm targeting centos7
and it's not available on that platform.
- I'd really like to avoid switching to multi handles if possible.

My current attempt focuses on using a shared object per node, but that
is failing. The code is there: https://pastebin.com/Tz0JcFPS (this is
a justquick PoC cobbled together to test the shared object approach).

My question is: is the base idea of using the shared object plain
wrong, or should it work and I "only" botched the implementation? And
is there a better approach I missed?

Please let me now if I forgot anything important.

Best regards,

-- 
Guillaume Quintard
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-07-16