diff options
author | Junio C Hamano <junkio@cox.net> | 2006-09-10 16:27:08 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-09-10 16:27:08 -0700 |
commit | d47f3db75c58139cdcbca5cc63b17bf5db293b6a (patch) | |
tree | dc46b01a0ec82e6450e841638486bbb2caeabb78 /fetch-pack.c | |
parent | 958c24b1b8f463bca857f45c41a2f8198e345c2f (diff) | |
download | git-d47f3db75c58139cdcbca5cc63b17bf5db293b6a.tar.gz |
Prepare larger packet buffer for upload-pack protocol.
The original side-band support added to the upload-pack protocol used the
default 1000-byte packet length. The pkt-line format allows up to 64k, so
prepare the receiver for the maximum size, and have the uploader and
downloader negotiate if larger packet length is allowed.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index 377feded1c..1b2d6ee20d 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -166,10 +166,11 @@ static int find_common(int fd[2], unsigned char *result_sha1, } if (!fetching) - packet_write(fd[1], "want %s%s%s%s\n", + packet_write(fd[1], "want %s%s%s%s%s\n", sha1_to_hex(remote), (multi_ack ? " multi_ack" : ""), - (use_sideband ? " side-band" : ""), + (use_sideband == 2 ? " side-band-64k" : ""), + (use_sideband == 1 ? " side-band" : ""), (use_thin_pack ? " thin-pack" : "")); else packet_write(fd[1], "want %s\n", sha1_to_hex(remote)); @@ -426,7 +427,12 @@ static int fetch_pack(int fd[2], int nr_match, char **match) fprintf(stderr, "Server supports multi_ack\n"); multi_ack = 1; } - if (server_supports("side-band")) { + if (server_supports("side-band-64k")) { + if (verbose) + fprintf(stderr, "Server supports side-band-64k\n"); + use_sideband = 2; + } + else if (server_supports("side-band")) { if (verbose) fprintf(stderr, "Server supports side-band\n"); use_sideband = 1; |