Skip to content

make listen backlog argument can be configured in rtorrent.rc #178

Closed
wants to merge 3 commits into from

2 participants

@flygoast

make listen backlog argument can be configured in rtorrent.rc.

@rakshasa rakshasa and 1 other commented on an outdated diff Mar 9, 2014
src/command_network.cc
@@ -246,6 +246,7 @@
CMD2_VAR_BOOL ("network.port_open", true);
CMD2_VAR_BOOL ("network.port_random", true);
CMD2_VAR_STRING ("network.port_range", "6881-6999");
+ CMD2_VAR_VALUE ("network.listen_backlog", 511);
@rakshasa
Owner
rakshasa added a note Mar 9, 2014

This should use . and not _, in addition the 511 default value seems strange. Instead use 200 or something.

@flygoast
flygoast added a note Mar 9, 2014

SOMAXCONN may be a better choice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@rakshasa rakshasa commented on an outdated diff Mar 9, 2014
src/core/manager.cc
@@ -198,15 +198,20 @@
if (portFirst > portLast || portLast >= (1 << 16))
throw torrent::input_error("Invalid port range.");
+ int64_t backlog = rpc::call_command_value("network.listen_backlog");
+
+ if (backlog < 0 || backlog >= (1 << 31))
@rakshasa
Owner
rakshasa added a note Mar 9, 2014

This check isn't needed here, and don't do casting to 'int' below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@rakshasa rakshasa commented on an outdated diff Mar 9, 2014
@@ -546,6 +547,9 @@ void do_nothing_str(const std::string&) {}
CMD2_REDIRECT ("get_port_range", "network.port_range");
CMD2_REDIRECT_GENERIC("set_port_range", "network.port_range.set");
+ CMD2_REDIRECT ("get_listen_backlog", "network.listen_backlog");
@rakshasa
Owner
rakshasa added a note Mar 9, 2014

This section is for obsoleted commands, don't add these redirects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@rakshasa
Owner

Reimplemented with the variable stored in the proper way, use 'network.listen.backlog.set' to use.

@rakshasa rakshasa closed this Mar 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.