diff options
| author | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-05-01 00:05:25 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-05-19 17:50:52 +0200 |
| commit | 66024c7cbcbae3a75d0b0426993d8ee5fa5f9dfb (patch) | |
| tree | 942b12533fe7f158679c0a2a3692494be849a855 /src/netops.h | |
| parent | ad5df35a47d56c3d716d7a56eac4aeb611987c11 (diff) | |
| download | libgit2-66024c7cbcbae3a75d0b0426993d8ee5fa5f9dfb.tar.gz | |
http: add https support when GnuTLS is available
If it's not available, an error saying so will be returned when trying
to use a https:// URL.
This also unifies a lot of the network code to use git_transport in
many places instead of an socket descriptor.
Diffstat (limited to 'src/netops.h')
| -rw-r--r-- | src/netops.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/netops.h b/src/netops.h index 9d13f3891..9401ac2a9 100644 --- a/src/netops.h +++ b/src/netops.h @@ -8,21 +8,29 @@ #define INCLUDE_netops_h__ #include "posix.h" +#include "transport.h" +#ifdef GIT_GNUTLS +# include <gnutls/gnutls.h> +#endif typedef struct gitno_buffer { char *data; size_t len; size_t offset; GIT_SOCKET fd; +#ifdef GIT_GNUTLS + struct gitno_ssl *ssl; +#endif } gitno_buffer; -void gitno_buffer_setup(gitno_buffer *buf, char *data, unsigned int len, GIT_SOCKET fd); +void gitno_buffer_setup(git_transport *t, gitno_buffer *buf, char *data, unsigned int len); 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); -int gitno_connect(GIT_SOCKET *s, const char *host, const char *port); -int gitno_send(GIT_SOCKET s, const char *msg, size_t len, int flags); +GIT_SOCKET gitno_connect(git_transport *t, const char *host, const char *port); +int gitno_send(git_transport *t, const char *msg, size_t len, int flags); int gitno_close(GIT_SOCKET s); int gitno_send_chunk_size(int s, size_t len); int gitno_select_in(gitno_buffer *buf, long int sec, long int usec); |
