]> git.tuebingen.mpg.de Git - paraslash.git/commit
client: Split client_open() and client_close().
authorAndre Noll <maan@systemlinux.org>
Sun, 4 Sep 2011 16:41:40 +0000 (18:41 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 20 Nov 2011 14:08:41 +0000 (15:08 +0100)
commit6979083be2c739e5ef66e4e6ccec991d7b2b7908
tree687bdf8f62499da5bd963f81ef2c3a95b3e0f6b3
parent8aa0f575bcca12ab63ab53141c2144448c457478
client: Split client_open() and client_close().

For interactive para_client sessions, we set up the client
configuration from the values given at the command line and in the
config file just as we do for non-interactive mode. However, in
interactive mode we must be able to execute arbitrary many client
commands using the same configuration. client_open() sets up the
configuration from the command line arguments and client_close()
destroys the configuration, so both functions do more than what is
needed in interactive mode.

This patch splits client_open() into two functions
client_parse_config() and client_connect(). The old client_open()
remains with the same semantics as before, it just calls both of the
new functions().

In the same spirit, client_close() is split into client_disconnect(),
which closes the file descriptor and deallocates the ressources of
the current command but does not free the configuration.

This allows to re-use the client configuration multiple times for
interactive sessions.
client.h
client_common.c