]> git.proxmox.com Git - libgit2.git/blobdiff - src/netops.c
New upstream version 1.3.0+dfsg.1
[libgit2.git] / src / netops.c
index 04ae824ccca9af54ba852839eca7eb5e7745bda1..a1ee2927cd9f2b43ab87ee1529fde40d397724ff 100644 (file)
@@ -13,7 +13,7 @@
 #include "posix.h"
 #include "buffer.h"
 #include "http_parser.h"
-#include "global.h"
+#include "runtime.h"
 
 int gitno_recv(gitno_buffer *buf)
 {
@@ -61,18 +61,20 @@ void gitno_buffer_setup_fromstream(git_stream *st, gitno_buffer *buf, char *data
 }
 
 /* Consume up to ptr and move the rest of the buffer to the beginning */
-void gitno_consume(gitno_buffer *buf, const char *ptr)
+int gitno_consume(gitno_buffer *buf, const char *ptr)
 {
        size_t consumed;
 
-       assert(ptr - buf->data >= 0);
-       assert(ptr - buf->data <= (int) buf->len);
+       GIT_ASSERT(ptr - buf->data >= 0);
+       GIT_ASSERT(ptr - buf->data <= (int) buf->len);
 
        consumed = ptr - buf->data;
 
        memmove(buf->data, ptr, buf->offset - consumed);
        memset(buf->data + buf->offset, 0x0, buf->len - buf->offset);
        buf->offset -= consumed;
+
+       return 0;
 }
 
 /* Consume const bytes and move the rest of the buffer to the beginning */