mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 10:35:40 +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;
|
uint64_t rating;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
param->connlim = 1;
|
||||||
pthread_mutex_lock(&connlim_mutex);
|
pthread_mutex_lock(&connlim_mutex);
|
||||||
for(ce = conf.connlimiter; ce; ce = ce->next) {
|
for(ce = conf.connlimiter; ce; ce = ce->next) {
|
||||||
if(ACLmatches(ce->ace, param)){
|
if(ACLmatches(ce->ace, param)){
|
||||||
@ -659,7 +660,7 @@ int alwaysauth(struct clientparam * param){
|
|||||||
int countout = 0;
|
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);
|
res = doconnect(param);
|
||||||
if(!res){
|
if(!res){
|
||||||
if(conf.bandlimfunc && (conf.bandlimiter||conf.bandlimiterout)){
|
if(conf.bandlimfunc && (conf.bandlimiter||conf.bandlimiterout)){
|
||||||
|
@ -1025,7 +1025,7 @@ void freeparam(struct clientparam * param) {
|
|||||||
}
|
}
|
||||||
myfree(param->filters);
|
myfree(param->filters);
|
||||||
}
|
}
|
||||||
if(conf.connlimiter && (param->res != 10 || param->remsock != INVALID_SOCKET)) stopconnlims(param);
|
if(param->connlim) stopconnlims(param);
|
||||||
#endif
|
#endif
|
||||||
if(param->clibuf) myfree(param->clibuf);
|
if(param->clibuf) myfree(param->clibuf);
|
||||||
if(param->srvbuf) myfree(param->srvbuf);
|
if(param->srvbuf) myfree(param->srvbuf);
|
||||||
|
@ -523,7 +523,8 @@ struct clientparam {
|
|||||||
transparent,
|
transparent,
|
||||||
chunked,
|
chunked,
|
||||||
paused,
|
paused,
|
||||||
version;
|
version,
|
||||||
|
connlim;
|
||||||
|
|
||||||
unsigned char *hostname,
|
unsigned char *hostname,
|
||||||
*username,
|
*username,
|
||||||
|
Loading…
Reference in New Issue
Block a user