From: Victor Julien Date: Wed, 31 Oct 2012 07:46:52 +0000 (+0100) Subject: http: fix client and server body sometimes being inspected in wrong order X-Git-Tag: suricata-1.4beta3~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3156407746014c125dbe417f7df818f9cc91be0a;p=thirdparty%2Fsuricata.git http: fix client and server body sometimes being inspected in wrong order --- diff --git a/src/detect-engine-hcbd.c b/src/detect-engine-hcbd.c index de1f6635f9..3091966d1e 100644 --- a/src/detect-engine-hcbd.c +++ b/src/detect-engine-hcbd.c @@ -159,6 +159,11 @@ static uint8_t *DetectEngineHCBDGetBufferForTX(int tx_id, /* final length of the body */ htud->tsflags |= HTP_REQ_BODY_COMPLETE; } + } else { + if (htud->request_body.content_len == tx->request_entity_len) { + SCLogDebug("content_len reached"); + htud->tsflags |= HTP_RES_BODY_COMPLETE; + } } if (flags & STREAM_EOF) { diff --git a/src/detect-engine-hsbd.c b/src/detect-engine-hsbd.c index d1d44a5831..0bb29dd844 100644 --- a/src/detect-engine-hsbd.c +++ b/src/detect-engine-hsbd.c @@ -160,6 +160,11 @@ static uint8_t *DetectEngineHSBDGetBufferForTX(int tx_id, /* final length of the body */ htud->tcflags |= HTP_RES_BODY_COMPLETE; } + } else { + if (htud->response_body.content_len == tx->response_entity_len) { + SCLogDebug("content_len reached"); + htud->tcflags |= HTP_RES_BODY_COMPLETE; + } } if (flags & STREAM_EOF) {