mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Services and their clients read their own configuration
A service keeps the configuration it was started with (srvparam.config) and its threads and its clients' read it there: limits and counters (alwaysauth, the limiter), RADIUS, dnspr's name servers, and the checks for a reload in the accept loop and in sockmap(). The configuration is still reloaded in place, so it is the current one for now; this is what lets a reload build a new one while the old one still serves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
737bdc7d24
commit
7ec05ff372
7 files changed
+47
-45
No files matched your search
+6
-6
@@ -145,17 +145,17 @@ void * dnsprchild(struct clientparam* param) {
|
||||
}
|
||||
else ip = 0;
|
||||
}
|
||||
if(!ip && conf->numservers){
|
||||
if((param->remsock=param->srv->so._socket(param->sostate, SASOCK(&conf->nservers[0].addr), conf->nservers[0].usetcp? SOCK_STREAM:SOCK_DGRAM, conf->nservers[0].usetcp?IPPROTO_TCP:IPPROTO_UDP)) == INVALID_SOCKET) {
|
||||
if(!ip && param->srv->config->numservers){
|
||||
if((param->remsock=param->srv->so._socket(param->sostate, SASOCK(¶m->srv->config->nservers[0].addr), param->srv->config->nservers[0].usetcp? SOCK_STREAM:SOCK_DGRAM, param->srv->config->nservers[0].usetcp?IPPROTO_TCP:IPPROTO_UDP)) == INVALID_SOCKET) {
|
||||
RETURN(818);
|
||||
}
|
||||
memset(¶m->sinsl, 0, sizeof(param->sinsl));
|
||||
*SAFAMILY(¶m->sinsl) = *SAFAMILY(&conf->nservers[0].addr);
|
||||
*SAFAMILY(¶m->sinsl) = *SAFAMILY(¶m->srv->config->nservers[0].addr);
|
||||
if(bindwithrange(param, param->remsock, ¶m->sinsl, param->extport)) {
|
||||
RETURN(819);
|
||||
}
|
||||
param->sinsr = conf->nservers[0].addr;
|
||||
if(conf->nservers[0].usetcp) {
|
||||
param->sinsr = param->srv->config->nservers[0].addr;
|
||||
if(param->srv->config->nservers[0].usetcp) {
|
||||
if(connectwithpoll(param, param->remsock,(struct sockaddr *)¶m->sinsr,SASIZE(¶m->sinsr),param->srv->timeouts[CONNECT_TO])) RETURN(830);
|
||||
buf-=2;
|
||||
*(unsigned short*)buf = htons(i);
|
||||
@@ -180,7 +180,7 @@ void * dnsprchild(struct clientparam* param) {
|
||||
}
|
||||
param->statssrv64 += len;
|
||||
param->nreads++;
|
||||
if(conf->nservers[0].usetcp) {
|
||||
if(param->srv->config->nservers[0].usetcp) {
|
||||
unsigned short us;
|
||||
us = ntohs(*(unsigned short *)buf);
|
||||
if(us > 4096) RETURN(833);
|
||||
|
||||
Reference in new issue
Block a user