Update to HEAD's ab which seems to be slightly less utterly borked than 2.0's. Upstream-HEAD: committed Upstream-2.0: needed Upstream-Status: Simple backport of changes from HEAD --- httpd-2.0.50/support/ab.c.abench +++ httpd-2.0.50/support/ab.c @@ -60,9 +60,9 @@ ** Version 2.0.36-dev ** Improvements to concurrent processing: ** - Enabled non-blocking connect()s. - ** - Prevent blocking calls to apr_recv() (thereby allowing AB to + ** - Prevent blocking calls to apr_socket_recv() (thereby allowing AB to ** manage its entire set of socket descriptors). - ** - Any error returned from apr_recv() that is not EAGAIN or EOF + ** - Any error returned from apr_socket_recv() that is not EAGAIN or EOF ** is now treated as fatal. ** Contributed by Aaron Bannert, April 24, 2002 ** @@ -142,9 +142,30 @@ #endif #if APR_HAVE_STDLIB_H #include <stdlib.h> +#endif +#if APR_HAVE_UNISTD_H +#include <unistd.h> /* for getpid() */ +#endif + +#if !defined(WIN32) && !defined(NETWARE) +#include "ap_config_auto.h" +#endif + +#if defined(HAVE_SSLC) + +/* Libraries for RSA SSL-C */ +#include <rsa.h> +#include <x509.h> +#include <pem.h> +#include <err.h> +#include <ssl.h> +#include <r_rand.h> +#include <sslc.h> +#define USE_SSL +#define RSAREF + +#elif defined(HAVE_OPENSSL) -#ifdef USE_SSL -#if ((!(RSAREF)) && (!(SYSSSL))) /* Libraries on most systems.. */ #include <openssl/rsa.h> #include <openssl/crypto.h> @@ -153,20 +174,11 @@ #include <openssl/err.h> #include <openssl/ssl.h> #include <openssl/rand.h> -#else -/* Libraries for RSAref and SYSSSL */ -#include <rsa.h> -#include <crypto.h> -#include <x509.h> -#include <pem.h> -#include <err.h> -#include <ssl.h> -#include <rand.h> -#endif +#define USE_SSL + #endif #include <math.h> -#endif #if APR_HAVE_CTYPE_H #include <ctype.h> #endif @@ -424,7 +436,7 @@ * */ #ifdef USE_SSL -long ssl_print_cb(BIO *bio,int cmd,const char *argp,int argi,long argl,long ret) +static long ssl_print_cb(BIO *bio,int cmd,const char *argp,int argi,long argl,long ret) { BIO *out; @@ -466,7 +478,7 @@ return i; } -void ssl_rand_seed() +static void ssl_rand_seed(void) { int nDone = 0; int n, l; @@ -498,9 +510,7 @@ nDone += 128; } -int ssl_print_connection_info(bio,ssl) -BIO *bio; -SSL *ssl; +static int ssl_print_connection_info(BIO *bio, SSL *ssl) { SSL_CIPHER *c; int alg_bits,bits; @@ -515,9 +525,7 @@ return(1); } -int ssl_print_cert_info(bio,x509cert) -BIO *bio; -X509 *x509cert; +static int ssl_print_cert_info(BIO *bio, X509 *x509cert) { X509_NAME *dn; char buf[64]; @@ -549,7 +557,7 @@ return(1); } -void ssl_start_connect(struct connection * c) +static void ssl_start_connect(struct connection * c) { BIO *bio; X509 *x509cert; @@ -685,7 +693,7 @@ do { apr_time_t tnow = apr_time_now(); apr_size_t l = c->rwrite; - apr_status_t e; + apr_status_t e = APR_SUCCESS; /* prevent gcc warning */ /* * First time round ? @@ -1665,7 +1677,14 @@ for (i = 0; i < n; i++) { const apr_pollfd_t *next_fd = &(pollresults[i]); - struct connection *c = next_fd->client_data; + struct connection *c; + +#ifdef USE_SSL + if (ssl) + c = &con[i]; + else +#endif + c = next_fd->client_data; /* * If the connection isn't connected how can we check it? @@ -1767,14 +1786,14 @@ static void copyright(void) { if (!use_html) { - printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.121.2.12 $> apache-2.0"); + printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.141 $> apache-2.0"); printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n"); printf("\n"); } else { printf("<p>\n"); - printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.121.2.12 $"); + printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.141 $"); printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n"); printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n"); printf("</p>\n<p>\n");