htp: remove usused flags

pull/3201/head
Victor Julien 8 years ago
parent c0d26de665
commit daeba48f77

@ -341,9 +341,6 @@ void HTPStateFree(void *state)
SCReturn; SCReturn;
} }
/* Unset the body inspection */
s->flags &=~ HTP_FLAG_NEW_BODY_SET;
/* free the connection parser memory used by HTP library */ /* free the connection parser memory used by HTP library */
if (s->connp != NULL) { if (s->connp != NULL) {
SCLogDebug("freeing HTP state"); SCLogDebug("freeing HTP state");
@ -740,10 +737,6 @@ static int HTPHandleRequestData(Flow *f, void *htp_state,
} }
DEBUG_VALIDATE_BUG_ON(hstate->connp == NULL); DEBUG_VALIDATE_BUG_ON(hstate->connp == NULL);
/* Unset the body inspection (the callback should
* reactivate it if necessary) */
hstate->flags &=~ HTP_FLAG_NEW_BODY_SET;
htp_time_t ts = { f->lastts.tv_sec, f->lastts.tv_usec }; htp_time_t ts = { f->lastts.tv_sec, f->lastts.tv_usec };
/* pass the new data to the htp parser */ /* pass the new data to the htp parser */
if (input_len > 0) { if (input_len > 0) {
@ -751,22 +744,14 @@ static int HTPHandleRequestData(Flow *f, void *htp_state,
switch(r) { switch(r) {
case HTP_STREAM_ERROR: case HTP_STREAM_ERROR:
hstate->flags |= HTP_FLAG_STATE_ERROR;
hstate->flags &= ~HTP_FLAG_STATE_DATA;
hstate->flags &= ~HTP_FLAG_NEW_BODY_SET;
ret = -1; ret = -1;
break; break;
case HTP_STREAM_DATA: case HTP_STREAM_DATA:
case HTP_STREAM_DATA_OTHER: case HTP_STREAM_DATA_OTHER:
hstate->flags |= HTP_FLAG_STATE_DATA;
break;
case HTP_STREAM_TUNNEL: case HTP_STREAM_TUNNEL:
break; break;
default: default:
hstate->flags &= ~HTP_FLAG_STATE_DATA; break;
hstate->flags &= ~HTP_FLAG_NEW_BODY_SET;
} }
HTPHandleError(hstate); HTPHandleError(hstate);
} }
@ -821,29 +806,19 @@ static int HTPHandleResponseData(Flow *f, void *htp_state,
} }
DEBUG_VALIDATE_BUG_ON(hstate->connp == NULL); DEBUG_VALIDATE_BUG_ON(hstate->connp == NULL);
/* Unset the body inspection (the callback should
* reactivate it if necessary) */
hstate->flags &=~ HTP_FLAG_NEW_BODY_SET;
htp_time_t ts = { f->lastts.tv_sec, f->lastts.tv_usec }; htp_time_t ts = { f->lastts.tv_sec, f->lastts.tv_usec };
if (input_len > 0) { if (input_len > 0) {
r = htp_connp_res_data(hstate->connp, &ts, input, input_len); r = htp_connp_res_data(hstate->connp, &ts, input, input_len);
switch(r) { switch(r) {
case HTP_STREAM_ERROR: case HTP_STREAM_ERROR:
hstate->flags = HTP_FLAG_STATE_ERROR;
hstate->flags &= ~HTP_FLAG_STATE_DATA;
hstate->flags &= ~HTP_FLAG_NEW_BODY_SET;
ret = -1; ret = -1;
break; break;
case HTP_STREAM_DATA: case HTP_STREAM_DATA:
case HTP_STREAM_DATA_OTHER: case HTP_STREAM_DATA_OTHER:
hstate->flags |= HTP_FLAG_STATE_DATA;
break;
case HTP_STREAM_TUNNEL: case HTP_STREAM_TUNNEL:
break; break;
default: default:
hstate->flags &= ~HTP_FLAG_STATE_DATA; break;
hstate->flags &= ~HTP_FLAG_NEW_BODY_SET;
} }
HTPHandleError(hstate); HTPHandleError(hstate);
} }
@ -1803,9 +1778,6 @@ static int HTPCallbackRequestBodyData(htp_tx_data_t *d)
} }
end: end:
/* set the new chunk flag */
hstate->flags |= HTP_FLAG_NEW_BODY_SET;
SCReturnInt(HTP_OK); SCReturnInt(HTP_OK);
} }
@ -1878,9 +1850,6 @@ static int HTPCallbackResponseBodyData(htp_tx_data_t *d)
} }
} }
/* set the new chunk flag */
hstate->flags |= HTP_FLAG_NEW_BODY_SET;
SCReturnInt(HTP_OK); SCReturnInt(HTP_OK);
} }
@ -2002,9 +1971,6 @@ static int HTPCallbackResponse(htp_tx_t *tx)
/* we have one whole transaction now */ /* we have one whole transaction now */
hstate->transaction_cnt++; hstate->transaction_cnt++;
/* Unset the body inspection (if any) */
hstate->flags &=~ HTP_FLAG_NEW_BODY_SET;
HtpTxUserData *htud = (HtpTxUserData *) htp_tx_get_user_data(tx); HtpTxUserData *htud = (HtpTxUserData *) htp_tx_get_user_data(tx);
if (htud != NULL) { if (htud != NULL) {
if (htud->tcflags & HTP_FILENAME_SET) { if (htud->tcflags & HTP_FILENAME_SET) {

@ -62,14 +62,6 @@
connection is closed */ connection is closed */
#define HTP_FLAG_STATE_CLOSED_TC 0x0004 /**< Flag to indicate that HTTP #define HTP_FLAG_STATE_CLOSED_TC 0x0004 /**< Flag to indicate that HTTP
connection is closed */ connection is closed */
#define HTP_FLAG_STATE_DATA 0x0008 /**< Flag to indicate that HTTP
connection needs more data */
#define HTP_FLAG_STATE_ERROR 0x0010 /**< Flag to indicate that an error
has been occured on HTTP
connection */
#define HTP_FLAG_NEW_BODY_SET 0x0020 /**< Flag to indicate that HTTP
has parsed a new body (for
pcre) */
#define HTP_FLAG_STORE_FILES_TS 0x0040 #define HTP_FLAG_STORE_FILES_TS 0x0040
#define HTP_FLAG_STORE_FILES_TC 0x0080 #define HTP_FLAG_STORE_FILES_TC 0x0080
#define HTP_FLAG_STORE_FILES_TX_TS 0x0100 #define HTP_FLAG_STORE_FILES_TX_TS 0x0100

Loading…
Cancel
Save