diff --git a/CMakeLists.txt b/CMakeLists.txt index 7eed1d4..7846055 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.7) project(udp2raw_tunnel) set(CMAKE_CXX_STANDARD 11) +set_source_files_properties(lib/aes.c lib/md5.c PROPERTIES LANGUAGE CXX ) set(SOURCE_FILES lib/aes.c @@ -13,5 +14,6 @@ set(SOURCE_FILES network.cpp ) set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -static") -set(CMAKE_LINK_LIBRARY_FLAG "-lrt") -add_executable(udp2raw_tunnel ${SOURCE_FILES}) \ No newline at end of file +#set(CMAKE_LINK_LIBRARY_FLAG "-lrt") +add_executable(udp2raw_tunnel ${SOURCE_FILES}) +target_link_libraries(udp2raw_tunnel rt) diff --git a/common.h b/common.h index e4c7875..89d5f46 100644 --- a/common.h +++ b/common.h @@ -71,7 +71,7 @@ const u32_t client_retry_interval=1000; const u32_t server_handshake_timeout=10000;// this should be much longer than clients. client retry initially ,server retry passtively const int conv_clear_ratio=10; //conv grabage collecter check 1/10 of all conv one time -const int conn_clear_ratio=10; +const int conn_clear_ratio=30; const int conv_clear_min=5; const int conn_clear_min=1; diff --git a/makefile b/makefile index e406b69..c428803 100755 --- a/makefile +++ b/makefile @@ -4,7 +4,7 @@ FLAGS2= -O3 all: sudo killall udp2raw||true sleep 0.2 - g++ main.cpp -o udp2raw -static -ggdb -I. lib/aes.c lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp -lrt -std=c++11 ${FLAGS} ${FLAGS2} + gcc main.cpp -o udp2raw -static -ggdb -I. lib/aes.c lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp -lrt -std=c++11 ${FLAGS} ${FLAGS2} # ${ccmips} main.cpp -o udp2raw_ar71xx -lrt -I. lib/aes.c lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp -std=c++11 ${FLAGS} ${FLAGS2} fast: sudo killall udp2raw||true