Subject: copy hostent from callback

copy hostent from callback

From: Raphael Bauduin <rblists_at_gmail.com>
Date: Tue, 10 Mar 2015 09:54:46 +0100

Hi,

I'm trying to copy the hostent parameter passed to the callback of
ares_gethostbyname to the user parameter arg also passed to the callback.
arg is a struct with a field named host of type struct hostent *.
The doc says about hostent: "the ares library will free it when the
callback returns". What's the correct way to copy hostent to arg->host as
it needs a deep copy?
Is there another, better approach?

Thanks

Raph
Received on 2015-03-10