mirror of
https://github.com/3proxy/3proxy.git
synced 2026-04-12 16:00:11 +08:00
Support building without standard resolvers (NOSTDRESOLVE)
build from stra
This commit is contained in:
parent
c853ea5b9e
commit
238ed094dd
@ -641,7 +641,7 @@ pthread_mutex_t gethostbyname_mutex;
|
|||||||
int ghbn_init = 0;
|
int ghbn_init = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NOSTDRESOLVE
|
||||||
#ifdef GETHOSTBYNAME_R
|
#ifdef GETHOSTBYNAME_R
|
||||||
struct hostent * my_gethostbyname(char *name, char *buf, struct hostent *hp){
|
struct hostent * my_gethostbyname(char *name, char *buf, struct hostent *hp){
|
||||||
struct hostent *result;
|
struct hostent *result;
|
||||||
@ -656,6 +656,7 @@ struct hostent * my_gethostbyname(char *name, char *buf, struct hostent *hp){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NOIPV6
|
#ifdef NOIPV6
|
||||||
uint32_t getip(unsigned char *name){
|
uint32_t getip(unsigned char *name){
|
||||||
@ -689,6 +690,7 @@ uint32_t getip(unsigned char *name){
|
|||||||
if(conf.demanddialprog) system(conf.demanddialprog);
|
if(conf.demanddialprog) system(conf.demanddialprog);
|
||||||
return (*tmpresolv)(AF_INET, name, (unsigned char *)&retval)?retval:0;
|
return (*tmpresolv)(AF_INET, name, (unsigned char *)&retval)?retval:0;
|
||||||
}
|
}
|
||||||
|
#ifndef NOSTDRESOLVE
|
||||||
#if !defined(_WIN32) && !defined(GETHOSTBYNAME_R)
|
#if !defined(_WIN32) && !defined(GETHOSTBYNAME_R)
|
||||||
if(!ghbn_init){
|
if(!ghbn_init){
|
||||||
pthread_mutex_init(&gethostbyname_mutex, NULL);
|
pthread_mutex_init(&gethostbyname_mutex, NULL);
|
||||||
@ -707,6 +709,9 @@ uint32_t getip(unsigned char *name){
|
|||||||
#endif
|
#endif
|
||||||
#ifdef GETHOSTBYNAME_R
|
#ifdef GETHOSTBYNAME_R
|
||||||
#undef gethostbyname
|
#undef gethostbyname
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
retval=0;
|
||||||
#endif
|
#endif
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user