将ragel库替换为6.10版本,7.0.0.10版本有bug会导致hyperscan加载utf-8规则失败
This commit is contained in:
@@ -72,12 +72,15 @@ static int pkt_seq_matcher_hyperscan_init(struct pkt_seq_matcher_plugin_info *ps
|
|||||||
|
|
||||||
err = hs_compile_multi(expression, flags, ids, 6, HS_MODE_STREAM, NULL, &db, &compile_err);
|
err = hs_compile_multi(expression, flags, ids, 6, HS_MODE_STREAM, NULL, &db, &compile_err);
|
||||||
if (err != HS_SUCCESS) {
|
if (err != HS_SUCCESS) {
|
||||||
printf("compile failed\n");
|
MESA_handle_runtime_log(g_logger_handle, RLOG_LV_FATAL, "PKT_SEQ_MATCHER", "compile failed: %d:%s, pattern:%s", compile_err->expression, compile_err->message, expression[compile_err->expression]);
|
||||||
|
hs_free_compile_error(compile_err);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
psm_plugin_info->hs_database = db;
|
psm_plugin_info->hs_database = db;
|
||||||
|
|
||||||
|
MESA_handle_runtime_log(g_logger_handle, RLOG_LV_DEBUG, "PKT_SEQ_MATCHER", "hyperscan compile success");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,6 +184,10 @@ extern "C" void *pkt_seq_matcher_plugin_init(struct stellar *st)
|
|||||||
goto ERROR;
|
goto ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pkt_seq_matcher_hyperscan_init(psm_plugin_info) != 0)
|
||||||
|
{
|
||||||
|
goto ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
psm_plugin_info->plugin_id = stellar_plugin_register(st, (SESS_EV_TCP|SESS_EV_UDP|SESS_EV_OPENING|SESS_EV_PACKET|SESS_EV_CLOSING), pkt_seq_matcher_entry, psm_plugin_info);
|
psm_plugin_info->plugin_id = stellar_plugin_register(st, (SESS_EV_TCP|SESS_EV_UDP|SESS_EV_OPENING|SESS_EV_PACKET|SESS_EV_CLOSING), pkt_seq_matcher_entry, psm_plugin_info);
|
||||||
|
|
||||||
@@ -192,8 +199,7 @@ ERROR:
|
|||||||
free(psm_plugin_info);
|
free(psm_plugin_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
perror("pkt_seq_matcher init failed");
|
return NULL;
|
||||||
exit(-1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void pkt_seq_matcher_plugin_exit(void *plugin_ctx)
|
extern "C" void pkt_seq_matcher_plugin_exit(void *plugin_ctx)
|
||||||
|
|||||||
14
vendor/CMakeLists.txt
vendored
14
vendor/CMakeLists.txt
vendored
@@ -16,14 +16,14 @@ ExternalProject_Add(colm PREFIX colm
|
|||||||
INSTALL_COMMAND make install
|
INSTALL_COMMAND make install
|
||||||
BUILD_IN_SOURCE 1)
|
BUILD_IN_SOURCE 1)
|
||||||
|
|
||||||
# ragel-7.0.0.10
|
# ragel-6.10
|
||||||
ExternalProject_Add(ragel PREFIX ragel
|
ExternalProject_Add(ragel PREFIX ragel
|
||||||
URL ${CMAKE_CURRENT_SOURCE_DIR}/ragel-7.0.0.10.tar.gz
|
URL ${CMAKE_CURRENT_SOURCE_DIR}/ragel-6.10.tar.gz
|
||||||
CONFIGURE_COMMAND ./autogen.sh && ./configure --prefix=${VENDOR_BUILD} --with-colm=${VENDOR_BUILD}
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${VENDOR_BUILD} --with-colm=${VENDOR_BUILD}
|
||||||
DEPENDS colm
|
BUILD_COMMAND $(MAKE)
|
||||||
BUILD_COMMAND make
|
INSTALL_COMMAND $(MAKE) install
|
||||||
INSTALL_COMMAND make install
|
BUILD_IN_SOURCE 1
|
||||||
BUILD_IN_SOURCE 1)
|
)
|
||||||
|
|
||||||
# HyperScan 5.4.2
|
# HyperScan 5.4.2
|
||||||
ExternalProject_Add(hyperscan PREFIX hyperscan
|
ExternalProject_Add(hyperscan PREFIX hyperscan
|
||||||
|
|||||||
BIN
vendor/ragel-6.10.tar.gz
vendored
Normal file
BIN
vendor/ragel-6.10.tar.gz
vendored
Normal file
Binary file not shown.
BIN
vendor/ragel-7.0.0.10.tar.gz
vendored
BIN
vendor/ragel-7.0.0.10.tar.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user