comparison src/proxy.c @ 3283:f4f4232f4e83

[gaim-migrate @ 3301] Sean Davis has a cool first name--and he decided gethostbyname should report its errors. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Fri, 31 May 2002 02:00:41 +0000
parents 778e4e27c33e
children 8d0fa912ecaf
comparison
equal deleted inserted replaced
3282:c32a8a97e011 3283:f4f4232f4e83
124 static struct sockaddr_in sin; 124 static struct sockaddr_in sin;
125 125
126 if (!inet_aton(host, &sin.sin_addr)) { 126 if (!inet_aton(host, &sin.sin_addr)) {
127 struct hostent *hp; 127 struct hostent *hp;
128 if (!(hp = gethostbyname(host))) { 128 if (!(hp = gethostbyname(host))) {
129 debug_printf("gaim_gethostbyname(\"%s\", %d) failed: %s",
130 host, port, hstrerror(h_errno));
129 return NULL; 131 return NULL;
130 } 132 }
131 memset(&sin, 0, sizeof(struct sockaddr_in)); 133 memset(&sin, 0, sizeof(struct sockaddr_in));
132 memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length); 134 memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length);
133 sin.sin_family = hp->h_addrtype; 135 sin.sin_family = hp->h_addrtype;