Skip to content

Commit d540ffd

Browse files
author
Sotiris Nanopoulos
committed
Address PR comments
Signed-off-by: Sotiris Nanopoulos <[email protected]>
1 parent 212418a commit d540ffd

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

test/extensions/filters/listener/http_inspector/BUILD

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ envoy_extension_cc_test(
1616
srcs = ["http_inspector_test.cc"],
1717
extension_name = "envoy.filters.listener.http_inspector",
1818
#TODO(davinci26): The test passes on Windows *but* http inspector
19-
# relies on Event::FileTriggerType::Edge and we get away with it
20-
# because we mock the dispather.
19+
# *used* to rely on Event::FileTriggerType::Edge and we got away with it
20+
# because we mock the dispatcher. Need to verify that the scenario is
21+
# actually working.
2122
tags = ["fails_on_windows"],
2223
deps = [
2324
"//source/common/common:hex_lib",

test/extensions/filters/listener/http_inspector/http_inspector_test.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ TEST_F(HttpInspectorTest, MultipleReadsHttp1BadProtocol) {
567567
}
568568

569569
TEST_F(HttpInspectorTest, Http1WithLargeRequestLine) {
570+
// Verify that the http inspector can detect http requests
571+
// with large request line even when they are splitted over
572+
// multiple recv calls.
570573
init();
571574
absl::string_view method = "GET", http = "/index HTTP/1.0\r";
572575
std::string spaces(Config::MAX_INSPECT_SIZE - method.size() - http.size(), ' ');
@@ -591,11 +594,12 @@ TEST_F(HttpInspectorTest, Http1WithLargeRequestLine) {
591594
int) -> Api::SysCallSizeResult {
592595
size_t len = (*ctr);
593596
if (num_loops == 2) {
597+
ASSERT(*ctx != 3)
594598
len = size_t(Config::MAX_INSPECT_SIZE / (3 - (*ctr)));
595599
}
596600
ASSERT(length >= len);
597601
memcpy(buffer, data.data(), len);
598-
(*ctr) += 1;
602+
*ctr += 1;
599603
return Api::SysCallSizeResult{ssize_t(len), 0};
600604
}));
601605
}

0 commit comments

Comments
 (0)