* \warning Make sure flow is locked -- flow is modified, WRITE lock needed
*/
static void DetectEngineBufferHttpClientBodies(DetectEngineCtx *de_ctx,
- DetectEngineThreadCtx *det_ctx, Flow *f, HtpState *htp_state)
+ DetectEngineThreadCtx *det_ctx, Flow *f, HtpState *htp_state, uint8_t flags)
{
int idx = 0;
htp_tx_t *tx = NULL;
}
}
+ if (flags & STREAM_EOF) {
+ htud->flags |= HTP_REQ_BODY_COMPLETE;
+ }
+
/* inspect the body if the transfer is complete or we have hit
* our body size limit */
if (htud->request_body.content_len_so_far < BODY_MINIMAL_SIZE &&
uint32_t cnt = 0;
FLOWLOCK_WRLOCK(f);
- DetectEngineBufferHttpClientBodies(de_ctx, det_ctx, f, htp_state);
+ DetectEngineBufferHttpClientBodies(de_ctx, det_ctx, f, htp_state, flags);
FLOWLOCK_UNLOCK(f);
if (det_ctx->hcbd != NULL && det_ctx->hcbd_buffers_list_len) {
int i = 0;
FLOWLOCK_WRLOCK(f);
- DetectEngineBufferHttpClientBodies(de_ctx, det_ctx, f, alstate);
+ DetectEngineBufferHttpClientBodies(de_ctx, det_ctx, f, alstate, flags);
FLOWLOCK_UNLOCK(f);
if (det_ctx->hcbd != NULL && det_ctx->hcbd_buffers_list_len) {
* \warning Make sure flow is locked. Flow is modified, WRITE lock needed.
*/
static void DetectEngineBufferHttpServerBodies(DetectEngineCtx *de_ctx,
- DetectEngineThreadCtx *det_ctx, Flow *f, HtpState *htp_state)
+ DetectEngineThreadCtx *det_ctx, Flow *f, HtpState *htp_state, uint8_t flags)
{
int idx = 0;
htp_tx_t *tx = NULL;
}
}
+ if (flags & STREAM_EOF) {
+ htud->flags |= HTP_RES_BODY_COMPLETE;
+ }
+
/* inspect the body if the transfer is complete or we have hit
* our body size limit */
if (htud->response_body.content_len_so_far < BODY_MINIMAL_SIZE &&
uint32_t cnt = 0;
FLOWLOCK_WRLOCK(f);
- DetectEngineBufferHttpServerBodies(de_ctx, det_ctx, f, htp_state);
+ DetectEngineBufferHttpServerBodies(de_ctx, det_ctx, f, htp_state, flags);
FLOWLOCK_UNLOCK(f);
if (det_ctx->hsbd != NULL && det_ctx->hsbd_buffers_list_len) {
int i = 0;
FLOWLOCK_WRLOCK(f);
- DetectEngineBufferHttpServerBodies(de_ctx, det_ctx, f, alstate);
+ DetectEngineBufferHttpServerBodies(de_ctx, det_ctx, f, alstate, flags);
FLOWLOCK_UNLOCK(f);
if (det_ctx->hsbd != NULL && det_ctx->hsbd_buffers_list_len) {
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
if ((PacketAlertCheck(p1, 1))) {
- printf("sid 1 matched on chunk2 but should have: ");
+ printf("sid 1 matched on chunk2 but shouldn't have: ");
goto end;
}