Fix git+ssh's indefinite halts during long fetches
PATCH 1/1 Fix git+ssh's indefinite halts during long fetches
The problem with the old implementation is that the socket input buffers get full and then both ends halt waiting for each other. This take cares of it, by buffering at the fetching side while still trying to send. It's quite hackish but does the work (I managed to locally fetch the kernel with its ~85000 objects that sum up to 250MB).
---
commit 958b0c00525fb63276430783dccb18316cec73c9
tree 4003cf1069e9ac4bbb8aade512047dd41a466ae2
parent 60fb5b2c4d9e26204f480f8a18ae1ff0051a6440
author Dan Aloni <[email protected]> Sat, 01 Oct 2005 21:38:25 +0300 committer Dan Aloni <[email protected]> Sat, 01 Oct 2005 21:38:25 +0300
cache.h | 18 +++++++- sha1_file.c | 129 ++++++++++++++++++++++++++++++++++++++++++++++++----------- ssh-fetch.c | 76 ++++++++++++++++++++++++----------- 3 files changed, 174 insertions(+), 49 deletions(-)
cache.h +16 -2
@@ -214,8 +214,22 @@ extern int check_sha1_signature(const un/* Read a tree into the cache */ extern int read_tree (void *buffer,unsigned long size,int stage,const char **paths); -extern int write_sha1_from_fd (const unsigned char *sha1,int fd,char *buffer, -size_t bufsize,size_t *bufposn); +struct input_segment { +unsigned char *buffer; +size_t size; + +struct input_segment *next; +struct input_segment *prev; +}; + +struct input_buffer { +struct input_segment *first; +struct input_segment *last; +}; + +extern int read_input_buffers (int block,int fd_in,struct input_buffer *inputbuffer); +extern int write_sha1_from_fd (const unsigned char *sha1,int fd,struct input_buffer *inputbuffer); +extern int write_sha1_to_fd (int fd,const unsigned char *sha1);extern int has_sha1_pack (const unsigned char *sha1);
sha1_file.c +106 -23
150 lines not on this page · raw message
ssh-fetch.c +52 -24
109 lines not on this page · raw message
Signature · 2 lines
Dan Aloni [email protected], [email protected], [email protected]