SCReturn;
}
- /* Unset the body inspection */
- s->flags &=~ HTP_FLAG_NEW_BODY_SET;
-
/* free the connection parser memory used by HTP library */
if (s->connp != NULL) {
SCLogDebug("freeing HTP state");
}
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 };
/* pass the new data to the htp parser */
if (input_len > 0) {
switch(r) {
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;
break;
case HTP_STREAM_DATA:
case HTP_STREAM_DATA_OTHER:
-
- hstate->flags |= HTP_FLAG_STATE_DATA;
- break;
case HTP_STREAM_TUNNEL:
break;
default:
- hstate->flags &= ~HTP_FLAG_STATE_DATA;
- hstate->flags &= ~HTP_FLAG_NEW_BODY_SET;
+ break;
}
HTPHandleError(hstate);
}
}
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 };
if (input_len > 0) {
r = htp_connp_res_data(hstate->connp, &ts, input, input_len);
switch(r) {
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;
break;
case HTP_STREAM_DATA:
case HTP_STREAM_DATA_OTHER:
- hstate->flags |= HTP_FLAG_STATE_DATA;
- break;
case HTP_STREAM_TUNNEL:
break;
default:
- hstate->flags &= ~HTP_FLAG_STATE_DATA;
- hstate->flags &= ~HTP_FLAG_NEW_BODY_SET;
+ break;
}
HTPHandleError(hstate);
}
}
end:
- /* set the new chunk flag */
- hstate->flags |= HTP_FLAG_NEW_BODY_SET;
-
SCReturnInt(HTP_OK);
}
}
}
- /* set the new chunk flag */
- hstate->flags |= HTP_FLAG_NEW_BODY_SET;
-
SCReturnInt(HTP_OK);
}
/* we have one whole transaction now */
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);
if (htud != NULL) {
if (htud->tcflags & HTP_FILENAME_SET) {
connection is closed */
#define HTP_FLAG_STATE_CLOSED_TC 0x0004 /**< Flag to indicate that HTTP
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_TC 0x0080
#define HTP_FLAG_STORE_FILES_TX_TS 0x0100