summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/ab.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/support/ab.c b/support/ab.c
index 03face7d24..a6c03de672 100644
--- a/support/ab.c
+++ b/support/ab.c
@@ -545,11 +545,11 @@ static int ssl_print_cert_info(BIO *bio, X509 *x509cert)
EVP_PKEY_bits(X509_get_pubkey(x509cert)));
dn=X509_get_issuer_name(x509cert);
- X509_NAME_oneline(dn, buf, BUFSIZ);
+ X509_NAME_oneline(dn, buf, sizeof buf);
BIO_printf(bio,"The issuer name is %s\n", buf);
dn=X509_get_subject_name(x509cert);
- X509_NAME_oneline(dn, buf, BUFSIZ);
+ X509_NAME_oneline(dn, buf, sizeof buf);
BIO_printf(bio,"The subject name is %s\n", buf);
/* dump the extension list too */
@@ -665,7 +665,6 @@ static void ssl_start_connect(struct connection * c)
x509cert = (X509 *)sk_X509_value(sk,i);
#endif
ssl_print_cert_info(bio_out,x509cert);
- X509_free(x509cert);
}
}
@@ -1562,9 +1561,9 @@ static void test(void)
now = apr_time_now();
- con = calloc(concurrency * sizeof(struct connection), 1);
+ con = calloc(concurrency, sizeof(struct connection));
- stats = calloc(requests * sizeof(struct data), 1);
+ stats = calloc(requests, sizeof(struct data));
if ((status = apr_pollset_create(&readbits, concurrency, cntxt, 0)) != APR_SUCCESS) {
apr_err("apr_pollset_create failed", status);
@@ -2174,6 +2173,12 @@ int main(int argc, const char * const argv[])
usage(argv[0]);
}
+ if (concurrency > requests) {
+ fprintf(stderr, "%s: Cannot use concurrency level greater than "
+ "total number of requests\n", argv[0]);
+ usage(argv[0]);
+ }
+
if ((heartbeatres) && (requests > 150)) {
heartbeatres = requests / 10; /* Print line every 10% of requests */
if (heartbeatres < 100)