comparison src/proxy.c @ 8977:52fba1dafe0e

[gaim-migrate @ 9751] Remove calls to hstrerror. It's obsolete... but Gaim only uses it on systems that don't have getaddrinfo. This sould have only been a problem on a very small number of systems. See http://sourceforge.net/tracker/?func=detail&aid=772026&group_id=235&atid=100235 for more info. You can major in gun repair. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 19 May 2004 04:41:01 +0000
parents 189ee7356c59
children 4b3e5a5063f9
comparison
equal deleted inserted replaced
8976:6f21aa413b18 8977:52fba1dafe0e
321 gaim_input_remove(req->inpa); 321 gaim_input_remove(req->inpa);
322 322
323 rc=read(req->fd_out, &err, sizeof(err)); 323 rc=read(req->fd_out, &err, sizeof(err));
324 if((rc==4) && (err!=0)) { 324 if((rc==4) && (err!=0)) {
325 char message[1024]; 325 char message[1024];
326 #if HAVE_GETADDRINFO
326 g_snprintf(message, sizeof(message), "DNS error: %s (pid=%d)", 327 g_snprintf(message, sizeof(message), "DNS error: %s (pid=%d)",
327 #if HAVE_GETADDRINFO 328 gai_strerror(err), req->dns_pid);
328 gai_strerror(err),
329 #else 329 #else
330 hstrerror(err), 330 g_snprintf(message, sizeof(message), "DNS error: %d (pid=%d)",
331 err, req->dns_pid);
331 #endif 332 #endif
332 req->dns_pid);
333 gaim_debug(GAIM_DEBUG_ERROR, "dns", "%s\n", message); 333 gaim_debug(GAIM_DEBUG_ERROR, "dns", "%s\n", message);
334 req->callback(NULL, req->data, message); 334 req->callback(NULL, req->data, message);
335 release_dns_child(req); 335 release_dns_child(req);
336 return; 336 return;
337 } 337 }
564 struct hostent *hp; 564 struct hostent *hp;
565 if(!(hp = gethostbyname(dns_params.hostname))) { 565 if(!(hp = gethostbyname(dns_params.hostname))) {
566 write(child_out[1], &h_errno, sizeof(int)); 566 write(child_out[1], &h_errno, sizeof(int));
567 close(child_out[1]); 567 close(child_out[1]);
568 if(opt_debug) 568 if(opt_debug)
569 fprintf(stderr,"DNS Error: %s\n",hstrerror(h_errno)); 569 fprintf(stderr,"DNS Error: %d\n", h_errno);
570 _exit(0); 570 _exit(0);
571 } 571 }
572 memset(&sin, 0, sizeof(struct sockaddr_in)); 572 memset(&sin, 0, sizeof(struct sockaddr_in));
573 memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length); 573 memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length);
574 sin.sin_family = hp->h_addrtype; 574 sin.sin_family = hp->h_addrtype;
640 640
641 if (!inet_aton(hostname, &sin.sin_addr)) { 641 if (!inet_aton(hostname, &sin.sin_addr)) {
642 struct hostent *hp; 642 struct hostent *hp;
643 if(!(hp = gethostbyname(hostname))) { 643 if(!(hp = gethostbyname(hostname))) {
644 gaim_debug(GAIM_DEBUG_ERROR, "dns", 644 gaim_debug(GAIM_DEBUG_ERROR, "dns",
645 "gaim_gethostbyname(\"%s\", %d) failed: %s\n", 645 "gaim_gethostbyname(\"%s\", %d) failed: %d\n",
646 hostname, port, hstrerror(h_errno)); 646 hostname, port, h_errno);
647 return -1; 647 return -1;
648 } 648 }
649 memset(&sin, 0, sizeof(struct sockaddr_in)); 649 memset(&sin, 0, sizeof(struct sockaddr_in));
650 memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length); 650 memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length);
651 sin.sin_family = hp->h_addrtype; 651 sin.sin_family = hp->h_addrtype;