/*
* Connecting with IPv4-only support
*/
- if(!remotehost->h_addr_list[0]) {
+ if(!remotehost->addr->h_addr_list[0]) {
/* If there is no addresses in the address list, then we return
error right away */
failf(data, "no address available");
/* This is the loop that attempts to connect to all IP-addresses we
know for the given host. One by one. */
for(rc=-1, aliasindex=0;
- rc && (struct in_addr *)remotehost->h_addr_list[aliasindex];
+ rc && (struct in_addr *)remotehost->addr->h_addr_list[aliasindex];
aliasindex++) {
struct sockaddr_in serv_addr;
/* do this nasty work to do the connect */
memset((char *) &serv_addr, '\0', sizeof(serv_addr));
memcpy((char *)&(serv_addr.sin_addr),
- (struct in_addr *)remotehost->h_addr_list[aliasindex],
+ (struct in_addr *)remotehost->addr->h_addr_list[aliasindex],
sizeof(struct in_addr));
- serv_addr.sin_family = remotehost->h_addrtype;
+ serv_addr.sin_family = remotehost->addr->h_addrtype;
serv_addr.sin_port = htons((unsigned short)port);
rc = connect(sockfd, (struct sockaddr *)&serv_addr,
if(addr)
/* this is the address we've connected to */
- *addr = (struct in_addr *)remotehost->h_addr_list[aliasindex];
+ *addr = (struct in_addr *)remotehost->addr->h_addr_list[aliasindex];
#endif
/* allow NULL-pointers to get passed in */
*
*/
struct sockaddr_in sa;
- struct hostent *h=NULL;
+ struct Curl_dns_entry *h=NULL;
unsigned short porttouse;
char myhost[256] = "";
bool sa_filled_in = FALSE;
if(!sa_filled_in) {
memset((char *)&sa, 0, sizeof(sa));
memcpy((char *)&sa.sin_addr,
- h->h_addr,
- h->h_length);
+ h->addr->h_addr,
+ h->addr->h_length);
sa.sin_family = AF_INET;
sa.sin_addr.s_addr = INADDR_ANY;
}
struct in_addr in;
unsigned short ip[5];
(void) memcpy(&in.s_addr,
- h?*h->h_addr_list:(char *)&sa.sin_addr.s_addr,
+ h?*h->addr->h_addr_list:(char *)&sa.sin_addr.s_addr,
sizeof (in.s_addr));
#ifdef HAVE_INET_NTOA_R
memset((char *) &conn->serv_addr, '\0', sizeof(conn->serv_addr));
memcpy((char *)&(conn->serv_addr.sin_addr),
(struct in_addr *)addr, sizeof(struct in_addr));
- conn->serv_addr.sin_family = hostaddr->h_addrtype;
+ conn->serv_addr.sin_family = hostaddr->addr->h_addrtype;
conn->serv_addr.sin_port = htons((unsigned short)conn->port);
#endif