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

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants
@flygoast

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

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);

This comment has been minimized.

@rakshasa

rakshasa Mar 9, 2014

Owner

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

@rakshasa

rakshasa Mar 9, 2014

Owner

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

This comment has been minimized.

@flygoast

flygoast Mar 9, 2014

SOMAXCONN may be a better choice?

@flygoast

flygoast Mar 9, 2014

SOMAXCONN may be a better choice?

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))

This comment has been minimized.

@rakshasa

rakshasa Mar 9, 2014

Owner

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

@rakshasa

rakshasa Mar 9, 2014

Owner

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

src/main.cc
@@ -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");

This comment has been minimized.

@rakshasa

rakshasa Mar 9, 2014

Owner

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

@rakshasa

rakshasa Mar 9, 2014

Owner

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

@rakshasa

This comment has been minimized.

Show comment
Hide comment
@rakshasa

rakshasa Mar 25, 2014

Owner

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

Owner

rakshasa commented Mar 25, 2014

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