Skip to content

Commit

Permalink
Use ResetsRateLimitFilter to rate limit resets
Browse files Browse the repository at this point in the history
Summary: We're going to rate limit resets separately from other kinds of control messages.

Reviewed By: afrind

Differential Revision: D50751362

fbshipit-source-id: 5fdbe215d664bf952a0bb00f8de808ef5ea39329
  • Loading branch information
Aman Sharma authored and facebook-github-bot committed Nov 6, 2023
1 parent 7591428 commit 6cae3cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 0 additions & 7 deletions proxygen/lib/http/codec/ControlMessageRateLimitFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ class ControlMessageRateLimitFilter : public RateLimitFilter {
timeoutDuration_ = kDefaultTimeoutDuration;
}

void onAbort(HTTPCodec::StreamID streamID, ErrorCode code) override {
if (!incrementNumEventsInCurrentInterval()) {
callback_->onAbort(streamID, code);
} else {
sendErrorCallback(http2::FrameType::RST_STREAM);
}
}
void onPingRequest(uint64_t data) override {
if (!incrementNumEventsInCurrentInterval()) {
callback_->onPingRequest(data);
Expand Down
2 changes: 2 additions & 0 deletions proxygen/lib/http/session/HTTPSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <proxygen/lib/http/codec/HTTP2Codec.h>
#include <proxygen/lib/http/codec/HTTPChecks.h>
#include <proxygen/lib/http/codec/HeadersRateLimitFilter.h>
#include <proxygen/lib/http/codec/ResetsRateLimitFilter.h>
#include <proxygen/lib/http/session/HTTPSessionController.h>
#include <proxygen/lib/http/session/HTTPSessionStats.h>
#include <wangle/acceptor/ConnectionManager.h>
Expand Down Expand Up @@ -228,6 +229,7 @@ void HTTPSession::setupCodec() {
addRateLimitFilter(RateLimitFilter::Type::HEADERS);
addRateLimitFilter(RateLimitFilter::Type::DIRECT_ERROR_HANDLING);
addRateLimitFilter(RateLimitFilter::Type::MISC_CONTROL_MSGS);
addRateLimitFilter(RateLimitFilter::Type::RSTS);
}

codec_.setCallback(this);
Expand Down

0 comments on commit 6cae3cd

Please sign in to comment.