From 5259ef3f2c05b910e6dd858c203b415e78d555dd Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 1 Jul 2016 15:04:30 +0000 Subject: [PATCH] ab: follow up to r1750854: some comments and better naming. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750955 13f79535-47bb-0310-9956-ffa450edef68 --- support/ab.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/support/ab.c b/support/ab.c index 4e18a4d161..bc2a780e22 100644 --- a/support/ab.c +++ b/support/ab.c @@ -291,7 +291,7 @@ int keepalive = 0; /* try and do keepalive connections */ int windowsize = 0; /* we use the OS default window size */ char servername[1024]; /* name that server reports */ char *hostname; /* host name from URL */ -const char *host_field; /* value of "Host:" header field */ +const char *host_field; /* value of "Host:" header field */ const char *path; /* path name */ char *postdata; /* *buffer containing data from postfile */ apr_size_t postlen = 0; /* length of data to be POSTed */ @@ -348,8 +348,8 @@ char *ssl_info = NULL; char *ssl_tmp_key = NULL; BIO *bio_out,*bio_err; #ifdef HAVE_TLSEXT -int tls_noSNI = 0; -const char *tls_host = NULL; /* opt_host if any, otherwise hostname */ +int tls_use_sni = 1; /* used by default, -I disables it */ +const char *tls_host = NULL; /* 'opt_host' if any, 'hostname' otherwise */ #endif #endif @@ -1756,9 +1756,6 @@ static void test(void) #ifdef NOT_ASCII apr_size_t inbytes_left, outbytes_left; #endif -#ifdef HAVE_TLSEXT - apr_ipsubnet_t *ip; -#endif if (isproxy) { connecthost = apr_pstrdup(cntxt, proxyhost); @@ -1801,7 +1798,8 @@ static void test(void) } #ifdef HAVE_TLSEXT - if (is_ssl && !tls_noSNI) { + apr_ipsubnet_t *ip; + if (is_ssl && tls_use_sni) { if (((tls_host = opt_host) || (tls_host = hostname)) && (!*tls_host || apr_ipsubnet_create(&ip, tls_host, NULL, cntxt) == APR_SUCCESS)) { @@ -2483,14 +2481,14 @@ int main(int argc, const char * const argv[]) } else if (strncasecmp(opt_arg, "SSL2", 4) == 0) { meth = SSLv2_client_method(); #ifdef HAVE_TLSEXT - tls_noSNI = 1; + tls_use_sni = 0; #endif #endif #ifndef OPENSSL_NO_SSL3 } else if (strncasecmp(opt_arg, "SSL3", 4) == 0) { meth = SSLv3_client_method(); #ifdef HAVE_TLSEXT - tls_noSNI = 1; + tls_use_sni = 0; #endif #endif #ifdef HAVE_TLSV1_X @@ -2530,7 +2528,7 @@ int main(int argc, const char * const argv[]) break; #ifdef HAVE_TLSEXT case 'I': - tls_noSNI = 1; + tls_use_sni = 0; break; #endif #endif -- 2.40.0