1
0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-11-23 17:32:59 +01:00
This commit is contained in:
Pavel Odintsov 2013-10-21 19:10:35 +04:00
parent 2fa85155fc
commit 342bbfae7c
2 changed files with 7 additions and 4 deletions

@ -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

@ -35,7 +35,7 @@
#include <utility>
#include <sstream>
//#include <thread>
#include <thread>
// #include <boost/thread.hpp> - выливается в падение компилятора
// 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(&current_time);
//sleep(5);
// вынести в поток!!!
if ( difftime(current_time, start_time) >= check_period ) {
// clean up screen