daemon: look up client-supplied hostname lazily
authorRené Scharfe <l.s.r@web.de>
Sun, 15 Feb 2015 18:31:41 +0000 (19:31 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Feb 2015 21:40:36 +0000 (13:40 -0800)
Look up canonical hostname and IP address using getaddrinfo(3) or
gethostbyname(3) only if --interpolated-path or --access-hook were
specified.

Do that by introducing getter functions for canon_hostname and
ip_address and using them for all read accesses. These wrappers call
the new helper lookup_hostname(), which sets the variables only at its
first call.

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