Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listener: remove the peek from the listener filters #17395

Merged
merged 177 commits into from Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
8be8d06
Add listener filter buffer
soulxu Aug 31, 2021
dfe1577
Update listener filter interface
soulxu Aug 31, 2021
c803b2c
Using the new ListenerFilterBuffer
soulxu Aug 31, 2021
a78ca39
fix
soulxu Aug 31, 2021
8aaacff
convert proxy protocol filter to use ListenerFilterBuffer
soulxu Sep 1, 2021
f47023a
fix proxy filter
soulxu Sep 2, 2021
6ceb43b
Using Buffer::Instance for ListenerFilterBuffer
soulxu Sep 2, 2021
1fc908d
Using Buffer::Instance for copyOut method
soulxu Sep 2, 2021
7c27f7f
using the new copyOut method for tls inspect
soulxu Sep 2, 2021
ab3fb54
turn the proxy filter to use new copyOut method
soulxu Sep 2, 2021
066a931
remove the old copyOut method
soulxu Sep 2, 2021
0ce5112
Peek the data manually when accept the connection
soulxu Sep 2, 2021
375c1a5
fix format
soulxu Sep 2, 2021
eb61a46
Add ConstRawBuffer
soulxu Sep 12, 2021
7523574
Using the ConstRawSlice for tls inspect
soulxu Sep 12, 2021
31889ef
Using ConstRawSlice for proxy filter
soulxu Sep 12, 2021
78d3104
Remove copyOut method
soulxu Sep 12, 2021
52a5752
Add unittest for ListenerFilterBufferImpl
soulxu Sep 13, 2021
7ba4fb9
Change inspectSize to maxReadBytes
soulxu Sep 13, 2021
e8faf52
Update the variable name
soulxu Sep 13, 2021
8a4d00e
Add test for ActiveTcpSocket
soulxu Sep 14, 2021
bdf5559
fix the spell
soulxu Sep 14, 2021
133a795
fix listener filter timeout test
soulxu Sep 15, 2021
2d1eda8
add test for tls inspect filter
soulxu Sep 16, 2021
9696e49
fix tls inspect benchmark test
soulxu Sep 16, 2021
0f4e465
remove useless stats for tls inspect filter
soulxu Sep 16, 2021
f9ac956
Convert proxy filter to use new interface
soulxu Sep 17, 2021
4ce02f6
Check the zero return value of recv
soulxu Sep 17, 2021
dff726a
close the socket when connection failed
soulxu Sep 17, 2021
94104e2
fix format
soulxu Sep 17, 2021
e227e38
Remove useless method for proxy filter
soulxu Sep 18, 2021
efa5857
Convert the http inspect filter to new interface
soulxu Sep 18, 2021
a07c7f9
fix connection handler test
soulxu Sep 19, 2021
d558321
fix format
soulxu Sep 19, 2021
e8ce277
Add debug log
soulxu Sep 19, 2021
3f73e69
Reject the conneciton when filter stop iteration and doesn't expect a…
soulxu Sep 19, 2021
7b8d032
Merge branch 'main' into poc_peek_data
soulxu Sep 19, 2021
82e5d2b
fix format
soulxu Sep 19, 2021
ae391ec
fix spell
soulxu Sep 19, 2021
789456e
end with new line
soulxu Sep 19, 2021
065d6b5
fix listener filter buffer test file
soulxu Sep 19, 2021
c2a57ad
revert the format change to quic logging
soulxu Sep 19, 2021
d2540e8
remove useless header file
soulxu Sep 19, 2021
bbfca55
fix http inspect filter test
soulxu Sep 19, 2021
1d55e8d
Fix http insepct InvalidConnectionPreface test
soulxu Sep 19, 2021
a360a31
Address the issues clang tidy reported
soulxu Sep 20, 2021
06aa973
fix the coverage
soulxu Sep 20, 2021
aba84f9
Merge branch 'main' into poc_peek_data
soulxu Sep 24, 2021
9015048
make the maxReadBytes as pure method
soulxu Sep 24, 2021
df2ad02
Using drain instead of drainFromSocket and use raw buffer
soulxu Sep 24, 2021
aaa6d9a
fix format
soulxu Sep 24, 2021
7bffad3
revert the format change for quic header
soulxu Sep 24, 2021
37c16a5
cleanup
soulxu Sep 24, 2021
c7858e3
fix format
soulxu Sep 24, 2021
80f8f8b
return Error when drain failed for proxy filter
soulxu Sep 24, 2021
9725f08
Add debug log
soulxu Sep 24, 2021
6b0f734
revert the quick header format change
soulxu Sep 25, 2021
62c3845
remove the closed event registeration
soulxu Sep 27, 2021
0fff99b
Remove close event handle in listenerfilterbuffer
soulxu Sep 27, 2021
4bda3ac
fix test
soulxu Sep 27, 2021
3be4ee0
Using uint8_t instead of char
soulxu Sep 28, 2021
d88ae5a
Using uint64_t instead of size_t
soulxu Sep 28, 2021
4a8d69e
Using the buffer_ for drain
soulxu Sep 28, 2021
41b3aa0
adjust comment
soulxu Sep 28, 2021
a606cf4
Assert the filter expect data when return stop from onAccept
soulxu Sep 28, 2021
705a58d
fix format
soulxu Sep 28, 2021
fa5a289
Windows: Emulate MSG_PEEK by read
Nov 4, 2021
c2b5b44
fix format
Nov 4, 2021
fd85009
fix compiler warning
Nov 4, 2021
8972610
fix compilation issue
Nov 4, 2021
4aeaeae
more coverage is needed but still testing ci
Nov 5, 2021
544a1c8
Merge remote-tracking branch 'upstream/main' into peekWindows2
Nov 5, 2021
15fc820
fix format and increase coverage
Nov 5, 2021
4e60815
fix format
Nov 5, 2021
fe11b35
fix gcc
Nov 5, 2021
5370061
Merge branch 'main' into poc_peek_data
soulxu Nov 8, 2021
775f040
fix
soulxu Nov 8, 2021
052fdca
Remove the useless check for drainning
soulxu Nov 8, 2021
268b047
Add assertion for valid data size
soulxu Nov 8, 2021
1534dcd
address PR feedack v1
Nov 8, 2021
347d474
Merge branch 'peekWindows2' into poc_peek_data
soulxu Nov 9, 2021
6efde49
fix format
soulxu Nov 9, 2021
e98e7b9
Fix proxy protocol test for windows mimic peek
soulxu Nov 17, 2021
0e26bd2
Merge branch 'main' into poc_peek_data
soulxu Nov 17, 2021
3f428ef
Fix the JA3 related unittest
soulxu Nov 17, 2021
002aa00
Merge branch 'main' into poc_peek_data
soulxu Nov 18, 2021
bd75c8e
fix build for active internal listener
soulxu Nov 18, 2021
3eb8880
address comments
Nov 19, 2021
f2fd1fb
fix spelling
Nov 19, 2021
72e8f20
fix format
Nov 19, 2021
db35fbf
add override keyword
Nov 19, 2021
16caa4f
another format fix
Nov 19, 2021
a479ef8
fix string buffer used in fuzzing
Nov 19, 2021
d3dd4d3
fix typo in fuzzer
Nov 19, 2021
23c6341
add override keyword
Nov 19, 2021
1c1223f
fixed another typo
Nov 19, 2021
abe8be2
remove unused parameters
Nov 19, 2021
046a769
fix format
soulxu Nov 20, 2021
02e5397
Merge branch 'peekWindows2' into poc_peek_data
soulxu Nov 20, 2021
5705fe5
fix active internal listener test
soulxu Nov 22, 2021
3b60d73
test original src filter
soulxu Nov 22, 2021
bfb1336
Merge branch 'main' into poc_peek_data
soulxu Nov 22, 2021
31aee37
PR comments and tests
Nov 23, 2021
55361a3
add hint for mac compiler
Nov 23, 2021
320e370
Improve the copyOutToSlices method
soulxu Dec 15, 2021
f73213d
Merge branch 'main' into peekWindows2
soulxu Dec 15, 2021
a2e8799
address comment
soulxu Dec 15, 2021
d113f4c
type conversion for macos
soulxu Dec 15, 2021
0c03750
correct the copyOutToSlices method
soulxu Dec 24, 2021
52828ee
Merge branch 'main' into peekWindows2
soulxu Dec 24, 2021
959170b
remove NOT_IMPLEMENTED_GCOVR_EXCL_LINE
soulxu Dec 24, 2021
d023827
Merge branch 'main' into peekWindows2
soulxu Dec 27, 2021
d2fe6e2
address comment
soulxu Jan 6, 2022
d673110
Merge branch 'main' into peekWindows2
soulxu Jan 6, 2022
6a25bfd
Merge branch 'peekWindows2' into poc_peek_data
soulxu Jan 6, 2022
f5491ce
Merge branch 'main' into poc_peek_data
soulxu Jan 25, 2022
eee4e6e
remove deprecated test
soulxu Jan 25, 2022
7df678c
adjust coverage rate
soulxu Jan 25, 2022
7e7c3da
Add more tests for windows
soulxu Jan 25, 2022
b3d9a42
update spell dict for iov and iovcnt
soulxu Jan 25, 2022
dfc5527
listener: check the listener isn't stopped when balance the request
soulxu Feb 3, 2022
7dcd41c
fix comment
soulxu Feb 3, 2022
bef9023
add test
soulxu Feb 3, 2022
48b574d
more fix
soulxu Feb 5, 2022
72d978a
Assert the ip address
soulxu Feb 7, 2022
d32a126
revert unrelated change
soulxu Feb 7, 2022
0749507
Merge branch 'main' into poc_peek_data
soulxu Feb 8, 2022
12cb6b3
Merge branch 'check_listener' into poc_peek_data
soulxu Feb 8, 2022
2ded76a
A test for windows
soulxu Feb 10, 2022
e77307a
Merge branch 'main' into poc_peek_data
soulxu Feb 16, 2022
cec8291
fix the merge
soulxu Feb 16, 2022
c9a90af
revert test change
soulxu Feb 17, 2022
7965de9
fix format
soulxu Feb 17, 2022
197af3b
Merge branch 'main' into poc_peek_data
soulxu Mar 1, 2022
dbcbc21
ListenerFilterBuffer: remove the bool return value for drain method
soulxu Mar 2, 2022
607e348
ActiveTcpListener: add counter stats for peek data
soulxu Mar 2, 2022
f94ff76
ListenerFilterBuffer: add method to enable activate file event manually
soulxu Mar 2, 2022
a7baa39
Fix the test
soulxu Mar 2, 2022
03b494e
Add assertion ensure filter won't return stop when no more data
soulxu Mar 2, 2022
1c5a548
Add doc for stats
soulxu Mar 2, 2022
6df4baa
ListenerFilterBuffer: pass the buffer as on data callback param
soulxu Mar 2, 2022
ff70529
fix the test
soulxu Mar 2, 2022
0250b08
fix the assertion
soulxu Mar 2, 2022
1b734b1
remove the useless check
soulxu Mar 2, 2022
e1d277c
Fix the test
soulxu Mar 2, 2022
aa0e113
revert useless format change
soulxu Mar 3, 2022
c713a4f
add fuzz test
soulxu Mar 3, 2022
0296e09
add endline
soulxu Mar 4, 2022
0c5f498
Remove the length method
soulxu Mar 4, 2022
f9d520f
fix typo
soulxu Mar 4, 2022
a3cd1e0
fix the clang tidy complain
soulxu Mar 4, 2022
0c9d84d
Revert "revert useless format change"
soulxu Mar 8, 2022
4088880
Merge branch 'main' into poc_peek_data
soulxu Mar 10, 2022
8d190cb
revert unrelated format change
soulxu Mar 10, 2022
ec80e88
revert format change
soulxu Mar 10, 2022
7daa3f0
Merge branch 'main' into poc_peek_data
soulxu Mar 12, 2022
1abda9f
Address comment
soulxu Mar 12, 2022
8b454fd
Address comment
soulxu Mar 12, 2022
c534a97
Fix the maxReadBytes for Proxy filter
soulxu Mar 12, 2022
3248c72
fix comment
soulxu Mar 12, 2022
3ea4755
change the stats name
soulxu Mar 12, 2022
920dc64
Add comments
soulxu Mar 13, 2022
ca4fb1b
Process the case of drain failed
soulxu Mar 13, 2022
af40bae
Enable the capacity of ListenerFilterBufferImpl changable
soulxu Mar 13, 2022
38dffc7
fix the spell
soulxu Mar 13, 2022
b8bb4df
Fix the connection handler test
soulxu Mar 13, 2022
5136c59
Add resetCapacity and read eagain to the fuzz test
soulxu Mar 13, 2022
cab9e59
Add ListenerFilterWithDataFuzzer test
soulxu Mar 14, 2022
730cf45
Refactor tls inspector test
soulxu Mar 14, 2022
2b5636d
Cleanup build file
soulxu Mar 14, 2022
d30d7fc
fix format
soulxu Mar 14, 2022
ca84c78
fix build file
soulxu Mar 15, 2022
2604a1b
correct the declare of Return
soulxu Mar 15, 2022
b523971
fix log
soulxu Mar 15, 2022
5cdfe2b
Merge branch 'main' into poc_peek_data
soulxu Mar 17, 2022
26f32f0
Merge branch 'main' into poc_peek_data
soulxu Mar 24, 2022
ea26901
fix release note
soulxu Mar 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions envoy/network/BUILD
Expand Up @@ -80,6 +80,7 @@ envoy_cc_library(
hdrs = ["filter.h"],
deps = [
":listen_socket_interface",
":listener_filter_buffer_interface",
":transport_socket_interface",
"//envoy/buffer:buffer_interface",
"//envoy/stream_info:stream_info_interface",
Expand Down Expand Up @@ -141,6 +142,14 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "listener_filter_buffer_interface",
hdrs = ["listener_filter_buffer.h"],
deps = [
"//envoy/buffer:buffer_interface",
],
)

envoy_cc_library(
name = "transport_socket_interface",
hdrs = ["transport_socket.h"],
Expand Down
15 changes: 15 additions & 0 deletions envoy/network/filter.h
Expand Up @@ -4,6 +4,7 @@

#include "envoy/buffer/buffer.h"
#include "envoy/network/listen_socket.h"
#include "envoy/network/listener_filter_buffer.h"
#include "envoy/network/transport_socket.h"
#include "envoy/stream_info/stream_info.h"
#include "envoy/upstream/host_description.h"
Expand Down Expand Up @@ -330,6 +331,20 @@ class ListenerFilter {
* @return status used by the filter manager to manage further filter iteration.
*/
virtual FilterStatus onAccept(ListenerFilterCallbacks& cb) PURE;

/**
* Called when data read from the connection. If the filter chain doesn't get
* enough data, the filter chain can be stopped, then waiting for more data.
* @param buffer the buffer of data.
* @return status used by the filter manager to manage further filter iteration.
*/
virtual FilterStatus onData(Network::ListenerFilterBuffer& buffer) PURE;

/**
* Return the size of data the filter want to inspect from the connection.
@return the size of data inspect from the connection. 0 means filter needn't any data.
soulxu marked this conversation as resolved.
Show resolved Hide resolved
*/
virtual size_t inspectSize() const { return 0; }
};

using ListenerFilterPtr = std::unique_ptr<ListenerFilter>;
Expand Down
43 changes: 43 additions & 0 deletions envoy/network/listener_filter_buffer.h
@@ -0,0 +1,43 @@
#pragma once

#include <cstdint>
#include <memory>

#include "envoy/buffer/buffer.h"
#include "envoy/common/pure.h"

namespace Envoy {
namespace Network {

/**
* Interface for ListenerFilterBuffer
*/
class ListenerFilterBuffer {
public:
virtual ~ListenerFilterBuffer() = default;

/**
* Copy the bufferred data into the specific Buffer::Instance.
* But it won't drain the data after copyOut, except an explicit drain method invoked.
* @param buffer supplies the buffer to read into.
* @param max_length supplies the maximum length to read.
* @return the length of data read into the buffer.
*/
virtual uint64_t copyOut(Buffer::Instance& buffer, uint64_t length) PURE;

/**
* Drain the data from the beginning of the buffer.
* @param length the length of data to drain.
* @return the actual length of data drained.
*/
virtual uint64_t drain(uint64_t length) PURE;

/**
* Return the length of data in the buffer
* @return length The length of data in the buffer.
*/
virtual uint64_t length() const PURE;
soulxu marked this conversation as resolved.
Show resolved Hide resolved
};

} // namespace Network
} // namespace Envoy
11 changes: 11 additions & 0 deletions source/common/network/BUILD
Expand Up @@ -268,6 +268,17 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "listener_filter_buffer_lib",
srcs = ["listener_filter_buffer_impl.cc"],
hdrs = ["listener_filter_buffer_impl.h"],
deps = [
"//envoy/network:io_handle_interface",
"//envoy/network:listener_filter_buffer_interface",
"//source/common/buffer:buffer_lib",
],
)

envoy_cc_library(
name = "listener_lib",
srcs = [
Expand Down
70 changes: 70 additions & 0 deletions source/common/network/listener_filter_buffer_impl.cc
@@ -0,0 +1,70 @@
#include "source/common/network/listener_filter_buffer_impl.h"

#include <string.h>

namespace Envoy {
namespace Network {

uint64_t ListenerFilterBufferImpl::copyOut(Buffer::Instance& buffer, uint64_t length) {
auto size = std::min(length, data_size_);
if (size == 0) {
return 0;
}
buffer.drain(buffer.length());
soulxu marked this conversation as resolved.
Show resolved Hide resolved
uint8_t* raw_mem = static_cast<uint8_t*>(buffer_->frontSlice().mem_);
soulxu marked this conversation as resolved.
Show resolved Hide resolved
buffer.add(raw_mem + drained_size_, size);
return size;
}

uint64_t ListenerFilterBufferImpl::drain(uint64_t length) {
auto size_to_drain = std::min(length, data_size_);
// It doesn't drain the data from buffer directly until drain the data
soulxu marked this conversation as resolved.
Show resolved Hide resolved
// from actual socket.
drained_size_ += size_to_drain;
data_size_ -= size_to_drain;
return size_to_drain;
}

bool ListenerFilterBufferImpl::drainFromSocket() {
// Since we want to drain the data from the socket, so a
// temporary buffer need here.
std::unique_ptr<uint8_t[]> buf(new uint8_t[drained_size_]);
soulxu marked this conversation as resolved.
Show resolved Hide resolved
auto result = io_handle_.recv(buf.get(), drained_size_, 0);
if (!result.ok()) {
on_close_cb_();
return false;
}
buffer_->drain(drained_size_);
soulxu marked this conversation as resolved.
Show resolved Hide resolved
drained_size_ = 0;
return true;
}

PeekState ListenerFilterBufferImpl::peekFromSocket() {
auto raw_slice = buffer_->frontSlice();
soulxu marked this conversation as resolved.
Show resolved Hide resolved

const auto result = io_handle_.recv(raw_slice.mem_, raw_slice.len_, MSG_PEEK);
if (!result.ok()) {
if (result.err_->getErrorCode() == Api::IoError::IoErrorCode::Again) {
return PeekState::Again;
}
return PeekState::Error;
}
data_size_ = result.return_value_ - drained_size_;
return PeekState::Done;
}

void ListenerFilterBufferImpl::onFileEvent(uint32_t events) {
if (events & Event::FileReadyType::Closed) {
on_close_cb_();
}

auto state = peekFromSocket();
if (state == PeekState::Done) {
on_data_cb_();
} else if (state == PeekState::Error) {
on_close_cb_();
}
}

} // namespace Network
} // namespace Envoy
86 changes: 86 additions & 0 deletions source/common/network/listener_filter_buffer_impl.h
@@ -0,0 +1,86 @@
#pragma once

#include <bits/stdint-uintn.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? I don't think this is portable, and I would be surprised if the definition of uint8_t isn't already included.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like everytime I use uint*_t, the vscode add it. But yes, the code works without this include.


#include <atomic>
soulxu marked this conversation as resolved.
Show resolved Hide resolved
#include <functional>
#include <memory>

#include "envoy/buffer/buffer.h"
#include "envoy/network/io_handle.h"
#include "envoy/network/listener_filter_buffer.h"

#include "source/common/buffer/buffer_impl.h"

namespace Envoy {
namespace Network {

using ListenerFilterBufferOnCloseCb = std::function<void()>;
using ListenerFilterBufferOnDataCb = std::function<void()>;

enum class PeekState {
// Peek data status successful.
Done,
// Need to try again.
Again,
// Error to peek data.
Error
};

class ListenerFilterBufferImpl : public ListenerFilterBuffer, Logger::Loggable<Logger::Id::filter> {
public:
ListenerFilterBufferImpl(IoHandle& io_handle, Event::Dispatcher& dispatcher,
soulxu marked this conversation as resolved.
Show resolved Hide resolved
ListenerFilterBufferOnCloseCb close_cb,
ListenerFilterBufferOnDataCb on_data_cb, uint64_t buffer_size)
: io_handle_(io_handle), dispatcher_(dispatcher), on_close_cb_(close_cb),
on_data_cb_(on_data_cb), buffer_(new Buffer::OwnedImpl()) {
soulxu marked this conversation as resolved.
Show resolved Hide resolved
// Since we need the single slice for peek from the socket, so initialize that
// single slice.
auto reservation = buffer_->reserveSingleSlice(buffer_size);
reservation.commit(buffer_size);
}

uint64_t copyOut(Buffer::Instance& buffer, uint64_t length) override;
uint64_t drain(uint64_t length) override;
uint64_t length() const override { return buffer_->length(); }

/**
* trigger the data peek from the socket.
*/
PeekState peekFromSocket();

/**
* sync the drain to the actual socket.
*/
bool drainFromSocket();

void initialize() {
io_handle_.initializeFileEvent(
dispatcher_, [this](uint32_t events) { onFileEvent(events); },
Event::PlatformDefaultTriggerType,
Event::FileReadyType::Read | Event::FileReadyType::Closed);
}

void reset() { io_handle_.resetFileEvents(); }

private:
void onFileEvent(uint32_t events);

IoHandle& io_handle_;
Event::Dispatcher& dispatcher_;
ListenerFilterBufferOnCloseCb on_close_cb_;
ListenerFilterBufferOnDataCb on_data_cb_;

// The buffer for the data peeked from the socket.
Buffer::InstancePtr buffer_;
// the size of valid data.
uint64_t data_size_{0};
// This is used for counting the drained data size before
// drain the data from actual socket.
uint64_t drained_size_{0};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I kind of agree that if you are doing all of this manual accounting Buffer::Instance is not giving you that much value here. I could go either way on this. I would still personally prefer we use Buffer::Instance and push the accounting into it if possible. @ggreenway wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have three options here:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this ends up being a bit simpler with just a raw buffer owned by a unique_ptr, because with the PEEK read, we can't use reserveSingleSlice/commit in the expected way, because we'd have to drain the entire buffer before each read (since the read always re-reads all previous data), which would free the buffer each time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will update the code back to raw buffer

};

using ListenerFilterBufferImplPtr = std::unique_ptr<ListenerFilterBufferImpl>;

} // namespace Network
} // namespace Envoy
Expand Up @@ -70,6 +70,11 @@ class Filter : public Network::ListenerFilter, Logger::Loggable<Logger::Id::filt
// Network::ListenerFilter
Network::FilterStatus onAccept(Network::ListenerFilterCallbacks& cb) override;

// TODO (soulxu) implement this instead of filter peek data by itself.
Network::FilterStatus onData(Network::ListenerFilterBuffer&) override {
return Network::FilterStatus::Continue;
};

private:
static const absl::string_view HTTP2_CONNECTION_PREFACE;

Expand Down
Expand Up @@ -26,6 +26,10 @@ class OriginalDstFilter : public Network::ListenerFilter, Logger::Loggable<Logge
// Network::ListenerFilter
Network::FilterStatus onAccept(Network::ListenerFilterCallbacks& cb) override;

Network::FilterStatus onData(Network::ListenerFilterBuffer&) override {
return Network::FilterStatus::Continue;
};

private:
envoy::config::core::v3::TrafficDirection traffic_direction_;
};
Expand Down
Expand Up @@ -23,6 +23,10 @@ class OriginalSrcFilter : public Network::ListenerFilter, Logger::Loggable<Logge
// Network::ListenerFilter
Network::FilterStatus onAccept(Network::ListenerFilterCallbacks& cb) override;

Network::FilterStatus onData(Network::ListenerFilterBuffer&) override {
return Network::FilterStatus::Continue;
};

private:
Config config_;
};
Expand Down
1 change: 1 addition & 0 deletions source/extensions/filters/listener/proxy_protocol/BUILD
Expand Up @@ -24,6 +24,7 @@ envoy_cc_library(
"//envoy/network:filter_interface",
"//envoy/network:listen_socket_interface",
"//source/common/api:os_sys_calls_lib",
"//source/common/buffer:buffer_lib",
"//source/common/common:assert_lib",
"//source/common/common:empty_string",
"//source/common/common:minimal_logger_lib",
Expand Down