mirror of
https://github.com/3proxy/3proxy.git
synced 2026-10-21 23:51:12 +00:00
Fix connlim issues
This commit is contained in:
parent
862405bdfd
commit
6532163f01
3 changed files with 5 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue