diff options
author | Ben Straub <bs@github.com> | 2012-10-19 19:23:32 -0700 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-10-19 19:36:23 -0700 |
commit | 7bcd9e23e8f64c8622e9213ee0fa3d75d058053b (patch) | |
tree | 42d73408bb7e3df8d487d38ecfaf0efb9c0531c6 /src/netops.c | |
parent | 25e8b20169a6f6919ad49cf32220975ab96b35c8 (diff) | |
download | libgit2-7bcd9e23e8f64c8622e9213ee0fa3d75d058053b.tar.gz |
gitno_buffer: callback on each packet
The fetch code takes advantage of this to implement a
progress callback every 100kb of transfer.
Diffstat (limited to 'src/netops.c')
-rw-r--r-- | src/netops.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/netops.c b/src/netops.c index df502e619..d9663e63c 100644 --- a/src/netops.c +++ b/src/netops.c @@ -117,6 +117,7 @@ static int gitno__recv_ssl(gitno_buffer *buf) } buf->offset += ret; + if (buf->packetsize_cb) buf->packetsize_cb(ret, buf->packetsize_payload); return ret; } #endif @@ -132,6 +133,7 @@ int gitno__recv(gitno_buffer *buf) } buf->offset += ret; + if (buf->packetsize_cb) buf->packetsize_cb(ret, buf->packetsize_payload); return ret; } @@ -142,7 +144,6 @@ void gitno_buffer_setup_callback( size_t len, int (*recv)(gitno_buffer *buf), void *cb_data) { - memset(buf, 0x0, sizeof(gitno_buffer)); memset(data, 0x0, len); buf->data = data; buf->len = len; |