|
|
@@ -326,7 +326,8 @@ int decode_hixie(char *src, size_t srclength,
|
|
326
|
326
|
framecount++;
|
|
327
|
327
|
} while (end < (src+srclength-1));
|
|
328
|
328
|
if (framecount > 1) {
|
|
329
|
|
- snprintf(cntstr, 3, "%d", framecount);
|
|
|
329
|
+ //snprintf(cntstr, 3, "%d", framecount);
|
|
|
330
|
+ snprintf(cntstr, 4, "%d", framecount > 999 ? 999 : framecount);
|
|
330
|
331
|
traffic(cntstr);
|
|
331
|
332
|
}
|
|
332
|
333
|
*left = 0;
|
|
|
@@ -492,7 +493,8 @@ int decode_hybi(unsigned char *src, size_t srclength,
|
|
492
|
493
|
}
|
|
493
|
494
|
|
|
494
|
495
|
if (framecount > 1) {
|
|
495
|
|
- snprintf(cntstr, 3, "%d", framecount);
|
|
|
496
|
+ //snprintf(cntstr, 3, "%d", framecount);
|
|
|
497
|
+ snprintf(cntstr, 4, "%d", framecount > 999 ? 999 : framecount);
|
|
496
|
498
|
traffic(cntstr);
|
|
497
|
499
|
}
|
|
498
|
500
|
|
|
|
@@ -776,9 +778,9 @@ void daemonize(int keepfd) {
|
|
776
|
778
|
int pid, i;
|
|
777
|
779
|
|
|
778
|
780
|
umask(0);
|
|
779
|
|
- chdir("/");
|
|
780
|
|
- setgid(getgid());
|
|
781
|
|
- setuid(getuid());
|
|
|
781
|
+ if (!chdir("/")) { handler_emsg("Unable to chdir(\"/\").\n"); }
|
|
|
782
|
+ if (!setgid(getgid())) { handler_emsg("Unable to setgid().\n"); }
|
|
|
783
|
+ if (!setuid(getuid())) { handler_emsg("Unable to setuid().\n"); }
|
|
782
|
784
|
|
|
783
|
785
|
/* Double fork to daemonize */
|
|
784
|
786
|
pid = fork();
|
|
|
@@ -802,8 +804,8 @@ void daemonize(int keepfd) {
|
|
802
|
804
|
}
|
|
803
|
805
|
}
|
|
804
|
806
|
i=open("/dev/null", O_RDWR); // Redirect stdin
|
|
805
|
|
- dup(i); // Redirect stdout
|
|
806
|
|
- dup(i); // Redirect stderr
|
|
|
807
|
+ if (!dup(i)) { handler_emsg("Unable redirect stdout.\n"); } // Redirect stdout
|
|
|
808
|
+ if (!dup(i)) { handler_emsg("Unable redirect stderr.\n"); } // Redirect stderr
|
|
807
|
809
|
}
|
|
808
|
810
|
|
|
809
|
811
|
|