]> git.tuebingen.mpg.de Git - paraslash.git/commit - m4/lls/server.suite.m4
server: Implement --listen-address for control service.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 7 Mar 2018 11:32:15 +0000 (12:32 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 17 Apr 2018 07:29:57 +0000 (09:29 +0200)
commit631fb4db2cea7bc44e91631957db8cd852fe75ee
tree134191b893e818746575c87b3c6f49f409a99915
parentb6e25b286c553ac1f971f3c8e0a736f9e731d2b7
server: Implement --listen-address for control service.

For hosts with multiple IP addresses one might want to configure the
listening sockets so that connections can only arrive on a subset of
the host's addresses. This patch implements this feature.

Unlike para_listen_simple() the new para_listen() receives an optional
argument to let the caller specify the listening address in addition
to the port number. para_listen_simple() is now a simple wrapper
that passes a NULL pointer as the new argument which indicates that
the socket should listen on all local addresses, just like prior to
this change.

The set of listening addresses for the control service of para_server
can be specified via the new --listen-address option. This option
can be given multiple times, once for each listening address.

Due to this change the server needs to maintain more than a single
file descriptor to dispatch incoming connections. Hence the integer
->listen_fd of struct server_command_task has to be replaced by an
array of file descriptors and the {pre,post}_select methods of the
command task have iterate over all descriptors in the array.

The meaning of the --port option has changed due to the new option:
since the argument to --listen-address can also contain a port number,
the argument to --port is only used for addresses with no port number,
or if --listen-address is not given at all.

Although the http and dccp senders also open a listening socket, this
commit affects only the control service of para_server (listening on
TCP 2990 by default). Senders will be covered in the next commit.
m4/lls/server.suite.m4
net.c
net.h
server.c