mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 18:45:40 +08:00
re-authenticate connection on configuration change
This commit is contained in:
parent
eeb2d78fb1
commit
938b1d1aab
@ -519,6 +519,7 @@ int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int
|
|||||||
|
|
||||||
freeconf(&conf);
|
freeconf(&conf);
|
||||||
res = readconfig(fp);
|
res = readconfig(fp);
|
||||||
|
conf.version++;
|
||||||
|
|
||||||
if(res) RETURN(res);
|
if(res) RETURN(res);
|
||||||
if(!writable)fclose(fp);
|
if(!writable)fclose(fp);
|
||||||
|
@ -1685,8 +1685,8 @@ int reload (void){
|
|||||||
|
|
||||||
fp = confopen();
|
fp = confopen();
|
||||||
if(fp){
|
if(fp){
|
||||||
conf.version++;
|
|
||||||
error = readconfig(fp);
|
error = readconfig(fp);
|
||||||
|
conf.version++;
|
||||||
if(error) {
|
if(error) {
|
||||||
freeconf(&conf);
|
freeconf(&conf);
|
||||||
}
|
}
|
||||||
|
@ -710,7 +710,7 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
void srvinit(struct srvparam * srv, struct clientparam *param){
|
void srvinit(struct srvparam * srv, struct clientparam *param){
|
||||||
|
|
||||||
memset(srv, 0, sizeof(struct srvparam));
|
memset(srv, 0, sizeof(struct srvparam));
|
||||||
srv->version = conf.version;
|
srv->version = conf.version + 1;
|
||||||
srv->paused = conf.paused;
|
srv->paused = conf.paused;
|
||||||
srv->logfunc = conf.logfunc;
|
srv->logfunc = conf.logfunc;
|
||||||
if(srv->logformat)myfree(srv->logformat);
|
if(srv->logformat)myfree(srv->logformat);
|
||||||
|
@ -68,7 +68,7 @@ int sockmap(struct clientparam * param, int timeo){
|
|||||||
|
|
||||||
while (!stop&&!conf.timetoexit){
|
while (!stop&&!conf.timetoexit){
|
||||||
sasize = sizeof(struct sockaddr_in);
|
sasize = sizeof(struct sockaddr_in);
|
||||||
if(param->version != conf.version){
|
if(param->version < conf.version){
|
||||||
if (res = (*param->srv->authfunc)(param)) {return(res);}
|
if (res = (*param->srv->authfunc)(param)) {return(res);}
|
||||||
param->paused = conf.paused;
|
param->paused = conf.paused;
|
||||||
param->version = conf.version;
|
param->version = conf.version;
|
||||||
|
Loading…
Reference in New Issue
Block a user