ip2name_dns.c (sarg-2.3.11) | : | ip2name_dns.c (sarg-2.4.0) | ||
---|---|---|---|---|
/* | /* | |||
* SARG Squid Analysis Report Generator http://sarg.sourceforge.net | * SARG Squid Analysis Report Generator http://sarg.sourceforge.net | |||
* 1998, 2013 | * 1998, 2015 | |||
* | * | |||
* SARG donations: | * SARG donations: | |||
* please look at http://sarg.sourceforge.net/donations.php | * please look at http://sarg.sourceforge.net/donations.php | |||
* Support: | * Support: | |||
* http://sourceforge.net/projects/sarg/forums/forum/363374 | * http://sourceforge.net/projects/sarg/forums/forum/363374 | |||
* --------------------------------------------------------------------- | * --------------------------------------------------------------------- | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
skipping to change at line 93 | skipping to change at line 93 | |||
before it becomes a fatal error. I could find no clues on interne t so I try once and | before it becomes a fatal error. I could find no clues on interne t so I try once and | |||
leave it at that. Considering the number of IP addresses to resol ve and the absence | leave it at that. Considering the number of IP addresses to resol ve and the absence | |||
of serious consequences should some IP fail to be resolved proper ly, it is best | of serious consequences should some IP fail to be resolved proper ly, it is best | |||
not waste too much time on this. | not waste too much time on this. | |||
*/ | */ | |||
error=getnameinfo((struct sockaddr *)&sa,sizeof(sa),host,sizeof(h ost),NULL,0,NI_NAMEREQD); | error=getnameinfo((struct sockaddr *)&sa,sizeof(sa),host,sizeof(h ost),NULL,0,NI_NAMEREQD); | |||
} | } | |||
if (error==EAI_NONAME) | if (error==EAI_NONAME) | |||
return(INRC_NotFound); | return(INRC_NotFound); | |||
if (error!=0) { | if (error!=0) { | |||
debuga(_("IP to name resolution (getnameinfo) on IP address \"%s\ " failed with error %d - %s\n"),ip,error,gai_strerror(error)); | debuga(__FILE__,__LINE__,_("IP to name resolution (getnameinfo) o n IP address \"%s\" failed with error %d - %s\n"),ip,error,gai_strerror(error)); | |||
return(INRC_Error); | return(INRC_Error); | |||
} | } | |||
safe_strcpy(ip,host,ip_len); | safe_strcpy(ip,host,ip_len); | |||
#else //HAVE_GETNAMEINFO | #else //HAVE_GETNAMEINFO | |||
struct in_addr addr; | struct in_addr addr; | |||
struct hostent *hp; | struct hostent *hp; | |||
char **p; | char **p; | |||
#ifdef __linux | #ifdef __linux | |||
extern int h_errno; | extern int h_errno; | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |