mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-22 18:15:41 +08:00
Fix connlim issues
This commit is contained in:
parent
862405bdfd
commit
6532163f01
@ -475,6 +475,7 @@ int startconnlims (struct clientparam *param){
|
||||
uint64_t rating;
|
||||
int ret = 0;
|
||||
|
||||
param->connlim = 1;
|
||||
pthread_mutex_lock(&connlim_mutex);
|
||||
for(ce = conf.connlimiter; ce; ce = ce->next) {
|
||||
if(ACLmatches(ce->ace, param)){
|
||||
@ -659,7 +660,7 @@ int alwaysauth(struct clientparam * param){
|
||||
int countout = 0;
|
||||
|
||||
|
||||
if(conf.connlimiter && param->remsock == INVALID_SOCKET && startconnlims(param)) return 10;
|
||||
if(conf.connlimiter && !param->connlim && startconnlims(param)) return 10;
|
||||
res = doconnect(param);
|
||||
if(!res){
|
||||
if(conf.bandlimfunc && (conf.bandlimiter||conf.bandlimiterout)){
|
||||
|
@ -1025,7 +1025,7 @@ void freeparam(struct clientparam * param) {
|
||||
}
|
||||
myfree(param->filters);
|
||||
}
|
||||
if(conf.connlimiter && (param->res != 10 || param->remsock != INVALID_SOCKET)) stopconnlims(param);
|
||||
if(param->connlim) stopconnlims(param);
|
||||
#endif
|
||||
if(param->clibuf) myfree(param->clibuf);
|
||||
if(param->srvbuf) myfree(param->srvbuf);
|
||||
|
@ -523,7 +523,8 @@ struct clientparam {
|
||||
transparent,
|
||||
chunked,
|
||||
paused,
|
||||
version;
|
||||
version,
|
||||
connlim;
|
||||
|
||||
unsigned char *hostname,
|
||||
*username,
|
||||
|
Loading…
Reference in New Issue
Block a user