Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
Signed-off-by: Takeshi Yoneda <[email protected]>
  • Loading branch information
mathetake committed Dec 11, 2024
1 parent 59c2d1d commit 3047603
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/extensions/filters/http/ratelimit/ratelimit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ void Filter::onDestroy() {
state_ = State::Complete;
client_->cancel();
} else {
// If the filter doesn't have a outstanding limit request (made during decodeHeaders) and has descriptors,
// then we can apply the rate limit on stream done if the config allows it.
// If the filter doesn't have a outstanding limit request (made during decodeHeaders) and has
// descriptors, then we can apply the rate limit on stream done if the config allows it.
if (config_->applyOnStreamDone() && !descriptors_.empty()) {
client_->cancel(); // Clears the internal state of the client, so that we can reuse it.
client_->limit(*this, getDomain(), descriptors_, Tracing::NullSpan::instance(), absl::nullopt,
Expand Down
3 changes: 2 additions & 1 deletion source/extensions/filters/http/ratelimit/ratelimit.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ class FilterConfig {
return Http::Code::InternalServerError;
}

// Thread local storage for destory pending Filter by a hash map of shared pointers.
// Only used when apply_on_stream_done_ is true to hold the pending filters to outlive the
// OnDestroy callback.
ThreadLocal::TypedSlotPtr<DestroyPendingFilterThreadLocal> pending_filter_slot_ = nullptr;

const std::string domain_;
Expand Down

0 comments on commit 3047603

Please sign in to comment.