diff options
author | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-07-24 21:03:22 +0400 |
---|---|---|
committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-07-30 22:28:16 +0400 |
commit | b49c8f71aef574ce6606282a498627f5106220d5 (patch) | |
tree | b4a9d07716c80b48e68f36d8fb3fb6c142447ac6 /src/netops.h | |
parent | 114dc6e14c47ff574b4c97d4519782de3f9d28b2 (diff) |
remote: use the same code to control git and http
This allows us to add capabilitites to both at the same time, keeps
them in sync and removes a lot of code.
gitno_buffer now uses a callback to fill its buffer, allowing us to
use the same interface for git and http (which uses callbacks).
Diffstat (limited to 'src/netops.h')
-rw-r--r-- | src/netops.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/netops.h b/src/netops.h index e2c2b8171..dded55b63 100644 --- a/src/netops.h +++ b/src/netops.h @@ -18,10 +18,14 @@ struct gitno_buffer { #ifdef GIT_SSL struct gitno_ssl *ssl; #endif + int (*recv)(gitno_buffer *buffer); + void *cb_data; }; void gitno_buffer_setup(git_transport *t, gitno_buffer *buf, char *data, unsigned int len); +void gitno_buffer_setup_callback(git_transport *t, gitno_buffer *buf, char *data, unsigned int len, int (*recv)(gitno_buffer *buf), void *cb_data); int gitno_recv(gitno_buffer *buf); +int gitno__recv(gitno_buffer *buf); void gitno_consume(gitno_buffer *buf, const char *ptr); void gitno_consume_n(gitno_buffer *buf, size_t cons); |