* returns a pointer to the malloc()ed copy. You need to call free() on the
* returned buffer when you're done with it.
*/
-Curl_addrinfo *Curl_addrinfo_copy(void *org, int port)
+Curl_addrinfo *Curl_addrinfo_copy(const void *org, int port)
{
- struct hostent *orig = org;
+ const struct hostent *orig = org;
return Curl_he2ai(orig, port);
}
/* [ipv4 only] Curl_he2ai() converts a struct hostent to a Curl_addrinfo chain
and returns it */
-Curl_addrinfo *Curl_he2ai(struct hostent *, int port);
+Curl_addrinfo *Curl_he2ai(const struct hostent *, int port);
/* relocate a hostent struct */
void Curl_hostent_relocate(struct hostent *h, long offset);
/* Clone a Curl_addrinfo struct, works protocol independently */
-Curl_addrinfo *Curl_addrinfo_copy(void *orig, int port);
+Curl_addrinfo *Curl_addrinfo_copy(const void *orig, int port);
/*
* Curl_printable_address() returns a printable version of the 1st address
* #define h_addr h_addr_list[0]
*/
-Curl_addrinfo *Curl_he2ai(struct hostent *he, int port)
+Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port)
{
Curl_addrinfo *ai;
Curl_addrinfo *prevai = NULL;
* address. But this is an ipv6 build and then we don't copy the address, we
* just return the same pointer!
*/
-Curl_addrinfo *Curl_addrinfo_copy(void *source, int port)
+Curl_addrinfo *Curl_addrinfo_copy(const void *orig, int port)
{
(void) port;
- return source;
+ return (Curl_addrinfo*)orig;
}
#endif