cvs commit: apache-1.3/src/support README ab.8 ab.c

1999-04-05 Thread dirkx
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
  +   

cvs commit: apache-1.3/src CHANGES

1999-04-05 Thread dirkx
dirkx   99/04/05 13:53:08

  Modified:.configure Makefile.tmpl
   src  CHANGES
  Log:
  Changes to configuration to guess the userid and groupid apache
  runs as. And to chown/chgrp the proxycachedir during an install.
  
  Submitted by: dirkx
  Reviewed by: rse
  
  Revision  ChangesPath
  1.80  +17 -6 apache-1.3/configure
  
  Index: configure
  ===
  RCS file: /x3/home/cvs/apache-1.3/configure,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- configure 1999/04/02 10:38:03 1.79
  +++ configure 1999/04/05 20:53:05 1.80
  @@ -1004,19 +1004,29 @@
   
   ##
   ##  determine special configuration parameters
  +## 
  +##  The checks via /etc/passwd and /etc/group will obviously fail
  +##  on platforms using NIS. But then you propably do not want a
  +##  UID/GID as production oriented as a web server in NIS anyway.
   ##
  +conf_user="nobody"
   conf_group="#-1"
   conf_port="80"
   conf_serveradmin="[EMAIL PROTECTED]"
   conf_servername="new.host.name"
   if [ "x$confadjust" = "x1" ]; then
  -if [ ".`egrep '^nobody:' /etc/group`" != . ]; then
  -conf_group="nobody"
  -else
  -if [ ".`egrep '^nogroup:' /etc/group`" != . ]; then
  -conf_group="nogroup"
  +for uid in nobody www daemon demon http httpd; do 
  +if [ "x`egrep \^${uid}: /etc/passwd`" != "x" ]; then
  +conf_user="$uid"
  +break
   fi
  -fi
  +done
  +for gid in nobody nogroup www daemon demon http httpd; do 
  +if [ "x`egrep \^${gid}: /etc/group`" != "x" ]; then
  +conf_group="$gid"
  +break
  +fi
  +done
   if [ ".`id | grep root`" = . ]; then
   conf_port="8080"
   fi
  @@ -1122,6 +1132,7 @@
   -e "[EMAIL PROTECTED]@%$suexec_uidmin%g" \
   -e "[EMAIL PROTECTED]@%$suexec_gidmin%g" \
   -e "[EMAIL PROTECTED]@%$suexec_safepath%g" \
  +-e "[EMAIL PROTECTED]@%$conf_user%g" \
   -e "[EMAIL PROTECTED]@%$conf_group%g" \
   -e "[EMAIL PROTECTED]@%$conf_port%g" \
   -e "[EMAIL PROTECTED]@%$conf_serveradmin%g" \
  
  
  
  1.70  +4 -0  apache-1.3/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===
  RCS file: /x3/home/cvs/apache-1.3/Makefile.tmpl,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- Makefile.tmpl 1999/03/29 11:40:18 1.69
  +++ Makefile.tmpl 1999/04/05 20:53:05 1.70
  @@ -134,6 +134,7 @@
   suexec_safepath = @suexec_safepath@
   
   #   some substituted configuration parameters
  +conf_user= @conf_user@
   conf_group   = @conf_group@
   conf_port= @conf_port@
   conf_serveradmin = @conf_serveradmin@
  @@ -256,6 +257,8 @@
$(MKDIR) $(root)$(runtimedir)
$(MKDIR) $(root)$(logfiledir)
$(MKDIR) $(root)$(proxycachedir)
  + chown $(conf_user) $(root)$(proxycachedir)
  + chgrp $(conf_group) $(root)$(proxycachedir)
@echo "<=== [mktree]"
   
   #   install the server program and optionally corresponding
  @@ -442,6 +445,7 @@
-e 
"s;logs/agent_log;$(logfiledir)/$${target_prefix}agent_log;" \
-e 's;conf/magic;$(sysconfdir)/magic;' \
-e 's;conf/mime\.types;$(sysconfdir)/mime.types;' \
  + -e 's;User nobody;User $(conf_user);' \
-e 's;Group #-1;Group $(conf_group);' \
-e 's;Port 80;Port $(conf_port);' \
-e 's;ServerAdmin [EMAIL PROTECTED];ServerAdmin 
$(conf_serveradmin);' \
  
  
  
  1.1297+14 -0 apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /x3/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1296
  retrieving revision 1.1297
  diff -u -r1.1296 -r1.1297
  --- CHANGES   1999/04/02 10:37:59 1.1296
  +++ CHANGES   1999/04/05 20:53:07 1.1297
  @@ -1,5 +1,19 @@
   Changes with Apache 1.3.7
   
  +  *) Be more smart in APACI's configure script when determining the UID/GID
  + for User/Group directives and use the determined UID/GID to initialize
  + the permissions on the proxycachedir.
  + [Dirk-Willem van Gulik, Ralf S. Engelschall]
  +
  +  *) Changed the forking-prior-to-cleanup in the proxy module to first
  + check wether it actually needs to collect garbage. This reduces 
  + the number of fork()s from one/request to just the odd one an hour.
  + [Dirk-Willem van Gulik]
  +
  +  *) Added proxy, auth and header support to src/support/ab.c. Added a
  + README file to src/support/
  + [Dirk-Willem van Gulik]
  +
 *) Don't hard-code the path to AWK in --shadow bootstrapping Makefile.
[Ralf S. Engelschall] PR#4050