From f2aaa39645ed9286dd0122861a5808fc91330368 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Mon, 2 Sep 2019 09:17:19 +0200 Subject: [PATCH] http: fixes stream flags for http tests --- src/detect-http-server-body.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/detect-http-server-body.c b/src/detect-http-server-body.c index 48241b8d2f..f8aa44a6ac 100644 --- a/src/detect-http-server-body.c +++ b/src/detect-http-server-body.c @@ -431,7 +431,8 @@ static int DetectHttpServerBodyTest07(void) "GET /index.html HTTP/1.0\r\n" "Host: www.openinfosecfoundation.org\r\n" "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7\r\n" - "\r\n"; + "\r\n" + "message"; uint32_t http_len1 = sizeof(http_buf1) - 1; uint8_t http_buf2[] = "HTTP/1.0 200 ok\r\n" @@ -489,7 +490,7 @@ static int DetectHttpServerBodyTest07(void) FLOWLOCK_WRLOCK(&f); int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, + STREAM_TOSERVER | STREAM_START, http_buf1, http_len1); if (r != 0) { @@ -825,7 +826,7 @@ static int DetectHttpServerBodyTest09(void) FLOWLOCK_WRLOCK(&f); r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, + STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); @@ -988,7 +989,7 @@ static int DetectHttpServerBodyTest10(void) FLOWLOCK_WRLOCK(&f); r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, + STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); @@ -2556,7 +2557,8 @@ static int DetectHttpServerBodyFileDataTest02(void) "GET /index.html HTTP/1.0\r\n" "Host: www.openinfosecfoundation.org\r\n" "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7\r\n" - "\r\n"; + "\r\n" + "message"; uint32_t http_len1 = sizeof(http_buf1) - 1; uint8_t http_buf2[] = "HTTP/1.0 200 ok\r\n" @@ -2614,7 +2616,7 @@ static int DetectHttpServerBodyFileDataTest02(void) FLOWLOCK_WRLOCK(&f); int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, + STREAM_TOSERVER | STREAM_START, http_buf1, http_len1); if (r != 0) { @@ -2953,7 +2955,7 @@ static int DetectHttpServerBodyFileDataTest04(void) FLOWLOCK_WRLOCK(&f); r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, + STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); @@ -3116,7 +3118,7 @@ static int DetectHttpServerBodyFileDataTest05(void) FLOWLOCK_WRLOCK(&f); r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, + STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); -- 2.47.2