mirror of
https://github.com/3proxy/3proxy.git
synced 2026-09-13 22:57:04 +00:00
Use configured timeouts for DNS operations instead static ones
This commit is contained in:
parent
e59ccd22b1
commit
fcbccf39ef
2 changed files with 3 additions and 3 deletions
|
|
@ -1113,7 +1113,7 @@ unsigned long udpresolve(int af, unsigned char * name, unsigned char * value, un
|
|||
continue;
|
||||
}
|
||||
if(param) param->statscli64 += len;
|
||||
len = sockrecvfrom(sock, sinsr, buf, 4096, 15000);
|
||||
len = sockrecvfrom(sock, sinsr, buf, 4096, conf.timeouts[DNS_TO]*1000);
|
||||
so._shutdown(sock, SHUT_RDWR);
|
||||
so._closesocket(sock);
|
||||
if(len <= 13) {
|
||||
|
|
@ -1125,7 +1125,7 @@ unsigned long udpresolve(int af, unsigned char * name, unsigned char * value, un
|
|||
us = ntohs(*(unsigned short*)buf);
|
||||
len-=2;
|
||||
buf+=2;
|
||||
if(us > 4096 || us < len || (us > len && sockrecvfrom(sock, sinsr, buf+len, us-len, 15000) != us-len)) {
|
||||
if(us > 4096 || us < len || (us > len && sockrecvfrom(sock, sinsr, buf+len, us-len, conf.timeouts[DNS_TO]*1000) != us-len)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ void * dnsprchild(struct clientparam* param) {
|
|||
}
|
||||
param->statscli64 += i;
|
||||
param->nwrites++;
|
||||
len = sockrecvfrom(param->remsock, (struct sockaddr *)¶m->sinsr, buf, BUFSIZE, 15000);
|
||||
len = sockrecvfrom(param->remsock, (struct sockaddr *)¶m->sinsr, buf, BUFSIZE, conf.timeouts[DNS_TO]*1000);
|
||||
if(len <= 13) {
|
||||
RETURN(821);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue