diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2018-12-27 13:47:34 -0600 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-22 22:30:35 +0000 |
| commit | f673e232afe22eb865cdc915e55a2df6493f0fbb (patch) | |
| tree | e79e3e6fb1e1d78367679aea75e66c8141b4daa8 /src/streams | |
| parent | 647dfdb42d06514a85c1499f1be88a32b8a4c24b (diff) | |
| download | libgit2-f673e232afe22eb865cdc915e55a2df6493f0fbb.tar.gz | |
git_error: use new names in internal APIs and usage
Move to the `git_error` name in the internal API for error-related
functions.
Diffstat (limited to 'src/streams')
| -rw-r--r-- | src/streams/mbedtls.c | 42 | ||||
| -rw-r--r-- | src/streams/openssl.c | 52 | ||||
| -rw-r--r-- | src/streams/registry.c | 6 | ||||
| -rw-r--r-- | src/streams/socket.c | 24 | ||||
| -rw-r--r-- | src/streams/stransport.c | 20 | ||||
| -rw-r--r-- | src/streams/tls.c | 4 |
6 files changed, 74 insertions, 74 deletions
diff --git a/src/streams/mbedtls.c b/src/streams/mbedtls.c index d22f77069..45f5b6e75 100644 --- a/src/streams/mbedtls.c +++ b/src/streams/mbedtls.c @@ -83,14 +83,14 @@ int git_mbedtls_stream_global_init(void) char *cipher_string_tmp = NULL; git__ssl_conf = git__malloc(sizeof(mbedtls_ssl_config)); - GITERR_CHECK_ALLOC(git__ssl_conf); + GIT_ERROR_CHECK_ALLOC(git__ssl_conf); mbedtls_ssl_config_init(git__ssl_conf); if (mbedtls_ssl_config_defaults(git__ssl_conf, MBEDTLS_SSL_IS_CLIENT, MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT) != 0) { - giterr_set(GITERR_SSL, "failed to initialize mbedTLS"); + git_error_set(GIT_ERROR_SSL, "failed to initialize mbedTLS"); goto cleanup; } @@ -105,14 +105,14 @@ int git_mbedtls_stream_global_init(void) /* set the list of allowed ciphersuites */ ciphers_known = 0; cipher_string = cipher_string_tmp = git__strdup(GIT_SSL_DEFAULT_CIPHERS); - GITERR_CHECK_ALLOC(cipher_string); + GIT_ERROR_CHECK_ALLOC(cipher_string); while ((cipher_name = git__strtok(&cipher_string_tmp, ":")) != NULL) { int cipherid = mbedtls_ssl_get_ciphersuite_id(cipher_name); if (cipherid == 0) continue; if (ciphers_known >= ARRAY_SIZE(ciphers_list)) { - giterr_set(GITERR_SSL, "out of cipher list space"); + git_error_set(GIT_ERROR_SSL, "out of cipher list space"); goto cleanup; } @@ -121,26 +121,26 @@ int git_mbedtls_stream_global_init(void) git__free(cipher_string); if (!ciphers_known) { - giterr_set(GITERR_SSL, "no cipher could be enabled"); + git_error_set(GIT_ERROR_SSL, "no cipher could be enabled"); goto cleanup; } mbedtls_ssl_conf_ciphersuites(git__ssl_conf, ciphers_list); /* Seeding the random number generator */ mbedtls_entropy = git__malloc(sizeof(mbedtls_entropy_context)); - GITERR_CHECK_ALLOC(mbedtls_entropy); + GIT_ERROR_CHECK_ALLOC(mbedtls_entropy); mbedtls_entropy_init(mbedtls_entropy); ctr_drbg = git__malloc(sizeof(mbedtls_ctr_drbg_context)); - GITERR_CHECK_ALLOC(ctr_drbg); + GIT_ERROR_CHECK_ALLOC(ctr_drbg); mbedtls_ctr_drbg_init(ctr_drbg); if (mbedtls_ctr_drbg_seed(ctr_drbg, mbedtls_entropy_func, mbedtls_entropy, NULL, 0) != 0) { - giterr_set(GITERR_SSL, "failed to initialize mbedTLS entropy pool"); + git_error_set(GIT_ERROR_SSL, "failed to initialize mbedTLS entropy pool"); goto cleanup; } @@ -193,16 +193,16 @@ static int ssl_set_error(mbedtls_ssl_context *ssl, int error) switch(error) { case 0: - giterr_set(GITERR_SSL, "SSL error: unknown error"); + git_error_set(GIT_ERROR_SSL, "SSL error: unknown error"); break; case MBEDTLS_ERR_X509_CERT_VERIFY_FAILED: - giterr_set(GITERR_SSL, "SSL error: %#04x [%x] - %s", error, ssl->session_negotiate->verify_result, errbuf); + git_error_set(GIT_ERROR_SSL, "SSL error: %#04x [%x] - %s", error, ssl->session_negotiate->verify_result, errbuf); ret = GIT_ECERTIFICATE; break; default: - giterr_set(GITERR_SSL, "SSL error: %#04x - %s", error, errbuf); + git_error_set(GIT_ERROR_SSL, "SSL error: %#04x - %s", error, errbuf); } return ret; @@ -228,7 +228,7 @@ static int verify_server_cert(mbedtls_ssl_context *ssl) char vrfy_buf[512]; int len = mbedtls_x509_crt_verify_info(vrfy_buf, sizeof(vrfy_buf), "", ret); if (len >= 1) vrfy_buf[len - 1] = '\0'; /* Remove trailing \n */ - giterr_set(GITERR_SSL, "the SSL certificate is invalid: %#04x - %s", ret, vrfy_buf); + git_error_set(GIT_ERROR_SSL, "the SSL certificate is invalid: %#04x - %s", ret, vrfy_buf); return GIT_ECERTIFICATE; } @@ -273,18 +273,18 @@ int mbedtls_certificate(git_cert **out, git_stream *stream) const mbedtls_x509_crt *cert = mbedtls_ssl_get_peer_cert(st->ssl); if (!cert) { - giterr_set(GITERR_SSL, "the server did not provide a certificate"); + git_error_set(GIT_ERROR_SSL, "the server did not provide a certificate"); return -1; } /* Retrieve the length of the certificate first */ if (cert->raw.len == 0) { - giterr_set(GITERR_NET, "failed to retrieve certificate information"); + git_error_set(GIT_ERROR_NET, "failed to retrieve certificate information"); return -1; } encoded_cert = git__malloc(cert->raw.len); - GITERR_CHECK_ALLOC(encoded_cert); + GIT_ERROR_CHECK_ALLOC(encoded_cert); memcpy(encoded_cert, cert->raw.p, cert->raw.len); st->cert_info.parent.cert_type = GIT_CERT_X509; @@ -369,22 +369,22 @@ static int mbedtls_stream_wrap( int error; st = git__calloc(1, sizeof(mbedtls_stream)); - GITERR_CHECK_ALLOC(st); + GIT_ERROR_CHECK_ALLOC(st); st->io = in; st->owned = owned; st->ssl = git__malloc(sizeof(mbedtls_ssl_context)); - GITERR_CHECK_ALLOC(st->ssl); + GIT_ERROR_CHECK_ALLOC(st->ssl); mbedtls_ssl_init(st->ssl); if (mbedtls_ssl_setup(st->ssl, git__ssl_conf)) { - giterr_set(GITERR_SSL, "failed to create ssl object"); + git_error_set(GIT_ERROR_SSL, "failed to create ssl object"); error = -1; goto out_err; } st->host = git__strdup(host); - GITERR_CHECK_ALLOC(st->host); + GIT_ERROR_CHECK_ALLOC(st->host); st->parent.version = GIT_STREAM_VERSION; st->parent.encrypted = 1; @@ -447,7 +447,7 @@ int git_mbedtls__set_cert_location(const char *path, int is_dir) assert(path != NULL); cacert = git__malloc(sizeof(mbedtls_x509_crt)); - GITERR_CHECK_ALLOC(cacert); + GIT_ERROR_CHECK_ALLOC(cacert); mbedtls_x509_crt_init(cacert); if (is_dir) { @@ -460,7 +460,7 @@ int git_mbedtls__set_cert_location(const char *path, int is_dir) mbedtls_x509_crt_free(cacert); git__free(cacert); mbedtls_strerror( ret, errbuf, 512 ); - giterr_set(GITERR_SSL, "failed to load CA certificates: %#04x - %s", ret, errbuf); + git_error_set(GIT_ERROR_SSL, "failed to load CA certificates: %#04x - %s", ret, errbuf); return -1; } diff --git a/src/streams/openssl.c b/src/streams/openssl.c index bc129217d..6f826ef5e 100644 --- a/src/streams/openssl.c +++ b/src/streams/openssl.c @@ -237,7 +237,7 @@ int git_openssl_stream_global_init(void) return 0; error: - giterr_set(GITERR_NET, "could not initialize openssl: %s", + git_error_set(GIT_ERROR_NET, "could not initialize openssl: %s", ERR_error_string(ERR_get_error(), NULL)); SSL_CTX_free(git__ssl_ctx); git__ssl_ctx = NULL; @@ -261,11 +261,11 @@ int git_openssl_set_locking(void) num_locks = CRYPTO_num_locks(); openssl_locks = git__calloc(num_locks, sizeof(git_mutex)); - GITERR_CHECK_ALLOC(openssl_locks); + GIT_ERROR_CHECK_ALLOC(openssl_locks); for (i = 0; i < num_locks; i++) { if (git_mutex_init(&openssl_locks[i]) != 0) { - giterr_set(GITERR_SSL, "failed to initialize openssl locks"); + git_error_set(GIT_ERROR_SSL, "failed to initialize openssl locks"); return -1; } } @@ -276,7 +276,7 @@ int git_openssl_set_locking(void) #elif !defined(OPENSSL_LEGACY_API) return 0; #else - giterr_set(GITERR_THREAD, "libgit2 was not built with threads"); + git_error_set(GIT_ERROR_THREAD, "libgit2 was not built with threads"); return -1; #endif } @@ -343,7 +343,7 @@ static int init_bio_method(void) { /* Set up the BIO_METHOD we use for wrapping our own stream implementations */ git_stream_bio_method = BIO_meth_new(BIO_TYPE_SOURCE_SINK | BIO_get_new_index(), "git_stream"); - GITERR_CHECK_ALLOC(git_stream_bio_method); + GIT_ERROR_CHECK_ALLOC(git_stream_bio_method); BIO_meth_set_write(git_stream_bio_method, bio_write); BIO_meth_set_read(git_stream_bio_method, bio_read); @@ -369,23 +369,23 @@ static int ssl_set_error(SSL *ssl, int error) switch (err) { case SSL_ERROR_WANT_CONNECT: case SSL_ERROR_WANT_ACCEPT: - giterr_set(GITERR_SSL, "SSL error: connection failure"); + git_error_set(GIT_ERROR_SSL, "SSL error: connection failure"); break; case SSL_ERROR_WANT_X509_LOOKUP: - giterr_set(GITERR_SSL, "SSL error: x509 error"); + git_error_set(GIT_ERROR_SSL, "SSL error: x509 error"); break; case SSL_ERROR_SYSCALL: e = ERR_get_error(); if (e > 0) { char errmsg[256]; ERR_error_string_n(e, errmsg, sizeof(errmsg)); - giterr_set(GITERR_NET, "SSL error: %s", errmsg); + git_error_set(GIT_ERROR_NET, "SSL error: %s", errmsg); break; } else if (error < 0) { - giterr_set(GITERR_OS, "SSL error: syscall failure"); + git_error_set(GIT_ERROR_OS, "SSL error: syscall failure"); break; } - giterr_set(GITERR_SSL, "SSL error: received early EOF"); + git_error_set(GIT_ERROR_SSL, "SSL error: received early EOF"); return GIT_EEOF; break; case SSL_ERROR_SSL: @@ -393,13 +393,13 @@ static int ssl_set_error(SSL *ssl, int error) char errmsg[256]; e = ERR_get_error(); ERR_error_string_n(e, errmsg, sizeof(errmsg)); - giterr_set(GITERR_SSL, "SSL error: %s", errmsg); + git_error_set(GIT_ERROR_SSL, "SSL error: %s", errmsg); break; } case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: default: - giterr_set(GITERR_SSL, "SSL error: unknown error"); + git_error_set(GIT_ERROR_SSL, "SSL error: unknown error"); break; } return -1; @@ -443,7 +443,7 @@ static int verify_server_cert(SSL *ssl, const char *host) int i = -1, j, error = 0; if (SSL_get_verify_result(ssl) != X509_V_OK) { - giterr_set(GITERR_SSL, "the SSL certificate is invalid"); + git_error_set(GIT_ERROR_SSL, "the SSL certificate is invalid"); return GIT_ECERTIFICATE; } @@ -462,7 +462,7 @@ static int verify_server_cert(SSL *ssl, const char *host) cert = SSL_get_peer_certificate(ssl); if (!cert) { error = -1; - giterr_set(GITERR_SSL, "the server did not provide a certificate"); + git_error_set(GIT_ERROR_SSL, "the server did not provide a certificate"); goto cleanup; } @@ -529,7 +529,7 @@ static int verify_server_cert(SSL *ssl, const char *host) if (size > 0) { peer_cn = OPENSSL_malloc(size + 1); - GITERR_CHECK_ALLOC(peer_cn); + GIT_ERROR_CHECK_ALLOC(peer_cn); memcpy(peer_cn, ASN1_STRING_get0_data(str), size); peer_cn[size] = '\0'; } else { @@ -537,7 +537,7 @@ static int verify_server_cert(SSL *ssl, const char *host) } } else { int size = ASN1_STRING_to_UTF8(&peer_cn, str); - GITERR_CHECK_ALLOC(peer_cn); + GIT_ERROR_CHECK_ALLOC(peer_cn); if (memchr(peer_cn, '\0', size)) goto cert_fail_name; } @@ -549,7 +549,7 @@ static int verify_server_cert(SSL *ssl, const char *host) cert_fail_name: error = GIT_ECERTIFICATE; - giterr_set(GITERR_SSL, "hostname does not match certificate"); + git_error_set(GIT_ERROR_SSL, "hostname does not match certificate"); goto cleanup; on_error: @@ -584,7 +584,7 @@ int openssl_connect(git_stream *stream) return ret; bio = BIO_new(git_stream_bio_method); - GITERR_CHECK_ALLOC(bio); + GIT_ERROR_CHECK_ALLOC(bio); BIO_set_data(bio, st->io); SSL_set_bio(st->ssl, bio, bio); @@ -612,19 +612,19 @@ int openssl_certificate(git_cert **out, git_stream *stream) /* Retrieve the length of the certificate first */ len = i2d_X509(cert, NULL); if (len < 0) { - giterr_set(GITERR_NET, "failed to retrieve certificate information"); + git_error_set(GIT_ERROR_NET, "failed to retrieve certificate information"); return -1; } encoded_cert = git__malloc(len); - GITERR_CHECK_ALLOC(encoded_cert); + GIT_ERROR_CHECK_ALLOC(encoded_cert); /* i2d_X509 makes 'guard' point to just after the data */ guard = encoded_cert; len = i2d_X509(cert, &guard); if (len < 0) { git__free(encoded_cert); - giterr_set(GITERR_NET, "failed to retrieve certificate information"); + git_error_set(GIT_ERROR_NET, "failed to retrieve certificate information"); return -1; } @@ -706,20 +706,20 @@ static int openssl_stream_wrap( assert(out && in && host); st = git__calloc(1, sizeof(openssl_stream)); - GITERR_CHECK_ALLOC(st); + GIT_ERROR_CHECK_ALLOC(st); st->io = in; st->owned = owned; st->ssl = SSL_new(git__ssl_ctx); if (st->ssl == NULL) { - giterr_set(GITERR_SSL, "failed to create ssl object"); + git_error_set(GIT_ERROR_SSL, "failed to create ssl object"); git__free(st); return -1; } st->host = git__strdup(host); - GITERR_CHECK_ALLOC(st->host); + GIT_ERROR_CHECK_ALLOC(st->host); st->parent.version = GIT_STREAM_VERSION; st->parent.encrypted = 1; @@ -765,7 +765,7 @@ int git_openssl__set_cert_location(const char *file, const char *path) char errmsg[256]; ERR_error_string_n(ERR_get_error(), errmsg, sizeof(errmsg)); - giterr_set(GITERR_SSL, "OpenSSL error: failed to load certificates: %s", + git_error_set(GIT_ERROR_SSL, "OpenSSL error: failed to load certificates: %s", errmsg); return -1; @@ -785,7 +785,7 @@ int git_openssl_stream_global_init(void) int git_openssl_set_locking(void) { - giterr_set(GITERR_SSL, "libgit2 was not built with OpenSSL support"); + git_error_set(GIT_ERROR_SSL, "libgit2 was not built with OpenSSL support"); return -1; } diff --git a/src/streams/registry.c b/src/streams/registry.c index 02fd3491b..b6cf489a2 100644 --- a/src/streams/registry.c +++ b/src/streams/registry.c @@ -66,7 +66,7 @@ int git_stream_registry_lookup(git_stream_registration *out, git_stream_t type) } if (git_rwlock_rdlock(&stream_registry.lock) < 0) { - giterr_set(GITERR_OS, "failed to lock stream registry"); + git_error_set(GIT_ERROR_OS, "failed to lock stream registry"); return -1; } @@ -83,10 +83,10 @@ int git_stream_register(git_stream_t type, git_stream_registration *registration { assert(!registration || registration->init); - GITERR_CHECK_VERSION(registration, GIT_STREAM_VERSION, "stream_registration"); + GIT_ERROR_CHECK_VERSION(registration, GIT_STREAM_VERSION, "stream_registration"); if (git_rwlock_wrlock(&stream_registry.lock) < 0) { - giterr_set(GITERR_OS, "failed to lock stream registry"); + git_error_set(GIT_ERROR_OS, "failed to lock stream registry"); return -1; } diff --git a/src/streams/socket.c b/src/streams/socket.c index 998e2fe87..cfd183a45 100644 --- a/src/streams/socket.c +++ b/src/streams/socket.c @@ -35,16 +35,16 @@ static void net_set_error(const char *str) char * win32_error = git_win32_get_error_message(error); if (win32_error) { - giterr_set(GITERR_NET, "%s: %s", str, win32_error); + git_error_set(GIT_ERROR_NET, "%s: %s", str, win32_error); git__free(win32_error); } else { - giterr_set(GITERR_NET, "%s", str); + git_error_set(GITERR_NET, "%s", str); } } #else static void net_set_error(const char *str) { - giterr_set(GITERR_NET, "%s: %s", str, strerror(errno)); + git_error_set(GIT_ERROR_NET, "%s: %s", str, strerror(errno)); } #endif @@ -58,7 +58,7 @@ static int close_socket(GIT_SOCKET s) return -1; if (0 != WSACleanup()) { - giterr_set(GITERR_OS, "winsock cleanup failed"); + git_error_set(GIT_ERROR_OS, "winsock cleanup failed"); return -1; } @@ -83,13 +83,13 @@ int socket_connect(git_stream *stream) WSADATA wsd; if (WSAStartup(MAKEWORD(2,2), &wsd) != 0) { - giterr_set(GITERR_OS, "winsock init failed"); + git_error_set(GIT_ERROR_OS, "winsock init failed"); return -1; } if (LOBYTE(wsd.wVersion) != 2 || HIBYTE(wsd.wVersion) != 2) { WSACleanup(); - giterr_set(GITERR_OS, "winsock init failed"); + git_error_set(GIT_ERROR_OS, "winsock init failed"); return -1; } #endif @@ -99,7 +99,7 @@ int socket_connect(git_stream *stream) hints.ai_family = AF_UNSPEC; if ((ret = p_getaddrinfo(st->host, st->port, &hints, &info)) != 0) { - giterr_set(GITERR_NET, + git_error_set(GIT_ERROR_NET, "failed to resolve address for %s: %s", st->host, p_gai_strerror(ret)); return -1; } @@ -120,7 +120,7 @@ int socket_connect(git_stream *stream) /* Oops, we couldn't connect to any address */ if (s == INVALID_SOCKET && p == NULL) { - giterr_set(GITERR_OS, "failed to connect to %s", st->host); + git_error_set(GIT_ERROR_OS, "failed to connect to %s", st->host); p_freeaddrinfo(info); return -1; } @@ -191,14 +191,14 @@ static int default_socket_stream_new( assert(out && host && port); st = git__calloc(1, sizeof(git_socket_stream)); - GITERR_CHECK_ALLOC(st); + GIT_ERROR_CHECK_ALLOC(st); st->host = git__strdup(host); - GITERR_CHECK_ALLOC(st->host); + GIT_ERROR_CHECK_ALLOC(st->host); if (port) { st->port = git__strdup(port); - GITERR_CHECK_ALLOC(st->port); + GIT_ERROR_CHECK_ALLOC(st->port); } st->parent.version = GIT_STREAM_VERSION; @@ -232,7 +232,7 @@ int git_socket_stream_new( return error; if (!init) { - giterr_set(GITERR_NET, "there is no socket stream available"); + git_error_set(GIT_ERROR_NET, "there is no socket stream available"); return -1; } diff --git a/src/streams/stransport.c b/src/streams/stransport.c index 6626e0f68..da1156ca3 100644 --- a/src/streams/stransport.c +++ b/src/streams/stransport.c @@ -22,18 +22,18 @@ static int stransport_error(OSStatus ret) CFStringRef message; if (ret == noErr || ret == errSSLClosedGraceful) { - giterr_clear(); + git_error_clear(); return 0; } #if !TARGET_OS_IPHONE message = SecCopyErrorMessageString(ret, NULL); - GITERR_CHECK_ALLOC(message); + GIT_ERROR_CHECK_ALLOC(message); - giterr_set(GITERR_NET, "SecureTransport error: %s", CFStringGetCStringPtr(message, kCFStringEncodingUTF8)); + git_error_set(GIT_ERROR_NET, "SecureTransport error: %s", CFStringGetCStringPtr(message, kCFStringEncodingUTF8)); CFRelease(message); #else - giterr_set(GITERR_NET, "SecureTransport error: OSStatus %d", (unsigned int)ret); + git_error_set(GIT_ERROR_NET, "SecureTransport error: OSStatus %d", (unsigned int)ret); GIT_UNUSED(message); #endif @@ -62,7 +62,7 @@ static int stransport_connect(git_stream *stream) ret = SSLHandshake(st->ctx); if (ret != errSSLServerAuthCompleted) { - giterr_set(GITERR_SSL, "unexpected return value from ssl handshake %d", (int)ret); + git_error_set(GIT_ERROR_SSL, "unexpected return value from ssl handshake %d", (int)ret); return -1; } @@ -78,13 +78,13 @@ static int stransport_connect(git_stream *stream) CFRelease(trust); if (sec_res == kSecTrustResultInvalid || sec_res == kSecTrustResultOtherError) { - giterr_set(GITERR_SSL, "internal security trust error"); + git_error_set(GIT_ERROR_SSL, "internal security trust error"); return -1; } if (sec_res == kSecTrustResultDeny || sec_res == kSecTrustResultRecoverableTrustFailure || sec_res == kSecTrustResultFatalTrustFailure) { - giterr_set(GITERR_SSL, "untrusted connection error"); + git_error_set(GIT_ERROR_SSL, "untrusted connection error"); return GIT_ECERTIFICATE; } @@ -112,7 +112,7 @@ static int stransport_certificate(git_cert **out, git_stream *stream) CFRelease(trust); if (st->der_data == NULL) { - giterr_set(GITERR_SSL, "retrieved invalid certificate data"); + git_error_set(GIT_ERROR_SSL, "retrieved invalid certificate data"); return -1; } @@ -254,14 +254,14 @@ static int stransport_wrap( assert(out && in && host); st = git__calloc(1, sizeof(stransport_stream)); - GITERR_CHECK_ALLOC(st); + GIT_ERROR_CHECK_ALLOC(st); st->io = in; st->owned = owned; st->ctx = SSLCreateContext(NULL, kSSLClientSide, kSSLStreamType); if (!st->ctx) { - giterr_set(GITERR_NET, "failed to create SSL context"); + git_error_set(GIT_ERROR_NET, "failed to create SSL context"); git__free(st); return -1; } diff --git a/src/streams/tls.c b/src/streams/tls.c index 0ea47fb2f..6a251717b 100644 --- a/src/streams/tls.c +++ b/src/streams/tls.c @@ -38,7 +38,7 @@ int git_tls_stream_new(git_stream **out, const char *host, const char *port) } if (!init) { - giterr_set(GITERR_SSL, "there is no TLS stream available"); + git_error_set(GIT_ERROR_SSL, "there is no TLS stream available"); return -1; } @@ -65,7 +65,7 @@ int git_tls_stream_wrap(git_stream **out, git_stream *in, const char *host) } if (!wrap) { - giterr_set(GITERR_SSL, "there is no TLS stream available"); + git_error_set(GIT_ERROR_SSL, "there is no TLS stream available"); return -1; } |
