minor logging changes

This commit is contained in:
z3APA3A 2016-01-28 01:18:16 +03:00
parent 95efeb8a93
commit e23dd7b746

View File

@ -499,9 +499,9 @@ int MODULEMAINFUNC (int argc, char** argv){
for(;;){ for(;;){
while((conf.paused == srv.version && srv.childcount >= srv.maxchild)){ while((conf.paused == srv.version && srv.childcount >= srv.maxchild)){
nlog++; nlog++;
if(nlog > 5000) { if(!srv.silent && nlog > 5000) {
sprintf((char *)buf, "Warning: too many connected clients (%d/%d)", srv.childcount, srv.maxchild); sprintf((char *)buf, "Warning: too many connected clients (%d/%d)", srv.childcount, srv.maxchild);
if(!srv.silent)(*srv.logfunc)(&defparam, buf); (*srv.logfunc)(&defparam, buf);
nlog = 0; nlog = 0;
} }
usleep(SLEEPTIME); usleep(SLEEPTIME);
@ -588,9 +588,9 @@ int MODULEMAINFUNC (int argc, char** argv){
} }
#endif #endif
nlog++; nlog++;
if(error || nlog > 5000) { if(!srv.silent && (error || nlog > 5000)) {
sprintf((char *)buf, "accept(): %s", strerror(errno)); sprintf((char *)buf, "accept(): %s", strerror(errno));
if(!srv.silent)(*srv.logfunc)(&defparam, buf); (*srv.logfunc)(&defparam, buf);
nlog = 0; nlog = 0;
} }
continue; continue;