Take inspect window into account.
*
* \retval none
*/
-void HtpBodyPrune(HtpBody *body)
+void HtpBodyPrune(HtpState *state, HtpBody *body)
{
SCEnter();
SCReturn;
}
+ if (body->body_inspected < state->cfg->response_inspect_min_size) {
+ SCReturn;
+ }
+
SCLogDebug("Pruning chunks of Body %p; data %p, len %"PRIu32, body,
body->last->data, (uint32_t)body->last->len);
"body->body_parsed %"PRIu64, cur->stream_offset, cur->len,
cur->stream_offset + cur->len, body->body_parsed);
- if (cur->stream_offset >= body->body_inspected) {
+ uint64_t left_edge = 0;
+ if (state->cfg->response_inspect_window < body->body_inspected) {
+ left_edge = body->body_inspected - state->cfg->response_inspect_window;
+ }
+
+ if (cur->stream_offset >= left_edge) {
break;
}
int HtpBodyAppendChunk(HtpTxUserData *, HtpBody *, uint8_t *, uint32_t);
void HtpBodyPrint(HtpBody *);
void HtpBodyFree(HtpBody *);
-void HtpBodyPrune(HtpBody *);
+void HtpBodyPrune(HtpState *, HtpBody *);
#endif /* __APP_LAYER_HTP_BODY_H__ */
end:
/* see if we can get rid of htp body chunks */
- HtpBodyPrune(&tx_ud->request_body);
+ HtpBodyPrune(hstate, &tx_ud->request_body);
/* set the new chunk flag */
hstate->flags |= HTP_FLAG_NEW_BODY_SET;
}
/* see if we can get rid of htp body chunks */
- HtpBodyPrune(&tx_ud->response_body);
+ HtpBodyPrune(hstate, &tx_ud->response_body);
/* set the new chunk flag */
hstate->flags |= HTP_FLAG_NEW_BODY_SET;