Skip to content

Commit

Permalink
Add delay for noise
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Nov 23, 2023
1 parent 5c01c8d commit a2538f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion proxy/include/proxy/proxy_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3805,6 +3805,7 @@ R"x*x*x(<html>
boost::system::error_code error;
net::socket_base::keep_alive keep_alive_opt(true);
net::ip::tcp::no_delay no_delay_opt(true);
net::ip::tcp::no_delay delay_opt(false);

auto self = shared_from_this();

Expand All @@ -3821,7 +3822,10 @@ R"x*x*x(<html>
}

socket.set_option(keep_alive_opt, error);
socket.set_option(no_delay_opt, error);
if (m_option.noise_injection_)
socket.set_option(delay_opt, error);
else
socket.set_option(no_delay_opt, error);

static std::atomic_size_t id{ 1 };
size_t connection_id = id++;
Expand Down

0 comments on commit a2538f6

Please sign in to comment.