From 0b36bde9be7a2bf277f08bc4dcd06c85f6d151d9 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 13 Jan 2023 13:32:45 +0100 Subject: [PATCH] streaming: remove unused config member --- src/app-layer-htp-body.c | 2 +- src/app-layer-htp.c | 10 ++++------ src/util-streaming-buffer.c | 16 ++++++++-------- src/util-streaming-buffer.h | 3 +-- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/app-layer-htp-body.c b/src/app-layer-htp-body.c index 5516514c38..f2db9453b2 100644 --- a/src/app-layer-htp-body.c +++ b/src/app-layer-htp-body.c @@ -33,7 +33,7 @@ #include "util-streaming-buffer.h" #include "util-print.h" -static StreamingBufferConfig default_cfg = { 0, 3072, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, +static StreamingBufferConfig default_cfg = { 3072, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, HTPCalloc, HTPRealloc, HTPFree }; /** diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index b1a306d20f..c2facb228c 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -2550,16 +2550,14 @@ static void HTPConfigSetDefaultsPhase2(const char *name, HTPCfgRec *cfg_prec) htp_config_register_request_line(cfg_prec->cfg, HTPCallbackRequestLine); - cfg_prec->request.sbcfg.buf_size = cfg_prec->request.inspect_window ? - cfg_prec->request.inspect_window : 256; - cfg_prec->request.sbcfg.buf_slide = 0; + cfg_prec->request.sbcfg.buf_size = + cfg_prec->request.inspect_window ? cfg_prec->request.inspect_window : 256; cfg_prec->request.sbcfg.Calloc = HTPCalloc; cfg_prec->request.sbcfg.Realloc = HTPRealloc; cfg_prec->request.sbcfg.Free = HTPFree; - cfg_prec->response.sbcfg.buf_size = cfg_prec->response.inspect_window ? - cfg_prec->response.inspect_window : 256; - cfg_prec->response.sbcfg.buf_slide = 0; + cfg_prec->response.sbcfg.buf_size = + cfg_prec->response.inspect_window ? cfg_prec->response.inspect_window : 256; cfg_prec->response.sbcfg.Calloc = HTPCalloc; cfg_prec->response.sbcfg.Realloc = HTPRealloc; cfg_prec->response.sbcfg.Free = HTPFree; diff --git a/src/util-streaming-buffer.c b/src/util-streaming-buffer.c index 06d4150ac7..e318553cc8 100644 --- a/src/util-streaming-buffer.c +++ b/src/util-streaming-buffer.c @@ -1706,7 +1706,7 @@ static void DumpSegment(StreamingBuffer *sb, StreamingBufferSegment *seg) static int StreamingBufferTest02(void) { - StreamingBufferConfig cfg = { 8, 24, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; + StreamingBufferConfig cfg = { 24, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; StreamingBuffer *sb = StreamingBufferInit(&cfg); FAIL_IF(sb == NULL); @@ -1762,7 +1762,7 @@ static int StreamingBufferTest02(void) static int StreamingBufferTest03(void) { - StreamingBufferConfig cfg = { 8, 24, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; + StreamingBufferConfig cfg = { 24, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; StreamingBuffer *sb = StreamingBufferInit(&cfg); FAIL_IF(sb == NULL); @@ -1817,7 +1817,7 @@ static int StreamingBufferTest03(void) static int StreamingBufferTest04(void) { - StreamingBufferConfig cfg = { 8, 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; + StreamingBufferConfig cfg = { 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; StreamingBuffer *sb = StreamingBufferInit(&cfg); FAIL_IF(sb == NULL); @@ -1908,7 +1908,7 @@ static int StreamingBufferTest04(void) /** \test lots of gaps in block list */ static int StreamingBufferTest06(void) { - StreamingBufferConfig cfg = { 8, 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; + StreamingBufferConfig cfg = { 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; StreamingBuffer *sb = StreamingBufferInit(&cfg); FAIL_IF(sb == NULL); @@ -1966,7 +1966,7 @@ static int StreamingBufferTest06(void) /** \test lots of gaps in block list */ static int StreamingBufferTest07(void) { - StreamingBufferConfig cfg = { 8, 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; + StreamingBufferConfig cfg = { 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; StreamingBuffer *sb = StreamingBufferInit(&cfg); FAIL_IF(sb == NULL); @@ -2024,7 +2024,7 @@ static int StreamingBufferTest07(void) /** \test lots of gaps in block list */ static int StreamingBufferTest08(void) { - StreamingBufferConfig cfg = { 8, 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; + StreamingBufferConfig cfg = { 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; StreamingBuffer *sb = StreamingBufferInit(&cfg); FAIL_IF(sb == NULL); @@ -2082,7 +2082,7 @@ static int StreamingBufferTest08(void) /** \test lots of gaps in block list */ static int StreamingBufferTest09(void) { - StreamingBufferConfig cfg = { 8, 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; + StreamingBufferConfig cfg = { 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; StreamingBuffer *sb = StreamingBufferInit(&cfg); FAIL_IF(sb == NULL); @@ -2140,7 +2140,7 @@ static int StreamingBufferTest09(void) /** \test lots of gaps in block list */ static int StreamingBufferTest10(void) { - StreamingBufferConfig cfg = { 8, 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; + StreamingBufferConfig cfg = { 16, 1, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL }; StreamingBuffer *sb = StreamingBufferInit(&cfg); FAIL_IF(sb == NULL); diff --git a/src/util-streaming-buffer.h b/src/util-streaming-buffer.h index c7805ff8b2..fd088b1833 100644 --- a/src/util-streaming-buffer.h +++ b/src/util-streaming-buffer.h @@ -64,7 +64,6 @@ #define STREAMING_BUFFER_REGION_GAP_DEFAULT 262144 typedef struct StreamingBufferConfig_ { - uint32_t buf_slide; uint32_t buf_size; uint16_t max_regions; /**< max concurrent memory regions. 0 means no limit. */ uint32_t region_gap; /**< max gap size before a new region will be created. */ @@ -75,7 +74,7 @@ typedef struct StreamingBufferConfig_ { #define STREAMING_BUFFER_CONFIG_INITIALIZER \ { \ - 0, 0, 0, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL, \ + 0, 0, STREAMING_BUFFER_REGION_GAP_DEFAULT, NULL, NULL, NULL, \ } #define STREAMING_BUFFER_REGION_INIT \ -- 2.47.2