Merge branch 'rs/daemon-interpolate' into maint
authorJunio C Hamano <gitster@pobox.com>
Sat, 14 Mar 2015 05:56:00 +0000 (22:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 14 Mar 2015 05:56:01 +0000 (22:56 -0700)
"git daemon" looked up the hostname even when "%CH" and "%IP"
interpolations are not requested, which was unnecessary.

* rs/daemon-interpolate:
daemon: use callback to build interpolated path
daemon: look up client-supplied hostname lazily

1  2 
daemon.c
diff --cc daemon.c
index 26d5f326e468ea051bf6006f1a69bc7a4b21eaf1,df9768fecc490b681449bdaff17bacb78d257f8c..c3edd960ec5bf686b66fa55dcfea712e455fe772
+++ b/daemon.c
@@@ -544,10 -577,11 +596,11 @@@ static void parse_host_arg(char *extra_
                                parse_host_and_port(val, &host, &port);
                                if (port) {
                                        free(tcp_port);
 -                                      tcp_port = xstrdup(port);
 +                                      tcp_port = sanitize_client(port);
                                }
                                free(hostname);
 -                              hostname = xstrdup_tolower(host);
 +                              hostname = canonicalize_client(host);
+                               hostname_lookup_done = 0;
                        }
  
                        /* On to the next one */