http: track if request/response have trailers

pull/2310/head
Victor Julien 9 years ago
parent 798ba010ca
commit 44022743f2

@ -1918,6 +1918,24 @@ void HTPFreeConfig(void)
SCReturn; SCReturn;
} }
static int HTPCallbackRequestHasTrailer(htp_tx_t *tx)
{
HtpTxUserData *htud = (HtpTxUserData *)htp_tx_get_user_data(tx);
if (htud != NULL) {
htud->request_has_trailers = 1;
}
return HTP_OK;
}
static int HTPCallbackResponseHasTrailer(htp_tx_t *tx)
{
HtpTxUserData *htud = (HtpTxUserData *)htp_tx_get_user_data(tx);
if (htud != NULL) {
htud->response_has_trailers = 1;
}
return HTP_OK;
}
/** /**
* \brief callback for request to store the recent incoming request * \brief callback for request to store the recent incoming request
in to the recent_in_tx for the given htp state in to the recent_in_tx for the given htp state
@ -2142,6 +2160,9 @@ static void HTPConfigSetDefaultsPhase1(HTPCfgRec *cfg_prec)
htp_config_register_response_header_data(cfg_prec->cfg, HTPCallbackResponseHeaderData); htp_config_register_response_header_data(cfg_prec->cfg, HTPCallbackResponseHeaderData);
htp_config_register_response_trailer_data(cfg_prec->cfg, HTPCallbackResponseHeaderData); htp_config_register_response_trailer_data(cfg_prec->cfg, HTPCallbackResponseHeaderData);
htp_config_register_request_trailer(cfg_prec->cfg, HTPCallbackRequestHasTrailer);
htp_config_register_response_trailer(cfg_prec->cfg, HTPCallbackResponseHasTrailer);
htp_config_register_request_body_data(cfg_prec->cfg, HTPCallbackRequestBodyData); htp_config_register_request_body_data(cfg_prec->cfg, HTPCallbackRequestBodyData);
htp_config_register_response_body_data(cfg_prec->cfg, HTPCallbackResponseBodyData); htp_config_register_response_body_data(cfg_prec->cfg, HTPCallbackResponseBodyData);

@ -192,6 +192,9 @@ typedef struct HtpTxUserData_ {
uint8_t request_body_init; uint8_t request_body_init;
uint8_t response_body_init; uint8_t response_body_init;
uint8_t request_has_trailers;
uint8_t response_has_trailers;
/* indicates which loggers that have logged */ /* indicates which loggers that have logged */
uint32_t logged; uint32_t logged;

Loading…
Cancel
Save