]> git.tuebingen.mpg.de Git - paraslash.git/commit
03_TCP-socket-functions.diff
authorGerrit Renker <gerrit@erg.abdn.ac.uk>
Fri, 30 Nov 2007 09:23:51 +0000 (10:23 +0100)
committerAndre Noll <maan@systemlinux.org>
Fri, 30 Nov 2007 09:23:51 +0000 (10:23 +0100)
commitd2e164526bed7f523043b7e4ec5bd282d5bc6f19
tree76b04b1ae8aaaa51444714d22e67183c4e16ac7d
parent7f9340341574044e16e1ffc30f856f13d1e3ba6c
03_TCP-socket-functions.diff

This converts the control connection and the HTTP streaming module to use the makesock() interface.

The specific changes are:
 * replace tcp_connect() directly with makesock();
 * replace tcp_listen() with para_listen() (in turn a wrapper around makesock());
 * init_sockaddr() becomes obsolete;
 * replaced use of sockaddr_in in para_accept() with NULL sockaddr argument
  -- the `remote' name of the socket is always available via getpeername(2),
-- this is exploited by replacing the reverse-name lookup with remote_name();
 * the sockaddr_in field `addr' of `struct http_client' has been replaced with `name' string
  -- name is filled in as in para_accept() above, using remote_name(),
-- unlike above, the remote_fd() call can later not be done, due to close_listed_fds().

The one thing I am really not sure about is host_in_access_perm_list():
 * It needed to be converted to allow address-independent HTTP streaming.
 * The conversion represents the obvious choice for doing this.
 * However, I have not (yet) tested it.
 * A problem that may arise is that when listening using AF_UNSPEC then _all_ addresses appear
   as IPv6 addresses (i.e. the test "family == AF_INET" would never hold true). In this case,
   a possible solution is to switch between AF_UNSPEC and AF_INET dependint on whether the
   configurable access-list is empty or non-empty, respectively.
 * A possible place for this chance would be http_send_init() or any other function calling
   open_tcp_port().

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
client_common.c
command.c
http_recv.c
http_send.c
net.c
net.h
server.c
server.h