Przeglądaj źródła

minor logging changes

z3APA3A 10 lat temu
rodzic
commit
e23dd7b746
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      src/proxymain.c

+ 4 - 4
src/proxymain.c

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