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)
commitedef953e482ce212b7d68bbe0f59e34b5552db3e
tree11e2770b73e3059ae3519aea36cbc01b43096da4
parent3c84ac86fc896c108b789b8eb26b169cc0e8088a
daemon: look up client-supplied hostname lazily

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>
daemon.c