diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-02-14 00:39:15 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-14 00:39:15 +0300 |
commit | 1772ad1125a6f8a5473d73bbd17162bb20ebd825 (patch) | |
tree | e81a50d72e3ad6a41c5a2995a0ad126560d2c417 /daemon.c | |
parent | 0f57f731ea2a540a4c82b476054e8a36aebb2314 (diff) | |
parent | ed15e58efefc7f9dc1281860289e48e8f9c9b8fa (diff) |
Merge branch 'jk/daemon-fixes'
Assorted fixes to "git daemon".
* jk/daemon-fixes:
daemon: fix length computation in newline stripping
t/lib-git-daemon: add network-protocol helpers
daemon: handle NULs in extended attribute string
daemon: fix off-by-one in logging extended attributes
t/lib-git-daemon: record daemon log
t5570: use ls-remote instead of clone for interp tests
Diffstat (limited to 'daemon.c')
-rw-r--r-- | daemon.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -597,6 +597,7 @@ static char *parse_host_arg(struct hostinfo *hi, char *extra_args, int buflen) if (strncasecmp("host=", extra_args, 5) == 0) { val = extra_args + 5; vallen = strlen(val) + 1; + loginfo("Extended attribute \"host\": %s", val); if (*val) { /* Split <host>:<port> at colon. */ char *host; @@ -647,9 +648,11 @@ static void parse_extra_args(struct hostinfo *hi, struct argv_array *env, } } - if (git_protocol.len > 0) + if (git_protocol.len > 0) { + loginfo("Extended attribute \"protocol\": %s", git_protocol.buf); argv_array_pushf(env, GIT_PROTOCOL_ENVIRONMENT "=%s", git_protocol.buf); + } strbuf_release(&git_protocol); } @@ -757,14 +760,8 @@ static int execute(void) alarm(0); len = strlen(line); - if (pktlen != len) - loginfo("Extended attributes (%d bytes) exist <%.*s>", - (int) pktlen - len, - (int) pktlen - len, line + len + 1); - if (len && line[len-1] == '\n') { - line[--len] = 0; - pktlen--; - } + if (len && line[len-1] == '\n') + line[len-1] = 0; /* parse additional args hidden behind a NUL byte */ if (len != pktlen) |