curl / Mailing Lists / curl-library / Single Mail


Re: Retrieve all addresses mapped to specific host, not just one IP

From: myLC--- via curl-library <>
Date: Mon, 13 Aug 2018 11:22:37 +0200

On 08/12/2018 06:55 PM, Daniel Stenberg wrote:
> ...
> We wouldn't expose internals, either way. If we would
> provide the data in an array or struct somehow, that would
> be made specifically for exporting purposes. That would be
> no difference between providing the data in a callback or
> post-transfer in a curl_easy_getinfo() call.
> I think most existing users would presume such data to
> become available via curl_easy_getinfo(), like the primary
> IP and friends already are.

I'm obvious not that acquainted with curl. I took a glance
at the source. Unless I'm mistaken, you are using a renamed
addrinfo struct on the inside.
Could it lead to problems with multiple threads, if you
simply passed a pointer to that (chain of) struct(s) via
curl_easy_getinfo? If so, you'd have to copy it (or convert
it to something else). Users then probably copy the
addresses to an entirely different format anyhow.
By using the callback after having resolved the hostname,
you'd dispose of this burden. That was my thinking. Given
that I still know only very little about curl, however, that
train of thought might be entirely off tracks. ;-)

Received on 2018-08-13