MCPcopy Create free account
hub / github.com/3proxy/3proxy / alwaysauth

Function alwaysauth

src/auth.c:564–602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

562}
563
564int alwaysauth(struct clientparam * param){
565 int res;
566 struct trafcount * tc;
567 int countout = 0;
568
569 res = doconnect(param);
570 if(!res){
571 initbandlims(param);
572 for(tc = conf.trafcounter; tc; tc = tc->next) {
573 if(tc->disabled) continue;
574 if(ACLmatches(tc->ace, param)){
575 if(tc->ace->action == NOCOUNTIN) break;
576 if(tc->ace->action != COUNTIN) {
577 countout = 1;
578 continue;
579 }
580
581 if(tc->traflim64 <= tc->traf64) return 10;
582 param->trafcountfunc = conf.trafcountfunc;
583 param->maxtrafin64 = tc->traflim64 - tc->traf64;
584 }
585 }
586 if(countout)for(tc = conf.trafcounter; tc; tc = tc->next) {
587 if(tc->disabled) continue;
588 if(ACLmatches(tc->ace, param)){
589 if(tc->ace->action == NOCOUNTOUT) break;
590 if(tc->ace->action != COUNTOUT) {
591 continue;
592 }
593
594 if(tc->traflim64 <= tc->traf64) return 10;
595 param->trafcountfunc = conf.trafcountfunc;
596 param->maxtrafout64 = tc->traflim64 - tc->traf64;
597 }
598 }
599
600 }
601 return res;
602}
603
604int checkACL(struct clientparam * param){
605 struct ace* acentry;

Callers 3

handleredirectFunction · 0.85
checkACLFunction · 0.85
doauthFunction · 0.85

Calls 3

doconnectFunction · 0.85
initbandlimsFunction · 0.85
ACLmatchesFunction · 0.85

Tested by

no test coverage detected