Skip to content

Commit

Permalink
Fatal error if no udp threads but using quic
Browse files Browse the repository at this point in the history
If proxy.config.http.server_ports contains an entry to allow quic
connections on a given port but there no udp threads ATS used to
silently ignore these connections.

Given that this configuration isn't valid we raise a fatal error.
  • Loading branch information
mattyw committed Aug 13, 2024
1 parent 8a2ec69 commit 293ec8b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/traffic_server/traffic_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,15 @@ main(int /* argc ATS_UNUSED */, const char **argv)
REC_ReadConfigInteger(num_of_udp_threads, "proxy.config.udp.threads");
}

ats_scoped_str server_ports(255);
*server_ports = '\0';
REC_ReadConfigString(server_ports, "proxy.config.http.server_ports", 255);
bool quic_server_port = strstr(server_ports, "/quic/") != server_ports;

if (quic_server_port && num_of_udp_threads == 0) {
Fatal("proxy.config.http.server_ports listening for quic but proxy.config.udp.threads is 0");
}

udpNet.register_event_type();
if (num_of_udp_threads) {
udpNet.start(num_of_udp_threads, stacksize);
Expand Down

0 comments on commit 293ec8b

Please sign in to comment.