aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-09-24 13:24:08 +0000
committerYang Tse <yangsita@gmail.com>2009-09-24 13:24:08 +0000
commit37489a855f6d7bb159ab6d12588b924c4939afe4 (patch)
tree9554b0a61797faa2200b77481b628690be2dd9d5
parentf03130a36eac4fbd1643942f4fc4c41a31c356cb (diff)
fix compiler warning: variable "sni" was set but never used
-rw-r--r--lib/ssluse.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/ssluse.c b/lib/ssluse.c
index c0c1ee6de..8d4490fa6 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -1353,6 +1353,12 @@ static void ssl_tls_trace(int direction, int ssl_ver, int content_type,
#ifdef USE_SSLEAY
/* ====================================================== */
+#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+# define use_sni(x) sni = (x)
+#else
+# define use_sni(x) do { } while (0)
+#endif
+
static CURLcode
ossl_connect_step1(struct connectdata *conn,
int sockindex)
@@ -1365,8 +1371,8 @@ ossl_connect_step1(struct connectdata *conn,
X509_LOOKUP *lookup=NULL;
curl_socket_t sockfd = conn->sock[sockindex];
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- bool sni = TRUE; /* default is SNI enabled */
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+ bool sni;
#ifdef ENABLE_IPV6
struct in6_addr addr;
#else
@@ -1385,17 +1391,19 @@ ossl_connect_step1(struct connectdata *conn,
case CURL_SSLVERSION_DEFAULT:
/* we try to figure out version */
req_method = SSLv23_client_method();
+ use_sni(TRUE);
break;
case CURL_SSLVERSION_TLSv1:
req_method = TLSv1_client_method();
+ use_sni(TRUE);
break;
case CURL_SSLVERSION_SSLv2:
req_method = SSLv2_client_method();
- sni = FALSE;
+ use_sni(FALSE);
break;
case CURL_SSLVERSION_SSLv3:
req_method = SSLv3_client_method();
- sni = FALSE;
+ use_sni(FALSE);
break;
}