dirkx 99/04/05 06:52:21
Modified:src/support ab.8 ab.c
Added: src/support README
Log:
Added Basic Auth, Cookies and arbitrary headers to ab.c/ab.8. Sorry
for the diff; ident seemed to have mangled some lines with the current
.indedent.pro. Sneaked in a write() to writev() replacement which
at least on FreeBSD makes a POST significantly 2-5% faster.
Added a README file. To make it even more obvious that there are
usefull things such as rotate_log, split_log and the likes.
Revision ChangesPath
1.5 +47 -0 apache-1.3/src/support/ab.8
Index: ab.8
===
RCS file: /x3/home/cvs/apache-1.3/src/support/ab.8,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ab.8 1999/02/19 16:25:35 1.4
+++ ab.8 1999/04/05 13:52:20 1.5
@@ -1,4 +1,5 @@
.TH ab 1 "March 1998"
+.\" $Id: ab.8,v 1.5 1999/04/05 13:52:20 dirkx Exp $
.\" Copyright (c) 1998-1999 The Apache Group. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -66,6 +67,14 @@
] [
.BI \-p " POST file"
] [
+.BI \-A " Authenticate username:password"
+] [
+.BI \-P " Proxy Authenticate username:password"
+] [
+.BI \-H " Custom header"
+] [
+.BI \-C " Cookie name=value"
+] [
.BI \-T " content-type"
] [
.BI \-v " verbosity"
@@ -126,6 +135,31 @@
File containing data to POST.
.TP 12
+.BI \-A " Authorization username:password"
+Supply BASIC Authentification credentials to the server. The username
+and password are separated by a single ':' and send on the wire uuencoded.
+The string is send regardless of wether the server needs it; (i.e. has
+send an 401. Authentifcation needed).
+
+.TP 12
+.BI \-p " Proxy-Authorization username:password"
+Supply BASIC Authentification credentials to a proxy en-route. The username
+and password are separated by a single ':' and send on the wire uuencoded.
+The string is send regardless of wether the proxy needs it; (i.e. has
+send an 407 Proxy authentifcation needed).
+
+.TP 12
+.BI \-C " Cookie name=value"
+Add a 'Cookie:' line to the request. The argument is typically in the form
+of a 'name=value' pair. This field is repeatable.
+
+.TP 12
+.BI \-p " Header string"
+Postfix extra headers to the request. The argument is typically in the form
+of a valid header line; containing a colon separated field value pair. (i.e.
+'Accept-Encoding: zip/zop;8bit').
+
+.TP 12
.BI \-T " content-type"
Content-type header to use for POST data.
@@ -158,6 +192,19 @@
.B \-h
Display usage information.
.PD
+.SH BUGS
+There are various statically declared buffers of fixed length. Combined
+with the lazy parsing of the command line arguments, the response headers
+from the server and other external inputs this might bite you.
+.P
+It does not implment HTTP/1.x fully; only accepts some 'expected' forms
+of responses. The rather heavy use of
+.BR strstr(3)
+shows up top in profile,
+which might indicate a performance problem; i.e. you would measure the
+.BR ab
+performance rather than the server's.
+
.SH SEE ALSO
.BR httpd(8)
.
1.21 +130 -30 apache-1.3/src/support/ab.c
Index: ab.c
===
RCS file: /x3/home/cvs/apache-1.3/src/support/ab.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ab.c 1999/02/19 16:25:35 1.20
+++ ab.c 1999/04/05 13:52:21 1.21
@@ -81,6 +81,7 @@
**- Cleaned up by Ralf S. Engelschall <[EMAIL PROTECTED]>, March 1998
**- POST and verbosity by Kurt Sussman <[EMAIL PROTECTED]>, August
1998
**- HTML table output added by David N. Welton <[EMAIL PROTECTED]>,
January 1999
+ **- Added Cookie, Arbitrary header and auth support. <[EMAIL
PROTECTED]>, April 199
**
*/
@@ -120,11 +121,17 @@
#include
#define ap_select select
-#else /* (!)NO_APACHE_INCLUDES */
+#else/* (!)NO_APACHE_INCLUDES */
#include "ap_config.h"
#include
#include
-#endif /* NO_APACHE_INCLUDES */
+
+#ifndef NO_WRITEV
+#include
+#include
+#endif
+
+#endif /* NO_APACHE_INCLUDES */
/* --- DEFINITIONS -- */
/* maximum number of requests on a time limited test */
@@ -146,7 +153,8 @@
char cbuff[CBUFFSIZE]; /* a buffer to store server response header */
int cbx; /* offset in cbuffer */
int keepalive; /* non-zero if a keep-alive request */
-int gotheader; /* non-zero if we have the entire header in
cbuff */
+int gotheader; /* non-zero if we have the entire header in
+