Commit 0048372a9a631b9646b97f42eb8a61ba59dd3d99

Carlos Martín Nieto 2012-07-27T01:09:06

transport: rename encrypt to use_ssl SSL isn't the only way that a transport can be encrypted. The new name will make it easier to merge the SSH support.

diff --git a/src/netops.c b/src/netops.c
index 303dfe8..72c1757 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -114,7 +114,7 @@ void gitno_buffer_setup_callback(git_transport *t, gitno_buffer *buf, char *data
 void gitno_buffer_setup(git_transport *t, gitno_buffer *buf, char *data, unsigned int len)
 {
 #ifdef GIT_SSL
-	if (t->encrypt) {
+	if (t->use_ssl) {
 		gitno_buffer_setup_callback(t, buf, data, len, gitno__recv_ssl, NULL);
 		buf->ssl = &t->ssl;
 	} else
@@ -151,7 +151,7 @@ int gitno_ssl_teardown(git_transport *t)
 	int ret;
 #endif
 
-	if (!t->encrypt)
+	if (!t->use_ssl)
 		return 0;
 
 #ifdef GIT_SSL
@@ -419,7 +419,7 @@ int gitno_connect(git_transport *t, const char *host, const char *port)
 	t->socket = s;
 	p_freeaddrinfo(info);
 
-	if (t->encrypt && ssl_setup(t, host) < 0)
+	if (t->use_ssl && ssl_setup(t, host) < 0)
 		return -1;
 
 	return 0;
@@ -449,7 +449,7 @@ int gitno_send(git_transport *t, const char *msg, size_t len, int flags)
 	size_t off = 0;
 
 #ifdef GIT_SSL
-	if (t->encrypt)
+	if (t->use_ssl)
 		return send_ssl(&t->ssl, msg, len);
 #endif
 
diff --git a/src/transport.h b/src/transport.h
index bb0b041..c430616 100644
--- a/src/transport.h
+++ b/src/transport.h
@@ -73,7 +73,7 @@ struct git_transport {
 	int direction : 1, /* 0 fetch, 1 push */
 		connected : 1,
 		check_cert: 1,
-		encrypt : 1,
+		use_ssl : 1,
 		own_logic: 1, /* transitional */
 		rpc: 1; /* git-speak for the HTTP transport */
 #ifdef GIT_SSL
diff --git a/src/transports/http.c b/src/transports/http.c
index c29ed9a..85fec41 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -450,7 +450,7 @@ int git_transport_https(git_transport **out)
 	if (git_transport_http((git_transport **)&t) < 0)
 		return -1;
 
-	t->parent.encrypt = 1;
+	t->parent.use_ssl = 1;
 	t->parent.check_cert = 1;
 	*out = (git_transport *) t;