-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HCM: Make reverse iteration resilient to element deletion (#30158)
--------- Signed-off-by: Yan Avlasov <[email protected]>
- Loading branch information
1 parent
8acfab7
commit a470c6c
Showing
8 changed files
with
177 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
test/integration/filters/local_reply_during_decoding_filter.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <string> | ||
|
||
#include "envoy/http/filter.h" | ||
#include "envoy/registry/registry.h" | ||
#include "envoy/server/filter_config.h" | ||
|
||
#include "source/extensions/filters/http/common/pass_through_filter.h" | ||
|
||
#include "test/extensions/filters/http/common/empty_http_filter_config.h" | ||
#include "test/integration/filters/common.h" | ||
|
||
namespace Envoy { | ||
|
||
class LocalReplyDuringDecode : public Http::PassThroughFilter { | ||
public: | ||
constexpr static char name[] = "local-reply-during-decode"; | ||
|
||
Http::FilterHeadersStatus decodeHeaders(Http::RequestHeaderMap& request_headers, bool) override { | ||
auto result = request_headers.get(Http::LowerCaseString("skip-local-reply")); | ||
if (!result.empty() && result[0]->value() == "true") { | ||
return Http::FilterHeadersStatus::Continue; | ||
} | ||
decoder_callbacks_->sendLocalReply(Http::Code::InternalServerError, "", nullptr, absl::nullopt, | ||
""); | ||
return Http::FilterHeadersStatus::StopIteration; | ||
} | ||
}; | ||
|
||
constexpr char LocalReplyDuringDecode::name[]; | ||
static Registry::RegisterFactory<SimpleFilterConfig<LocalReplyDuringDecode>, | ||
Server::Configuration::NamedHttpFilterConfigFactory> | ||
register_; | ||
static Registry::RegisterFactory<SimpleFilterConfig<LocalReplyDuringDecode>, | ||
Server::Configuration::UpstreamHttpFilterConfigFactory> | ||
register_upstream_; | ||
|
||
} // namespace Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters