修复笔误,会导致获取阻断方式失败

增加自动生成版本号
This commit is contained in:
liuxueli
2019-12-25 15:23:40 +08:00
parent fb1511e25c
commit 4ae73e796c
3 changed files with 23 additions and 13 deletions

View File

@@ -1,4 +1,3 @@
# Using autorevision.sh to generate version information
set(__SOURCE_AUTORESIVISION ${CMAKE_SOURCE_DIR}/autorevision.sh)
@@ -38,16 +37,7 @@ set(VERSION_BUILD "${VCS_SHORT_HASH}")
# print information
message(STATUS "Version: ${VERSION}-${VERSION_BUILD}")
if(NOT DEFINE_GIT_VERSION)
option(DEFINE_GIT_VERSION "Set DEFINE_GIT_VERSION to OFF" OFF)
set(GIT_VERSION
"${VERSION}-${CMAKE_BUILD_TYPE}-${VERSION_BUILD}-${VCS_BRANCH}-${VCS_TAG}-${VCS_DATE}")
string(REGEX REPLACE "[-:+/\\.]" "_" GIT_VERSION ${GIT_VERSION})
if(DEFINE_GIT_VERSION)
add_definitions(-DGIT_VERSION=${GIT_VERSION})
option(DEFINE_GIT_VERSION "Set DEFINE_GIT_VERSION to OFF" ON)
endif()
endif()
add_definitions(-DGIT_VERSION=${GIT_VERSION})

View File

@@ -12,9 +12,29 @@
#include "tsg_send_log.h"
#include "tsg_send_log_internal.h"
#ifdef __cplusplus
extern "C"
{
#endif
#define GIT_VERSION_CATTER(v) __attribute__((__used__)) const char * GIT_VERSION_##v = NULL
#define GIT_VERSION_EXPEND(v) GIT_VERSION_CATTER(v)
/* VERSION TAG */
#ifdef GIT_VERSION
GIT_VERSION_EXPEND(GIT_VERSION);
#else
static __attribute__((__used__)) const char * GIT_VERSION_UNKNOWN = NULL;
#endif
#undef GIT_VERSION_CATTER
#undef GIT_VERSION_EXPEND
#ifdef __cplusplus
}
#endif
char TSG_MASTER_VERSION_20191220=0;
char TSG_MASTER_VERSION_20191224=0;
const char *tsg_conffile="tsgconf/main.conf";
g_tsg_para_t g_tsg_para;

View File

@@ -39,7 +39,7 @@ const struct _str2index method2index[TSG_METHOD_TYPE_MAX]={ {TSG_METHOD_TYPE_UNK
{TSG_METHOD_TYPE_DROP, 4, (char *)"drop"},
{TSG_METHOD_TYPE_REDIRECTION, 8, (char *)"redirect"},
{TSG_METHOD_TYPE_BLOCK, 5, (char *)"block"},
{TSG_METHOD_TYPE_BLOCK, 5, (char *)"rst"}
{TSG_METHOD_TYPE_RESET, 3, (char *)"rst"}
};