Skip to content

Commit

Permalink
Ensure every instance of StreamFilter and PassThroughFilter to contai…
Browse files Browse the repository at this point in the history
…n only one copy of StreamFilterBase. (envoyproxy#35341)

Change Stream(Decode|Encode)Filter to inherit from StreamFilterBase
virtually.
Move the default implementation of
PassThrough(Decoder|Encode)Filter::onDestroy into StreamFilterBase.

---------

Signed-off-by: Bin Wu <[email protected]>
  • Loading branch information
wu-bin authored Aug 1, 2024
1 parent 8b9b23b commit 0fa9e60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions envoy/http/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ class StreamFilterBase {
/**
* Stream decoder filter interface.
*/
class StreamDecoderFilter : public StreamFilterBase {
class StreamDecoderFilter : public virtual StreamFilterBase {
public:
/**
* Called with decoded headers, optionally indicating end of stream.
Expand Down Expand Up @@ -1112,7 +1112,7 @@ class StreamEncoderFilterCallbacks : public virtual StreamFilterCallbacks {
/**
* Stream encoder filter interface.
*/
class StreamEncoderFilter : public StreamFilterBase {
class StreamEncoderFilter : public virtual StreamFilterBase {
public:
/**
* Called with supported 1xx headers.
Expand Down
6 changes: 5 additions & 1 deletion source/extensions/filters/http/common/pass_through_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class PassThroughEncoderFilter : public virtual StreamEncoderFilter {
// A filter which passes all data through with Continue status.
class PassThroughFilter : public StreamFilter,
public PassThroughDecoderFilter,
public PassThroughEncoderFilter {};
public PassThroughEncoderFilter {
public:
// Http::StreamFilterBase
void onDestroy() override {}
};
} // namespace Http
} // namespace Envoy

0 comments on commit 0fa9e60

Please sign in to comment.