summaryrefslogtreecommitdiff
path: root/src/netops.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-10-19 19:23:32 -0700
committerBen Straub <bs@github.com>2012-10-19 19:36:23 -0700
commit7bcd9e23e8f64c8622e9213ee0fa3d75d058053b (patch)
tree42d73408bb7e3df8d487d38ecfaf0efb9c0531c6 /src/netops.c
parent25e8b20169a6f6919ad49cf32220975ab96b35c8 (diff)
downloadlibgit2-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.c3
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;