@ -29,6 +29,8 @@
# include "conf.h"
# include "conf-yaml-loader.h"
# include "app-layer-htp.h"
# include "detect-parse.h"
# include "detect-engine-sigorder.h"
@ -126,14 +128,33 @@ static void *DetectEngineLiveRuleSwap(void *arg)
//if (MagicInit() != 0)
// exit(EXIT_FAILURE);
uint8_t local_need_htp_request_body = need_htp_request_body ;
uint8_t local_need_htp_request_multipart_hdr = need_htp_request_multipart_hdr ;
uint8_t local_need_htp_request_file = need_htp_request_file ;
uint8_t local_need_htp_response_body = need_htp_response_body ;
if ( SigLoadSignatures ( de_ctx , NULL , FALSE ) < 0 ) {
SCLogError ( SC_ERR_NO_RULES_LOADED , " Loading signatures failed. " ) ;
if ( de_ctx - > failure_fatal )
exit ( EXIT_FAILURE ) ;
}
SCThresholdConfInitContext ( de_ctx , NULL ) ;
if ( local_need_htp_request_body ! = need_htp_request_body | |
local_need_htp_request_multipart_hdr ! = need_htp_request_multipart_hdr | |
local_need_htp_request_file ! = need_htp_request_file | |
local_need_htp_response_body ! = need_htp_response_body ) {
SCLogInfo ( " ===== New ruleset requires enabling htp features that "
" can't be enabled at runtime. You will have to restart "
" engine to load the new ruleset ===== " ) ;
DetectEngineCtxFree ( de_ctx ) ;
SignalHandlerSetup ( SIGUSR2 , SignalHandlerSigusr2 ) ;
TmThreadsSetFlag ( tv_local , THV_CLOSED ) ;
pthread_exit ( NULL ) ;
}
SCThresholdConfInitContext ( de_ctx , NULL ) ;
/* start the process of swapping detect threads ctxs */