mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Race conditions fixed on config reload
Race conditions on logging and name resolution
This commit is contained in:
1 parent
1220c504bd
commit
bd37ffa2f7
7 files changed
+41
-21
No files matched your search
+4
-3
@@ -310,7 +310,7 @@ static int h_log(int argc, unsigned char ** argv){
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
FILE *fp, *fp1;
|
||||
FILE *fp;
|
||||
if(argc > 2) {
|
||||
conf.logtype = getrotate(*argv[2]);
|
||||
}
|
||||
@@ -323,9 +323,10 @@ static int h_log(int argc, unsigned char ** argv){
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
fp1 = conf.stdlog;
|
||||
pthread_mutex_lock(&log_mutex);
|
||||
if(conf.stdlog)fclose(conf.stdlog);
|
||||
conf.stdlog = fp;
|
||||
if(fp1) fclose(fp1);
|
||||
pthread_mutex_unlock(&log_mutex);
|
||||
#ifdef _WINCE
|
||||
freopen(tmpbuf, "w", stdout);
|
||||
freopen(tmpbuf, "w", stderr);
|
||||
|
||||
Reference in new issue
Block a user