Skip to content

Commit

Permalink
Improve http get rate limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Sep 4, 2024
1 parent 52f85f3 commit 3779384
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion proxy/include/proxy/proxy_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4235,7 +4235,10 @@ R"x*x*x(<html>
co_return;
}

const auto buf_size = 5 * 1024 * 1024;
auto buf_size = 5 * 1024 * 1024;
if (m_option.tcp_rate_limit_ > 0 && m_option.tcp_rate_limit_ < buf_size)
buf_size = m_option.tcp_rate_limit_;

auto bufs = std::make_unique<char[]>(buf_size);
char* buf = bufs.get();
std::streamsize total = 0;
Expand Down

0 comments on commit 3779384

Please sign in to comment.