From 1d6866385c59dfdcc45a218775d2de82eba0561c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 16 May 2000 02:42:57 +0000 Subject: [PATCH] Fix some bugs (mostly lost 1.3 code) in ab's command-line processing. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85223 13f79535-47bb-0310-9956-ffa450edef68 --- support/ab.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/support/ab.c b/support/ab.c index 0a3cae4ea7..3ea8577766 100644 --- a/support/ab.c +++ b/support/ab.c @@ -838,14 +838,14 @@ static void test(void) static void copyright(void) { if (!use_html) { - printf("This is ApacheBench, Version %s\n", VERSION " <$Revision: 1.12 $> apache-2.0"); + printf("This is ApacheBench, Version %s\n", VERSION " <$Revision: 1.13 $> apache-2.0"); printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); printf("Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/\n"); printf("\n"); } else { printf("

\n"); - printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", VERSION, "$Revision: 1.12 $"); + printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", VERSION, "$Revision: 1.13 $"); printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
\n"); printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/
\n"); printf("

\n

\n"); @@ -979,7 +979,7 @@ int main(int argc, char **argv) #endif ap_optind = 1; - while (ap_getopt(argc, argv, "n:c:t:T:p:v:kVhwx:y:z:", &c, cntxt) == APR_SUCCESS) { + while (ap_getopt(argc, argv, "n:c:t:T:p:v:kVhwix:y:z:C:H:P:A:", &c, cntxt) == APR_SUCCESS) { switch (c) { case 'n': requests = atoi(ap_optarg); @@ -995,11 +995,12 @@ int main(int argc, char **argv) break; case 'i': if (posting == 1) - err("Cannot mix POST and HEAD"); + err("Cannot mix POST and HEAD\n"); posting = -1; + break; case 'p': if (posting != 0) - err("Cannot mix POST and HEAD"); + err("Cannot mix POST and HEAD\n"); if (0 == (r = open_postfile(ap_optarg))) { posting = 1; @@ -1052,7 +1053,29 @@ int main(int argc, char **argv) case 'H': strncat(hdrs, ap_optarg, sizeof(hdrs)); strncat(hdrs, "\r\n", sizeof(hdrs)); - strcpy(content_type, ap_optarg); + break; + case 'w': + use_html = 1; + break; + /* + * if any of the following three are used, turn on html output + * automatically + */ + case 'x': + use_html = 1; + tablestring = ap_optarg; + break; + case 'y': + use_html = 1; + trstring = ap_optarg; + break; + case 'z': + use_html = 1; + tdstring = ap_optarg; + break; + case 'h': + usage(argv[0]); + break; } } -- 2.50.1