Refactor git_tcp_connect() functions a little.

Add client side sending of "\0host=%s\0" extended
arg for git native protocol, backwards compatibly.

Signed-off-by: Jon Loeliger <jdl@jdl.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Jon Loeliger
2006-06-06 22:58:41 -05:00
committed by Junio C Hamano
parent 9941afc051
commit 5ad312bede
2 changed files with 50 additions and 21 deletions

View File

@ -267,12 +267,17 @@ static int upload(char *dir)
static int execute(void)
{
static char line[1000];
int len;
int pktlen, len;
alarm(init_timeout ? init_timeout : timeout);
len = packet_read_line(0, line, sizeof(line));
pktlen = packet_read_line(0, line, sizeof(line));
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;