Skip to content

Commit

Permalink
daemon: do not die on older clients.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Oct 24, 2006
1 parent 67aef03 commit 83543a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ void fill_in_extra_table_entries(struct interp *itable)
* Replace literal host with lowercase-ized hostname.
*/
hp = interp_table[INTERP_SLOT_HOST].value;
if (!hp)
return;
for ( ; *hp; hp++)
*hp = tolower(*hp);

Expand Down Expand Up @@ -544,8 +546,10 @@ static int execute(struct sockaddr *addr)
loginfo("Extended attributes (%d bytes) exist <%.*s>",
(int) pktlen - len,
(int) pktlen - len, line + len + 1);
if (len && line[len-1] == '\n')
if (len && line[len-1] == '\n') {
line[--len] = 0;
pktlen--;
}

/*
* Initialize the path interpolation table for this connection.
Expand Down

0 comments on commit 83543a2

Please sign in to comment.