-
Notifications
You must be signed in to change notification settings - Fork 5.5k
listener filter: hiding envoy internal from ListenerFilterCallbacks interface #22732
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
Changes from 3 commits
669384e
e8563f3
8679577
5016686
ac12792
f1f7191
b5bb43c
b5a1412
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -83,8 +83,17 @@ struct ActiveTcpSocket : public Network::ListenerFilterManager, | |||||
|
|
||||||
| // Network::ListenerFilterCallbacks | ||||||
| Network::ConnectionSocket& socket() override { return *socket_.get(); } | ||||||
| Event::Dispatcher& dispatcher() override; | ||||||
| void continueFilterChain(bool success) override; | ||||||
|
|
||||||
| /** | ||||||
| * If a filter returned `FilterStatus::ContinueIteration`, `continueFilterChain(true)` | ||||||
| * should be called to continue the filter chain iteration. Or `continueFilterChain(false)` | ||||||
| * should be called if the filter returned `FilterStatus::StopIteration` and closed | ||||||
| * the socket. | ||||||
| * @param success boolean telling whether the filter execution was successful or not. | ||||||
| */ | ||||||
| void continueFilterChain(bool success); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move this elsewhere since it's no longer part of the interface commented above and have it documented? It seems like it's now split into either internal usage or external
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise comments in https://github.com/envoyproxy/envoy/pull/22732/files/e8563f3153394c2ffe8653ca9c9beef7e70dacc0#diff-6708370e112a5097f06e16009c3730b34f5ab0ee4f1e736f8816848409435888R122 and Line 333 in fb2d0a0
should be updated since the convention is changing e.g the filter doesn't call continue
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The ActiveTcpSocket is a struct, its all members are public now, I guess that is for convenient for ActiveTcpListener access. And ActiveTcpListener is only place ActiveTcpSocket, and probably we think ActiveTcpSocket is kind of internal struct for ActiveTcpListener(since its only alive short time, it will be deleted when the connection passed all the listener filters or the connection rejected by listener filter)
Yea, that is good idea! The ActiveTcpListener is the place to call
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
got it, will update the comments
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks this looks great! It makes a lot of sense that a lot of the class was open as you said, but it seems like it has grown in responsibility e.g. internally buffering listener data. Having some methods private (
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it, let me try to improve that. |
||||||
| void startFilterChain() { continueFilterChain(true); } | ||||||
|
|
||||||
| void setDynamicMetadata(const std::string& name, const ProtobufWkt::Struct& value) override; | ||||||
| envoy::config::core::v3::Metadata& dynamicMetadata() override { | ||||||
| return stream_info_->dynamicMetadata(); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/data read/data is read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, thanks!