Skip to content

Commit

Permalink
Fuzzer: Fix ext_proc fuzz bug (#27639)
Browse files Browse the repository at this point in the history
* ext_proc should not open an additional stream if we've completed processing.

Signed-off-by: Yanjun Xiang <[email protected]>
  • Loading branch information
yanjunxiang-google authored Jun 2, 2023
1 parent d29dcb1 commit d0fd025
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/extensions/filters/http/ext_proc/ext_proc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ void Filter::setEncoderFilterCallbacks(Http::StreamEncoderFilterCallbacks& callb
}

Filter::StreamOpenState Filter::openStream() {
ENVOY_BUG(!processing_complete_, "openStream should not have been called");
// External processing is completed. This means there is no need to send any further
// message to the server for processing. Just return IgnoreError so the filter
// will return FilterHeadersStatus::Continue.
if (processing_complete_) {
ENVOY_LOG(debug, "External processing is completed when trying to open the gRPC stream");
return StreamOpenState::IgnoreError;
}
if (!stream_) {
ENVOY_LOG(debug, "Opening gRPC stream to external processor");
stream_ = client_->start(*this, grpc_service_, decoder_callbacks_->streamInfo());
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d0fd025

Please sign in to comment.