1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

fix compiler warning: variable "sni" was set but never used

This commit is contained in:
Yang Tse 2009-09-24 13:24:08 +00:00
parent f03130a36e
commit 37489a855f

View File

@ -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;
}