@matheusbsbs / matheus-bagliano / commits / 83543a24c3
Fork 0

daemon: do not die on older clients.

In the older times, the clients did not say which host they were trying to connect, and the code we recently added did not quite handle the older clients correctly. Noticed by Simon Arlott. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Oct 23, 2006 at 18:26 UTC 83543a24c316de60b886cd98272fde2bcc99d558
1 file changed +5 -1
daemon.c
+5 -1
@@ -450,6 +450,8 @@ void fill_in_extra_table_entries(struct interp *itable)
450 * Replace literal host with lowercase-ized hostname.
451 */
452 hp = interp_table[INTERP_SLOT_HOST].value;
453 + if (!hp)
454 + return;
455 for ( ; *hp; hp++)
456 *hp = tolower(*hp);
457
@@ -544,8 +546,10 @@ static int execute(struct sockaddr *addr)
546 loginfo("Extended attributes (%d bytes) exist <%.*s>",
547 (int) pktlen - len,
548 (int) pktlen - len, line + len + 1);
547 - if (len && line[len-1] == '\n')
549 + if (len && line[len-1] == '\n') {
550 line[--len] = 0;
551 + pktlen--;
552 + }
553
554 /*
555 * Initialize the path interpolation table for this connection.