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

Function initbandlims

src/auth.c:441–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441static void initbandlims (struct clientparam *param){
442 struct bandlim * be;
443 int i;
444 for(i=0, be = conf.bandlimiter; be && i<MAXBANDLIMS; be = be->next) {
445 if(ACLmatches(be->ace, param)){
446 if(be->ace->action == NOBANDLIM) {
447 break;
448 }
449 param->bandlims[i++] = be;
450 param->bandlimfunc = conf.bandlimfunc;
451 }
452 }
453 if(i<MAXBANDLIMS)param->bandlims[i] = NULL;
454 for(i=0, be = conf.bandlimiterout; be && i<MAXBANDLIMS; be = be->next) {
455 if(ACLmatches(be->ace, param)){
456 if(be->ace->action == NOBANDLIM) {
457 break;
458 }
459 param->bandlimsout[i++] = be;
460 param->bandlimfunc = conf.bandlimfunc;
461 }
462 }
463 if(i<MAXBANDLIMS)param->bandlimsout[i] = NULL;
464}
465
466unsigned bandlimitfunc(struct clientparam *param, unsigned nbytesin, unsigned nbytesout){
467 unsigned sleeptime = 0, nsleeptime;

Callers 1

alwaysauthFunction · 0.85

Calls 1

ACLmatchesFunction · 0.85

Tested by

no test coverage detected