]> git.ipfire.org Git - thirdparty/git.git/commit - daemon.c
daemon: deglobalize hostname information
authorRené Scharfe <l.s.r@web.de>
Sat, 7 Mar 2015 10:50:37 +0000 (11:50 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Mar 2015 01:18:07 +0000 (18:18 -0700)
commit01cec54e135c6c70bf6e1e197590749076e7cdfd
tree0cca367bdcb59a73f9457684d11b7be5e5cc26a6
parent7a646cec5bbcebad31a6e99f0279782b322ecd36
daemon: deglobalize hostname information

Move the variables related to the client-supplied hostname into its own
struct, let execute() own an instance of that instead of storing the
information in global variables and pass the struct to any function that
needs to access it as a parameter.

The lifetime of the variables is easier to see this way.  Allocated
memory is released within execute().  The strbufs don't have to be reset
anymore because they are written to only once at most: parse_host_arg()
is only called once by execute() and lookup_hostname() guards against
being called twice using hostname_lookup_done.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
daemon.c