X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=http.c;h=b5323a68b74fe16bfed55d1bf002b39296db0a60;hb=6651c3f706cc47d8055ab43f9f7907202d10655d;hp=2fc55d671e2e8c5302eaf140f5ecff0b1d701cef;hpb=2149e0f6a66cb4a5707ef6201763051d94f288af;p=git.git diff --git a/http.c b/http.c index 2fc55d671..b5323a68b 100644 --- a/http.c +++ b/http.c @@ -14,7 +14,7 @@ char curl_errorstr[CURL_ERROR_SIZE]; static int curl_ssl_verify = -1; static const char *ssl_cert; -#if LIBCURL_VERSION_NUM >= 0x070902 +#if LIBCURL_VERSION_NUM >= 0x070903 static const char *ssl_key; #endif #if LIBCURL_VERSION_NUM >= 0x070908 @@ -44,6 +44,25 @@ size_t fread_buffer(void *ptr, size_t eltsize, size_t nmemb, void *buffer_) return size; } +#ifndef NO_CURL_IOCTL +curlioerr ioctl_buffer(CURL *handle, int cmd, void *clientp) +{ + struct buffer *buffer = clientp; + + switch (cmd) { + case CURLIOCMD_NOP: + return CURLIOE_OK; + + case CURLIOCMD_RESTARTREAD: + buffer->posn = 0; + return CURLIOE_OK; + + default: + return CURLIOE_UNKNOWNCMD; + } +} +#endif + size_t fwrite_buffer(const void *ptr, size_t eltsize, size_t nmemb, void *buffer_) { size_t size = eltsize * nmemb; @@ -100,7 +119,7 @@ static int http_options(const char *var, const char *value, void *cb) } if (!strcmp("http.sslcert", var)) return git_config_string(&ssl_cert, var, value); -#if LIBCURL_VERSION_NUM >= 0x070902 +#if LIBCURL_VERSION_NUM >= 0x070903 if (!strcmp("http.sslkey", var)) return git_config_string(&ssl_key, var, value); #endif @@ -170,7 +189,7 @@ static CURL *get_curl_handle(void) if (ssl_cert != NULL) curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert); -#if LIBCURL_VERSION_NUM >= 0x070902 +#if LIBCURL_VERSION_NUM >= 0x070903 if (ssl_key != NULL) curl_easy_setopt(result, CURLOPT_SSLKEY, ssl_key); #endif @@ -284,7 +303,7 @@ void http_init(struct remote *remote) curl_ssl_verify = 0; set_from_env(&ssl_cert, "GIT_SSL_CERT"); -#if LIBCURL_VERSION_NUM >= 0x070902 +#if LIBCURL_VERSION_NUM >= 0x070903 set_from_env(&ssl_key, "GIT_SSL_KEY"); #endif #if LIBCURL_VERSION_NUM >= 0x070908