diff --git a/build.sh b/build.sh index 1348053..811abc7 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,8 @@ ENGINE=ULOG2 #ENGINE=PCAP -LIBS="" +# we use C++ 11 threads. We must include pthread library due gcc bug +LIBS="-l pthread" if [ "PCAP" == $ENGINE ]; then LIBS="$LIBS -lpcap" @@ -21,4 +22,4 @@ fi g++ libipulog.c -c -o libipulog.o -Wno-write-strings # -std=c++11 -g++ -DREDIS -D$ENGINE fastnetmon.cpp libipulog.o $LIBS -o fastnetmon -g +g++ -DREDIS -D$ENGINE fastnetmon.cpp libipulog.o $LIBS -o fastnetmon -std=c++11 -lpthread -g diff --git a/fastnetmon.cpp b/fastnetmon.cpp index 044d2ff..8032fb6 100644 --- a/fastnetmon.cpp +++ b/fastnetmon.cpp @@ -35,7 +35,7 @@ #include #include -//#include +#include // #include - выливается в падение компилятора // for boost split @@ -646,7 +646,9 @@ void parse_packet(u_char *user, struct pcap_pkthdr *packethdr, const u_char *pac void calculation_programm() { time_t current_time; time(¤t_time); - + + //sleep(5); + // вынести в поток!!! if ( difftime(current_time, start_time) >= check_period ) { // clean up screen