Fix recently broken admin -s

This commit is contained in:
z3APA3A 2018-04-23 13:49:39 +03:00
parent 0f9a9d6e37
commit acc64b03fd
2 changed files with 11 additions and 2 deletions

View File

@ -391,7 +391,9 @@ int MODULEMAINFUNC (int argc, char** argv){
srv.anonymous = 1 + atoi(argv[i]+2); srv.anonymous = 1 + atoi(argv[i]+2);
break; break;
case 's': case 's':
#ifdef WITHSPLICE
if(isudp) if(isudp)
#endif
srv.singlepacket = 1 + atoi(argv[i]+2); srv.singlepacket = 1 + atoi(argv[i]+2);
#ifdef WITHSPLICE #ifdef WITHSPLICE
else else

View File

@ -343,7 +343,14 @@ void * adminchild(struct clientparam* param) {
struct printparam pp; struct printparam pp;
int contentlen = 0; int contentlen = 0;
int isform = 0; int isform = 0;
int limited = 0;
#ifdef WITHSPLICE
limited =param->srv->usesplice;
#else
limited =param->srv->singlepacket;
#endif
pp.inbuf = 0; pp.inbuf = 0;
pp.cp = param; pp.cp = param;
@ -408,7 +415,7 @@ void * adminchild(struct clientparam* param) {
printstr(&pp, authreq); printstr(&pp, authreq);
RETURN(res); RETURN(res);
} }
if(param->srv->singlepacket || param->redirected){ if(limited || param->redirected){
if(*req == 'C') req[1] = 0; if(*req == 'C') req[1] = 0;
else *req = 0; else *req = 0;
} }
@ -423,7 +430,7 @@ void * adminchild(struct clientparam* param) {
for(cp = conf.trafcounter; cp; cp = cp->next, num++){ for(cp = conf.trafcounter; cp; cp = cp->next, num++){
int inbuf = 0; int inbuf = 0;
if(cp->ace && (param->srv->singlepacket || param->redirected)){ if(cp->ace && (limited || param->redirected)){
if(!ACLmatches(cp->ace, param))continue; if(!ACLmatches(cp->ace, param))continue;
} }
if(req[1] == 'S' && atoi(req+2) == num) cp->disabled=0; if(req[1] == 'S' && atoi(req+2) == num) cp->disabled=0;