]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http: fix client and server body sometimes being inspected in wrong order
authorVictor Julien <victor@inliniac.net>
Wed, 31 Oct 2012 07:46:52 +0000 (08:46 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 31 Oct 2012 07:46:52 +0000 (08:46 +0100)
src/detect-engine-hcbd.c
src/detect-engine-hsbd.c

index de1f6635f920fdcee31e9a9bea3cfc73573be1a4..3091966d1e2da64771647f04cfeb91a2395b59c2 100644 (file)
@@ -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) {
index d1d44a5831a53a5718b1f581c2b85d7f481ff213..0bb29dd84442ca3702e7dcf3d6420162b01c7aa0 100644 (file)
@@ -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) {