You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ma...@hyperreal.org on 1999/02/07 07:30:28 UTC

cvs commit: apache-apr/pthreads/src/support Makefile.tmpl ab.1 ab.c apachectl apachectl.1 apxs.8 apxs.pl dbmmanage dbmmanage.1 htdigest.1 htdigest.c htpasswd.1 htpasswd.c httpd.8 httpd.exp log_server_status logresolve.8 logresolve.pl rotatelogs.8 split-logfile suexec.8 suexec.c suexec.h

manoj       99/02/06 22:30:26

  Modified:    pthreads Announcement INSTALL KEYS LICENSE Makefile.tmpl
                        README.configure configure
               pthreads/conf httpd.conf-dist httpd.conf-dist-win mime.types
               pthreads/icons README
               pthreads/src ApacheCore.def ApacheCore.dsp BUILD.NOTES
                        CHANGES Configuration.tmpl Configure Makefile.nt
                        Makefile.tmpl buildmark.c
               pthreads/src/ap Makefile.tmpl ap.dsp ap.mak ap_cpystrn.c
                        ap_execve.c ap_signal.c ap_slack.c ap_snprintf.c
               pthreads/src/helpers GuessOS PrintPath TestCompile
                        buildinfo.sh checkheader.sh findcpp.sh fmn.sh fp2rp
                        install.sh mkshadow.sh ppl.sh slo.sh
               pthreads/src/include alloc.h ap.h ap_compat.h ap_config.h
                        ap_ctype.h ap_md5.h ap_mmn.h buff.h
                        http_conf_globals.h http_config.h http_core.h
                        http_log.h http_main.h http_protocol.h
                        http_request.h http_vhost.h httpd.h rfc1413.h
                        scoreboard.h util_date.h util_md5.h util_script.h
                        util_uri.h
               pthreads/src/main Makefile.tmpl alloc.c buff.c
                        gen_test_char.c http_config.c http_core.c
                        http_log.c http_main.c http_protocol.c
                        http_request.c http_vhost.c rfc1413.c util.c
                        util_date.c util_md5.c util_script.c util_uri.c
               pthreads/src/modules/example mod_example.c
               pthreads/src/modules/experimental mod_mmap_static.c
               pthreads/src/modules/proxy mod_proxy.c mod_proxy.h
                        proxy_cache.c proxy_connect.c proxy_ftp.c
                        proxy_http.c proxy_util.c
               pthreads/src/modules/standard mod_access.c mod_actions.c
                        mod_alias.c mod_asis.c mod_auth.c mod_auth_anon.c
                        mod_auth_db.c mod_auth_dbm.c mod_autoindex.c
                        mod_cern_meta.c mod_cgi.c mod_digest.c mod_dir.c
                        mod_env.c mod_expires.c mod_headers.c mod_imap.c
                        mod_include.c mod_info.c mod_log_agent.c
                        mod_log_config.c mod_log_referer.c mod_mime.c
                        mod_mime_magic.c mod_negotiation.c mod_rewrite.c
                        mod_rewrite.h mod_setenvif.c mod_so.c mod_speling.c
                        mod_status.c mod_unique_id.c mod_userdir.c
                        mod_usertrack.c
               pthreads/src/modules/test mod_rndchunk.c mod_test_util_uri.c
               pthreads/src/os/bs2000 bs2login.c ebcdic.c os.c os.h
               pthreads/src/os/os2 os.h
               pthreads/src/os/tpf TPFExport ebcdic.c os.c os.h
               pthreads/src/os/unix os-aix-dso.c os.h
               pthreads/src/os/win32 mod_dll.c mod_isapi.c os.h registry.c
                        util_win32.c
               pthreads/src/os/win32/installer apache.iwz
               pthreads/src/support Makefile.tmpl ab.1 ab.c apachectl
                        apachectl.1 apxs.8 apxs.pl dbmmanage dbmmanage.1
                        htdigest.1 htdigest.c htpasswd.1 htpasswd.c httpd.8
                        httpd.exp log_server_status logresolve.8
                        logresolve.pl rotatelogs.8 split-logfile suexec.8
                        suexec.c suexec.h
  Added:       pthreads config.layout
               pthreads/icons/small README.txt back.gif binary.gif
                        binhex.gif blank.gif broken.gif burst.gif comp1.gif
                        comp2.gif compressed.gif continued.gif dir.gif
                        dir2.gif doc.gif forward.gif generic.gif
                        generic2.gif generic3.gif image.gif image2.gif
                        index.gif key.gif movie.gif patch.gif ps.gif
                        rainbow.gif sound.gif sound2.gif tar.gif text.gif
                        transfer.gif unknown.gif uu.gif
               pthreads/src Makefile_win32.txt Makefile_win32_debug.txt
               pthreads/src/ap ap_md5c.c
               pthreads/src/helpers binbuild.sh
  Removed:     pthreads/src Makefile.tpf
               pthreads/src/main Makefile.tpf md5c.c
               pthreads/src/os/tpf test_char.h uri_delims.h
  Log:
  Update apache-apr to (almost) the current apache-1.3 state. apache-apr
  was previously based on an extract from early November.
  
  Revision  Changes    Path
  1.2       +24 -17    apache-apr/pthreads/Announcement
  
  Index: Announcement
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/Announcement,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- Announcement	1999/01/21 23:08:29	1.1
  +++ Announcement	1999/02/07 06:28:58	1.2
  @@ -1,26 +1,33 @@
  -Apache 1.3.3 Released
  +Apache 1.3.4 Released
   =====================
   
   The Apache Group is pleased to announce the release of version
  -1.3.3 of the Apache HTTP server.
  +1.3.4 of the Apache HTTP server.
   
  -This new Apache version is a bugfix release, primarily to fix a
  -serious problem with server error reporting introduced in 1.3.2.
  -This affected the functionality of most custom ErrorDocuments and
  -of some modules that depend on special error output (e.g., mod_speling).
  -A side-effect bug that resulted in incorrect error reporting of
  -nonexistent .htaccess files has also been fixed.
  +This new Apache version incorporates over 90 significant improvements
  +to the server, including avoidance of some denial-of-service attacks,
  +support for 3rd-party WebDAV modules, a complete overhaul of content
  +negotiation, optional column sorting for fancy indexes, the ability to
  +set a DefaultLanguage, and many fixes to improve consistency, portability,
  +and squish bugs.  A complete listing is provided in the src/CHANGES file.
   
  -Additional changes in this release consist of new supported platforms,
  -Win32 and Unix portability fixes, ErrorDocument environment enhancements,
  -improved protocol behavior to match the HTTP/1.1 revised specification,
  -and assorted other features or fixes.  Users should review the CHANGES file
  -and decide on their upgrade plans.  We consider Apache 1.3.3 to be the
  -most stable version of Apache available and we strongly recommend that
  -users of older versions, especially of the 1.1.x and 1.2.x family, upgrade
  -as soon as possible.
  +Of special note are the many changes to the Apache configuration process.
  +The default path layout generated by the "configure" script has been
  +changed to be more consistent with the traditional Apache layout, and
  +several new command-line options have been added to make compilation
  +easier.  Please see the README.configure and INSTALL files for complete
  +information.  In addition, we have moved all of the server configuration
  +directives to a single file (httpd.conf-dist), updated mime.types, and
  +improved the examples for first-time installers.  Finally, a few of the
  +rarely-used command-line options for httpd have been changed to be more
  +consistent with the help options of other programs.
   
  -Apache 1.3.3 is available for download from
  +We consider Apache 1.3.4 to be the best version of Apache available and
  +we strongly recommend that users of older versions, especially of the
  +1.1.x and 1.2.x family, upgrade as soon as possible.  No further releases
  +will be made in the 1.2.x family.
  +
  +Apache 1.3.4 is available for download from
   
       http://www.apache.org/dist/
   
  
  
  
  1.2       +56 -48    apache-apr/pthreads/INSTALL
  
  Index: INSTALL
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/INSTALL,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- INSTALL	1999/01/21 23:08:29	1.1
  +++ INSTALL	1999/02/07 06:28:58	1.2
  @@ -1,5 +1,5 @@
   
  -  A P A C H E   I N S T A L L A T I O N
  +  APACHE INSTALLATION
   
     NOTE: Windows users please read the documents README.NT and
           http://www.apache.org/docs/windows.html, (or the
  @@ -29,7 +29,7 @@
        $ ./configure --prefix=PREFIX
        $ make
        $ make install
  -     $ PREFIX/sbin/apachectl start
  +     $ PREFIX/bin/apachectl start
   
        NOTE: PREFIX is not the string "PREFIX". Instead use the Unix
              filesystem path under which Apache should be installed. For
  @@ -79,12 +79,11 @@
           platform-dependend. The current state is this:
   
           o Out-of-the-box supported platforms are:
  -           - Linux     - IRIX
  -           - FreeBSD   - HPUX
  -           - OpenBSD   - Digital UNIX
  -           - NetBSD    - UnixWare
  -           - SunOS     - AIX
  -           - Solaris   - SCO
  +           - Linux     - SunOS         - UnixWare    
  +           - FreeBSD   - Solaris       - AIX         
  +           - OpenBSD   - IRIX          - SCO         
  +           - NetBSD    - HPUX        
  +           - BSDI      - Digital Unix
   
           o Entirely unsupported platforms are:
              - Ultrix
  @@ -135,38 +134,37 @@
   
        Reference:
   
  -     $ [CC=...]        [CFLAGS_SHLIB=...]         
  +     $ [CC=...]        [CFLAGS_SHLIB=...]           [TARGET=...]
          [OPTIM=...]     [LD_SHLIB=...]
          [CFLAGS=...]    [LDFLAGS_SHLIB=...]        
          [INCLUDES=...]  [LDFLAGS_SHLIB_EXPORT=...] 
          [LDFLAGS=...]   [RANLIB=...]  
  -       [LIBS=...] 
  -       ./configure [--quiet]   [--prefix=DIR]         [--enable-rule=NAME]    
  -                   [--verbose] [--exec-prefix=PREFIX] [--disable-rule=NAME]   
  -                   [--shadow]  [--bindir=EPREFIX]     [--add-module=FILE]     
  -                   [--help]    [--sbindir=DIR]        [--activate-module=FILE]
  -                   [--layout]  [--libexecdir=DIR]     [--enable-module=NAME]  
  -                               [--mandir=DIR]         [--disable-module=NAME] 
  -                               [--sysconfdir=DIR]     [--enable-shared=NAME]  
  -                               [--datadir=DIR]        [--disable-shared=NAME] 
  -                               [--includedir=DIR]     [--permute-module=N1:N2]
  -                               [--localstatedir=DIR]  
  -                               [--runtimedir=DIR]     [--enable-suexec]        
  -                               [--logfiledir=DIR]     [--suexec-caller=UID]    
  -                               [--proxycachedir=DIR]  [--suexec-userdir=DIR]   
  -                               [--compat]             [--suexec-uidmin=UID]    
  -                                                      [--suexec-gidmin=GID]    
  -                                                      [--suexec-safepath=PATH] 
  -                                                                                
  -                                                      [--with-perl=FILE]       
  -                                                      [--without-support]      
  -                                                      [--without-confadjust]   
  +       [LIBS=...]      [DEPS=...]
  +       ./configure
  +           [--quiet]         [--prefix=DIR]            [--enable-rule=NAME]    
  +           [--verbose]       [--exec-prefix=PREFIX]    [--disable-rule=NAME]   
  +           [--shadow[=DIR]]  [--bindir=EPREFIX]        [--add-module=FILE]     
  +           [--show-layout]   [--sbindir=DIR]           [--activate-module=FILE]
  +           [--help]          [--libexecdir=DIR]        [--enable-module=NAME]  
  +                             [--mandir=DIR]            [--disable-module=NAME] 
  +                             [--sysconfdir=DIR]        [--enable-shared=NAME]  
  +                             [--datadir=DIR]           [--disable-shared=NAME] 
  +                             [--includedir=DIR]        [--permute-module=N1:N2]
  +                             [--localstatedir=DIR]
  +                             [--runtimedir=DIR]        [--enable-suexec]
  +                             [--logfiledir=DIR]        [--suexec-caller=UID]
  +                             [--proxycachedir=DIR]     [--suexec-docroot=DIR]
  +                             [--with-layout=[FILE:]ID] [--suexec-logfile=FILE]
  +                                                       [--suexec-userdir=DIR]
  +                             [--with-perl=FILE]        [--suexec-uidmin=UID]
  +                             [--without-support]       [--suexec-gidmin=GID]
  +                             [--without-confadjust]    [--suexec-safepath=PATH]
   
        Use the CC, OPTIM, CFLAGS, INCLUDES, LDFLAGS, LIBS, CFLAGS_SHLIB,
  -     LD_SHLIB, LDFLAGS_SHLIB, LDFLAGS_SHLIB_EXPORT and RANLIB environment
  -     variables to override the corresponding default entries in the
  -     src/Configuration.tmpl file (see there for more information about their
  -     usage).
  +     LD_SHLIB, LDFLAGS_SHLIB, LDFLAGS_SHLIB_EXPORT, RANLIB, DEPS and TARGET
  +     environment variables to override the corresponding default entries in
  +     the src/Configuration.tmpl file (see there for more information about
  +     their usage).
   
            Note: The syntax ``KEY=VALUE ./configure ...'' (one single line!) is
                  the GNU Autoconf compatible way of specifying defines and can
  @@ -214,11 +212,17 @@
                  make sure the paths fit your situation by checking the finally
                  chosen paths via the --layout option.
   
  -     Use the --compat option to install Apache into a installation tree which
  -     has a similar layout than the one used with Apache 1.2.
  +     Use the --with-layout=[F:]ID option to select a particular installation
  +     path base-layout. You always _HAVE_ to select a base-layout. There are
  +     currently two layouts pre-defined in the file config.layout: `Apache' for
  +     the classical Apache path layout and `GNU' for a path layout conforming
  +     to the GNU `standards' document. When you want to use your own custom
  +     layout FOO, either add a corresponding "<Layout FOO>...</Layout>" section
  +     to config.layout and use --with-layout=FOO or place it into your own
  +     file, say config.mypaths, and use --with-layout=config.mypaths:FOO.
    
  -     Use the --layout option to check the final installation path layout while
  -     fiddling with the options above.
  +     Use the --show-layout option to check the final installation path layout
  +     while fiddling with the options above.
    
        Use the --enable-rule=NAME and --disable-rule=NAME options to enable or
        disable a particular Rule from the Apache src/Configuration.tmpl file. The
  @@ -283,6 +287,7 @@
        HTTP response
         (-) mod_headers ...... Arbitrary HTTP response headers (configured)
         (-) mod_cern_meta .... Arbitrary HTTP response headers (CERN-style files)
  +      (-) mod_expires ...... Expires HTTP responses 
         (+) mod_asis ......... Raw HTTP responses 
        Scripting
         (+) mod_include ...... Server Side Includes (SSI) support
  @@ -299,8 +304,8 @@
        Miscellaneous
         (+) mod_imap ......... Server-side Image Map support
         (-) mod_proxy ........ Caching Proxy Module (HTTP, HTTPS, FTP)
  -     Experimental
         (-) mod_so ........... Dynamic Shared Object (DSO) bootstrapping
  +     Experimental
         (-) mod_mmap_static .. Caching of frequently served pages via mmap()
        Development
         (-) mod_example ...... Apache API demonstration (developers only)
  @@ -367,12 +372,14 @@
    
        Use the --enable-suexec option to enable the suEXEC feature by building
        and installing the "suexec" support program. Use --suexec-caller=UID to
  -     set the allowed caller user id, the --suexec-userdir=DIR to set the user
  -     subdirectory, the --suexec-uidmin=UID/--suexec-gidmin=GID to set the
  -     minimal allowed UID/GID and --suexec-safepath=PATH to set the safe shell
  -     PATH for the suEXEC feature. At least one --suexec-xxxxx option has
  -     to be provided together with --enable-suexec option to let APACI accept
  -     your request for using the suEXEC feature.
  +     set the allowed caller user id, --suexec-userdir=DIR to set the user
  +     subdirectory, --suexec-docroot=DIR to set the suexec root directory,
  +     --suexec-uidmin=UID/--suexec-gidmin=GID to set the minimal allowed
  +     UID/GID, --suexec-logfile=FILE to set the logfile and
  +     --suexec-safepath=PATH to set the safe shell PATH for the suEXEC
  +     feature. At least one --suexec-xxxxx option has to be provided together
  +     with the --enable-suexec option to let APACI accept your request for
  +     using the suEXEC feature.
   
        CAUTION: FOR DETAILS ABOUT THE SUEXEC FEATURE WE HIGHLY RECOMMEND YOU TO
                 FIRST READ THE DOCUMENT htdocs/manual/suexec.html BEFORE USING
  @@ -390,7 +397,8 @@
        Use the --shadow option to let APACI create a shadow source tree of the
        sources for building. This is useful when you want to build for different
        platforms in parallel (usually through a NFS, AFS or DFS mounted
  -     filesystem).
  +     filesystem).  You may specify a directory to the --shadow option into
  +     which the shadow tree will be created.
    
        Use the --quiet option to disable all configuration verbose messages.
    
  @@ -442,7 +450,7 @@
    
        Now you can fire up your Apache HTTP server by immediately running
    
  -        $ PREFIX/sbin/apachectl start
  +        $ PREFIX/bin/apachectl start
    
        and then you should be able to request your first document via URL
        http://localhost/ (when you built and installed Apache as root or at
  @@ -450,7 +458,7 @@
        (when you built and installed Apache as a regular user). Then stop the
        server again by running: 
   
  -        $ PREFIX/sbin/apachectl stop
  +        $ PREFIX/bin/apachectl stop
    
     7. Customizing the package
        -----------------------
  
  
  
  1.2       +20 -8     apache-apr/pthreads/KEYS
  
  Index: KEYS
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/KEYS,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- KEYS	1999/01/21 23:08:29	1.1
  +++ KEYS	1999/02/07 06:28:58	1.2
  @@ -240,16 +240,28 @@
   
   
   Type bits/keyID    Date       User ID
  -pub   768/8F394E3D 1995/08/08 Martin Kraemer <Ma...@Mch.SNI.De>
  -
  +pub  1024/EE65E321 1998/10/22 Martin Kraemer <ma...@apache.org>
  +sig       BB1D9F6D             ct magazine CERTIFICATE <pg...@ct.heise.de>
  +sig       E2449019             Martin Kraemer <Ma...@Mch.SNI.De>
  +sig       EE65E321             Martin Kraemer <ma...@apache.org>
   -----BEGIN PGP PUBLIC KEY BLOCK-----
  -Version: 2.6
  +Version: 2.6.2
   
  -mQBtAzAnjA8AAAEDAKlpkRzZ7c4yDdVnW9fMHMXrMJ8gQ+UIzr1xt2+y7Sv71Nv9
  -GfUuTeCWdOoynFUXvvBjyCuEIZ426s9UfrnWv94VppoS8sjFgLYkRIAhZiDMHYp0
  -j8i1/f82KtdYjzlOPQAFEbQqTWFydGluIEtyYWVtZXIgPE1hcnRpbi5LcmFlbWVy
  -QE1jaC5TTkkuRGU+
  -=hcsR
  +mQCNAzYvawcAAAEEAO/lLOQVYsUS+l7yan+Rzr0ehfWRqlgeNsV4DQ0xTuQewD9K
  +5lm7ujRwutxlNaf5dXjE24mlsiRN8KDp+fKwm7Wtqv490xmhzS/6y8ekwB02P4fi
  +/JJNX1PbLS0cL6+bz2dFqLDhh03Ovz3G16Y9he5mrJ2PNOWa9Dfj9F/uZeMhAAUR
  +tCJNYXJ0aW4gS3JhZW1lciA8bWFydGluQGFwYWNoZS5vcmc+iQCVAwUQNkcAbUS4
  +3da7HZ9tAQFUnAP+PrKa3YFKp9XTrANmORex4kOyNpM1adS8zM6bTcHyIkH4WitB
  +b2nRbqOdOuSwbh655aSStluIxY66CValeL+6E7MCEqQ/UlzzMVmdbMyWSYwDlkV3
  +gQkg3vE6bgFlWlLLr2HnkllY3ISEChDWh8x7fRKLy+8ZBGW89ZXOGkhIb9mJAJUD
  +BRA2L2ueKwLDReJEkBkBAbeGBACKM1FCmQC583/IHyw7rDlvnsZKeKvdbbLGSnmJ
  +NWOyf4VgkC8OCKmwPnWLOOIK44/JsT2Yonih2r+04FBqYo6SsMgBqOBJqKktHvtx
  +bD3VfUUkkV8kZ4ituecWTx0zj1Oa0QiCiv8HHvdsmQB0mj07mWQz1CamXPSwHYn+
  +t+fJOIkAlQMFEDYva2c34/Rf7mXjIQEBcNQEAOrt4+o2LwcCiJp3bOF9WZMirpMQ
  +QJISqXBnom3r2eB+k1a/Jig1sePSzPxneW9EgWIrWg0EfK+u2kMgvTJynDUux9zL
  +4qnECmZT+ESEm+P8rPKeecOfUHgDjQlTUCneOX5p0TbdvJm+TcJVjXjoVrYv6hZg
  +InYw+jlvF5e/sdI8
  +=03LU
   -----END PGP PUBLIC KEY BLOCK-----
   
   
  
  
  
  1.2       +1 -1      apache-apr/pthreads/LICENSE
  
  Index: LICENSE
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/LICENSE,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- LICENSE	1999/01/21 23:08:29	1.1
  +++ LICENSE	1999/02/07 06:28:59	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +89 -55    apache-apr/pthreads/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/Makefile.tmpl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- Makefile.tmpl	1999/01/21 23:08:29	1.1
  +++ Makefile.tmpl	1999/02/07 06:28:59	1.2
  @@ -1,5 +1,5 @@
   ## ====================================================================
  -## Copyright (c) 1998 The Apache Group.  All rights reserved.
  +## Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
   ##
   ## Redistribution and use in source and binary forms, with or without
   ## modification, are permitted provided that the following conditions
  @@ -70,7 +70,7 @@
   SHELL           = /bin/sh
   
   #   paths to the source tree parts
  -TOP             = @TOP@
  +TOP             = .
   SRC             = @SRC@
   MKF             = @MKF@
   AUX             = @AUX@
  @@ -79,7 +79,6 @@
   CP              = cp
   LN              = ln
   RM              = rm -f
  -TAR             = tar
   MKDIR           = $(TOP)/$(AUX)/mkdir.sh
   INSTALL         = $(TOP)/$(AUX)/install.sh -c
   INSTALL_PROGRAM = $(INSTALL) -s -m 755
  @@ -87,7 +86,12 @@
   INSTALL_SCRIPT  = $(INSTALL) -m 755
   INSTALL_DATA    = $(INSTALL) -m 644
   PERL            = @PERL@
  +TAR		= @TAR@
  +TAROPT		= @TAROPT@
   
  +#   installation name of Apache webserver
  +TARGET          = @TARGET@
  +
   #   installation root 
   #   (overrideable by package maintainers for
   #   rolling packages without bristling the system)
  @@ -113,6 +117,8 @@
   #   suexec details (optional)
   suexec          = @suexec@
   suexec_caller   = @suexec_caller@
  +suexec_docroot  = @suexec_docroot@
  +suexec_logexec  = @suexec_logexec@
   suexec_userdir  = @suexec_userdir@
   suexec_uidmin   = @suexec_uidmin@
   suexec_gidmin   = @suexec_gidmin@
  @@ -147,10 +153,15 @@
   #   build the package
   build:
   	@echo "===> $(SRC)"
  -	@$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) build-std $(build-support)
  +	@$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) build-std
  +	@$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) $(build-support)
   	@touch $(TOP)/$(SRC)/.apaci.build.ok
   	@echo "<=== $(SRC)"
   
  +#   the non-verbose variant for package maintainers
  +build-quiet:
  +	@$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) QUIET=1 build
  +
   #   build the standard stuff
   build-std:
   	@cd $(TOP)/$(SRC); $(MAKE) $(MFLAGS) SDP=$(SRC)/ all
  @@ -166,8 +177,8 @@
   			-DUID_MIN=$(suexec_uidmin) \
   			-DGID_MIN=$(suexec_gidmin) \
   			-DUSERDIR_SUFFIX=\"$(suexec_userdir)\" \
  -			-DLOG_EXEC=\"$(logfiledir)/suexec_log\" \
  -			-DDOC_ROOT=\"$(datadir)/htdocs\" \
  +			-DLOG_EXEC=\"$(suexec_logexec)\" \
  +			-DDOC_ROOT=\"$(suexec_docroot)\" \
   			-DSAFE_PATH=\"$(suexec_safepath)\" \
   		' \
   		suexec; \
  @@ -183,28 +194,33 @@
   #   separate parts of the installation process.
   install:
   	@if [ ! -f $(TOP)/$(SRC)/.apaci.build.ok ]; then \
  -		$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) build; \
  +		$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) build; \
   	else \
   		:; \
   	fi
  -	@$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) \
  +	@$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) \
   		install-mktree install-programs $(install-support) \
   		install-include install-data install-config
   	-@$(RM) $(SRC)/.apaci.install.tmp
   	-@$(RM) $(SRC)/.apaci.install.conf
   	-@if [ ".$(QUIET)" != .1 ]; then \
  +		if [ ".$(TARGET)" = .httpd ]; then \
  +			apachectl='apachectl'; \
  +		else \
  +			apachectl="$(TARGET)ctl"; \
  +		fi; \
   		echo "+--------------------------------------------------------+"; \
   		echo "| You now have successfully built and installed the      |"; \
   		echo "| Apache 1.3 HTTP server. To verify that Apache actually |"; \
   		echo "| works correctly you now should first check the         |"; \
   		echo "| (initially created or preserved) configuration files   |"; \
   		echo "|                                                        |"; \
  -		echo "|   $(sysconfdir)/{httpd,access,srm}.conf"; \
  +		echo "|   $(sysconfdir)/$(TARGET).conf"; \
   		echo "|                                                        |"; \
   		echo "| and then you should be able to immediately fire up     |"; \
   		echo "| Apache the first time by running:                      |"; \
   		echo "|                                                        |"; \
  -		echo "|   $(sbindir)/apachectl start"; \
  +		echo "|   $(sbindir)/$${apachectl} start"; \
   		echo "|                                                        |"; \
   		echo "| Thanks for using Apache.       The Apache Group        |"; \
   		echo "|                                http://www.apache.org/  |"; \
  @@ -213,7 +229,7 @@
   
   #   the non-verbose variant for package maintainers
   install-quiet:
  -	@$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) QUIET=1 install
  +	@$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) QUIET=1 install
   
   #   create the installation tree
   install-mktree:
  @@ -236,26 +252,26 @@
   #   install the server program and optionally corresponding
   #   shared object files.
   install-programs:
  -	@echo "===> [programs: Installing Apache httpd program and shared objects]"
  -	$(INSTALL_PROGRAM) $(TOP)/$(SRC)/httpd $(root)$(sbindir)/httpd
  +	@echo "===> [programs: Installing Apache $(TARGET) program and shared objects]"
  +	$(INSTALL_PROGRAM) $(TOP)/$(SRC)/$(TARGET) $(root)$(sbindir)/$(TARGET)
   	-@if [ ".`grep 'SUBTARGET=target_shared' $(TOP)/$(SRC)/Makefile`" != . ]; then \
   		SHLIB_SUFFIX_NAME="`grep '^SHLIB_SUFFIX_NAME=' $(TOP)/$(SRC)/Makefile | sed -e 's:^.*=::'`"; \
   		SHLIB_SUFFIX_LIST="`grep '^SHLIB_SUFFIX_LIST=' $(TOP)/$(SRC)/Makefile | sed -e 's:^.*=::'`"; \
  -		echo "$(INSTALL_DSO) $(TOP)/$(SRC)/libhttpd.ep $(root)$(libexecdir)/libhttpd.ep"; \
  -		$(INSTALL_DSO) $(TOP)/$(SRC)/libhttpd.ep $(root)$(libexecdir)/libhttpd.ep; \
  -		echo "$(INSTALL_DSO) $(TOP)/$(SRC)/libhttpd.$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}"; \
  -		$(INSTALL_DSO) $(TOP)/$(SRC)/libhttpd.$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}; \
  +		echo "$(INSTALL_DSO) $(TOP)/$(SRC)/lib$(TARGET).ep $(root)$(libexecdir)/lib$(TARGET).ep"; \
  +		$(INSTALL_DSO) $(TOP)/$(SRC)/lib$(TARGET).ep $(root)$(libexecdir)/lib$(TARGET).ep; \
  +		echo "$(INSTALL_DSO) $(TOP)/$(SRC)/lib$(TARGET).$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}"; \
  +		$(INSTALL_DSO) $(TOP)/$(SRC)/lib$(TARGET).$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}; \
   		if [ ".$${SHLIB_SUFFIX_LIST}" != . ]; then \
  -			echo "$(RM) $(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}.*"; \
  -			$(RM) $(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}.*; \
  +			echo "$(RM) $(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}.*"; \
  +			$(RM) $(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}.*; \
   			for suffix in $${SHLIB_SUFFIX_LIST} ""; do \
   				[ ".$${suffix}" = . ] && continue; \
  -				echo "$(LN) $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}.$${suffix}"; \
  -				$(LN) $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}.$${suffix}; \
  +				echo "$(LN) $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}.$${suffix}"; \
  +				$(LN) $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}.$${suffix}; \
   			done; \
   		fi; \
   	fi
  -	$(INSTALL_DATA) $(TOP)/$(SRC)/support/httpd.8 $(root)$(mandir)/man8/httpd.8
  +	$(INSTALL_DATA) $(TOP)/$(SRC)/support/httpd.8 $(root)$(mandir)/man8/$(TARGET).8
   	-@$(RM) $(SRC)/.apaci.install.conf; touch $(SRC)/.apaci.install.conf
   	-@if [ ".`grep '^[ 	]*SharedModule' $(TOP)/$(SRC)/Configuration.apaci`" != . ]; then \
   		for mod in `egrep '^[ 	]*SharedModule' $(TOP)/$(SRC)/Configuration.apaci |\
  @@ -276,7 +292,7 @@
   		sed	-e 's:SharedModule:AddModule:' \
   			-e 's:modules/[^/]*/::' \
   			-e 's:[ 	]lib: mod_:' \
  -			-e 's:\.[soa]*$$:.c:' >>$(SRC)/.apaci.install.conf; \
  +			-e 's:\.[soam].*$$:.c:' >>$(SRC)/.apaci.install.conf; \
   	fi
   	@echo "<=== [programs]"
   
  @@ -285,12 +301,18 @@
   	@echo "===> [support: Installing Apache support programs and scripts]"
   	$(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/ab $(root)$(sbindir)/ab
   	$(INSTALL_DATA) $(TOP)/$(SRC)/support/ab.1 $(root)$(mandir)/man1/ab.1
  -	@echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/apachectl[*] $(root)$(sbindir)/apachectl"; \
  -	sed -e 's;PIDFILE=.*;PIDFILE=$(runtimedir)/httpd.pid;' \
  -		-e 's;HTTPD=.*;HTTPD=$(sbindir)/httpd;' \
  +	@if [ ".$(TARGET)" = .httpd ]; then \
  +		apachectl='apachectl'; \
  +	else \
  +		apachectl="$(TARGET)ctl"; \
  +	fi; \
  +	echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/apachectl[*] $(root)$(sbindir)/$${apachectl}"; \
  +	sed -e 's;PIDFILE=.*;PIDFILE=$(runtimedir)/$(TARGET).pid;' \
  +		-e 's;HTTPD=.*;HTTPD=$(sbindir)/$(TARGET);' \
   		< $(TOP)/$(SRC)/support/apachectl > $(TOP)/$(SRC)/.apaci.install.tmp && \
  -		$(INSTALL_SCRIPT) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sbindir)/apachectl
  -	$(INSTALL_DATA) $(TOP)/$(SRC)/support/apachectl.1 $(root)$(mandir)/man1/apachectl.1
  +		$(INSTALL_SCRIPT) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sbindir)/$${apachectl}; \
  +	echo "$(INSTALL_DATA) $(TOP)/$(SRC)/support/apachectl.1 $(root)$(mandir)/man1/$${apachectl}.1"; \
  +	$(INSTALL_DATA) $(TOP)/$(SRC)/support/apachectl.1 $(root)$(mandir)/man1/$${apachectl}.1
   	$(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/htpasswd $(root)$(bindir)/htpasswd
   	$(INSTALL_DATA) $(TOP)/$(SRC)/support/htpasswd.1 $(root)$(mandir)/man1/htpasswd.1
   	$(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/htdigest $(root)$(bindir)/htdigest
  @@ -332,7 +354,9 @@
   	$(CP) $(TOP)/$(SRC)/include/*.h $(root)$(includedir)/
   	@osdir=`grep '^OSDIR=' $(TOP)/$(SRC)/Makefile.config | sed -e 's:^OSDIR=.*/os:os:'`; \
   		echo "$(CP) $(TOP)/$(SRC)/$${osdir}/os.h $(root)$(includedir)/"; \
  -		$(CP) $(TOP)/$(SRC)/$${osdir}/os.h $(root)$(includedir)/
  +		$(CP) $(TOP)/$(SRC)/$${osdir}/os.h $(root)$(includedir)/; \
  +		echo "$(CP) $(TOP)/$(SRC)/$${osdir}/os-inline.c $(root)$(includedir)/"; \
  +		$(CP) $(TOP)/$(SRC)/$${osdir}/os-inline.c $(root)$(includedir)/
   	chmod 644 $(root)$(includedir)/*.h
   	@echo "<=== [include]"
   
  @@ -344,8 +368,8 @@
   		echo "[PRESERVING EXISTING DATA SUBDIR: $(root)$(datadir)/htdocs/]"; \
   	else \
   		echo "Copying tree $(TOP)/htdocs/ -> $(root)$(datadir)/htdocs/"; \
  -		(cd $(TOP)/htdocs/ && $(TAR) cf - *) |\
  -		(cd $(root)$(datadir)/htdocs/ && $(TAR) xf -); \
  +		(cd $(TOP)/htdocs/ && $(TAR) $(TAROPT) - *) |\
  +		(cd $(root)$(datadir)/htdocs/ && $(TAR) -xf -); \
   		find $(root)$(datadir)/htdocs/ -type d -exec chmod a+rx {} \; ; \
   		find $(root)$(datadir)/htdocs/ -type f -exec chmod a+r {} \; ; \
   	fi
  @@ -355,14 +379,14 @@
   		for script in printenv test-cgi; do \
   			cat $(TOP)/cgi-bin/$${script} |\
   			sed -e 's;^#!/.*perl;#!$(PERL);' \
  -        		> $(TOP)/$(SRC)/.apaci.install.tmp; \
  +			> $(TOP)/$(SRC)/.apaci.install.tmp; \
   			echo "$(INSTALL_DATA) $(TOP)/conf/$${script}[*] $(root)$(datadir)/cgi-bin/$${script}"; \
   			$(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(datadir)/cgi-bin/$${script}; \
   		done; \
   	fi
   	@echo "Copying tree $(TOP)/icons/ -> $(root)$(datadir)/icons/"; \
  -	(cd $(TOP)/icons/ && $(TAR) cf - *) |\
  -	(cd $(root)$(datadir)/icons/ && $(TAR) xf -); \
  +	(cd $(TOP)/icons/ && $(TAR) $(TAROPT) - *) |\
  +	(cd $(root)$(datadir)/icons/ && $(TAR) -xf -); \
   	find $(root)$(datadir)/icons/ -type d -exec chmod a+rx {} \; ;\
   	find $(root)$(datadir)/icons/ -type f -exec chmod a+r {} \;
   	@echo "<=== [data]"
  @@ -372,8 +396,18 @@
   install-config:
   	@echo "===> [config: Installing Apache configuration files]"
   	-@for conf in httpd.conf access.conf srm.conf; do \
  +		if [ .$$conf = .httpd.conf ]; then \
  +			target_conf="$(TARGET).conf"; \
  +		else \
  +			target_conf="$$conf"; \
  +		fi; \
  +		if [ ".$(TARGET)" = .httpd ]; then \
  +			target_prefix=""; \
  +		else \
  +			target_prefix="$(TARGET)_"; \
  +		fi; \
   		(echo "##"; \
  -		 echo "## $${conf} -- Apache HTTP server configuration file"; \
  +		 echo "## $${target_conf} -- Apache HTTP server configuration file"; \
   		 echo "##"; \
   		 echo ""; \
   		 cat $(TOP)/conf/$${conf}-dist ) |\
  @@ -382,28 +416,28 @@
   			-e 's;@@ServerRoot@@/icons;$(datadir)/icons;' \
   			-e 's;@@ServerRoot@@/cgi-bin;$(datadir)/cgi-bin;' \
   			-e 's;@@ServerRoot@@/proxy;$(proxycachedir);' \
  -			-e 's;@@ServerRoot@@;$(prefix);' \
  -			-e 's;logs/accept.lock;$(runtimedir)/httpd.lock;' \
  -			-e 's;logs/apache_runtime_status;$(runtimedir)/httpd.scoreboard;' \
  -			-e 's;logs/httpd.pid;$(runtimedir)/httpd.pid;' \
  -			-e 's;logs/access_log;$(logfiledir)/access_log;' \
  -			-e 's;logs/error_log;$(logfiledir)/error_log;' \
  -			-e 's;logs/referer_log;$(logfiledir)/referer_log;' \
  -			-e 's;logs/agent_log;$(logfiledir)/agent_log;' \
  +			-e 's;@@ServerRoot@@;$(prefix);g' \
  +			-e 's;logs/accept.lock;$(runtimedir)/$(TARGET).lock;' \
  +			-e 's;logs/apache_runtime_status;$(runtimedir)/$(TARGET).scoreboard;' \
  +			-e 's;logs/httpd.pid;$(runtimedir)/$(TARGET).pid;' \
  +			-e "s;logs/access_log;$(logfiledir)/$${target_prefix}access_log;" \
  +			-e "s;logs/error_log;$(logfiledir)/$${target_prefix}error_log;" \
  +			-e "s;logs/referer_log;$(logfiledir)/$${target_prefix}referer_log;" \
  +			-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;Group #-1;Group $(conf_group);' \
   			-e 's;Port 80;Port $(conf_port);' \
   			-e 's;ServerAdmin you@your.address;ServerAdmin $(conf_serveradmin);' \
   			-e 's;ServerName new.host.name;ServerName $(conf_servername);' \
  -        	> $(TOP)/$(SRC)/.apaci.install.tmp && \
  -		echo "$(INSTALL_DATA) $(TOP)/conf/$${conf}-dist[*] $(root)$(sysconfdir)/$${conf}.default"; \
  -		$(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sysconfdir)/$${conf}.default; \
  -		if [ ! -f "$(root)$(sysconfdir)/$${conf}" ]; then \
  -			echo "$(INSTALL_DATA) $(TOP)/conf/$${conf}-dist[*] $(root)$(sysconfdir)/$${conf}"; \
  -			$(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sysconfdir)/$${conf}; \
  +			> $(TOP)/$(SRC)/.apaci.install.tmp && \
  +		echo "$(INSTALL_DATA) $(TOP)/conf/$${conf}-dist[*] $(root)$(sysconfdir)/$${target_conf}.default"; \
  +		$(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sysconfdir)/$${target_conf}.default; \
  +		if [ ! -f "$(root)$(sysconfdir)/$${target_conf}" ]; then \
  +			echo "$(INSTALL_DATA) $(TOP)/conf/$${conf}-dist[*] $(root)$(sysconfdir)/$${target_conf}"; \
  +			$(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sysconfdir)/$${target_conf}; \
   		else \
  -			echo "[PRESERVING EXISTING CONFIG FILE: $(root)$(sysconfdir)/$${conf}]"; \
  +			echo "[PRESERVING EXISTING CONFIG FILE: $(root)$(sysconfdir)/$${target_conf}]"; \
   		fi; \
   	done
   	-@for conf in mime.types magic; do \
  @@ -427,7 +461,7 @@
   #   created by the build target
   clean:
   	@echo "===> $(SRC)"
  -	@$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) clean-std $(clean-support)
  +	@$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) clean-std $(clean-support)
   	@echo "<=== $(SRC)"
   	@$(RM) $(TOP)/$(SRC)/.apaci.build.ok
   
  @@ -450,14 +484,14 @@
   #   When --shadow is used we just remove the complete shadow tree.
   distclean:
   	@if [ ".$(SRC)" = .src ]; then \
  -		$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) distclean-normal; \
  +		$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) distclean-normal; \
   	else \
  -		$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) distclean-shadow; \
  +		$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) distclean-shadow; \
   	fi
   
   distclean-normal:
   	@echo "===> $(SRC)"
  -	@$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) distclean-std $(distclean-support)
  +	@$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) distclean-std $(distclean-support)
   	@echo "<=== $(SRC)"
   	-$(RM) $(SRC)/Configuration.apaci
   	-$(RM) $(SRC)/apaci
  @@ -480,7 +514,7 @@
   
   distclean-shadow:
   	$(RM) -r $(SRC)
  -	$(RM) $(MKF)
  +	$(RM) $(TOP)/$(MKF)
   	-@if [ ".`ls $(TOP)/src.* 2>/dev/null`" = . ]; then \
   		echo "$(RM) Makefile"; \
   		$(RM) Makefile; \
  
  
  
  1.2       +10 -5     apache-apr/pthreads/README.configure
  
  Index: README.configure
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/README.configure,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- README.configure	1999/01/21 23:08:29	1.1
  +++ README.configure	1999/02/07 06:28:59	1.2
  @@ -1,5 +1,5 @@
                                 
  -  A P A C H E   C O N F I G U R A T I O N
  +  APACHE CONFIGURATION
   
     Apache 1.3 Autoconf-style Interface (APACI)
     ===========================================
  @@ -98,7 +98,9 @@
        $ ./configure --prefix=/path/to/apache \
                      --enable-suexec \
                      --suexec-caller=www \
  -                   --suexec-userdir=.www
  +                   --suexec-userdir=.www \
  +                   --suexec-docroot=/path/to/root/dir \
  +                   --suexec-logfile=/path/to/logdir/suexec_log \
                      --suexec-uidmin=1000 \
                      --suexec-gidmin=1000 \
                      --suexec-safepath="/bin:/usr/bin"
  @@ -106,9 +108,12 @@
        $ make install
   
     This automatically builds and installs Apache 1.3 with suEXEC support for
  -  the caller uid "www" and the user's homedir subdirs ".www".  The access
  -  paths for the suexec program are automatically adjusted and the suexec
  -  program is installed, so Apache can find it on startup.
  +  the caller uid "www" and the user's homedir subdirs ".www". The default
  +  paths for --suexec-docroot is the value from the --datadir option with
  +  the suffix "/htdocs" and the --logfiledir value with the suffix
  +  "/suexec_log" for the --suexec-logfile option. The access paths for the
  +  suexec program are automatically adjusted and the suexec program is
  +  installed, so Apache can find it on startup.
   
     Building multiple platforms in parallel
     ---------------------------------------
  
  
  
  1.2       +426 -260  apache-apr/pthreads/configure
  
  Index: configure
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/configure,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- configure	1999/01/21 23:08:29	1.1
  +++ configure	1999/02/07 06:28:59	1.2
  @@ -1,6 +1,6 @@
   #!/bin/sh
   ## ====================================================================
  -## Copyright (c) 1998 The Apache Group.  All rights reserved.
  +## Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
   ##
   ## Redistribution and use in source and binary forms, with or without
   ## modification, are permitted provided that the following conditions
  @@ -58,7 +58,7 @@
   ##
   ##  configure -- Apache Autoconf-style Interface (APACI) 
   ##
  -##  Written by Ralf S. Engelschall <rs...@apache.org>
  +##  Initially written by Ralf S. Engelschall <rs...@apache.org>
   ##
   
   #   default input separator chars: <space><tab><cr>
  @@ -68,7 +68,6 @@
   ##
   ##  the paths to the Apache source tree
   ##
  -
   top=.
   mkf=Makefile
   src=src
  @@ -76,12 +75,14 @@
   sedsubst=src/.apaci.sedsubst
   addconf=src/.apaci.addconf
   tplconf=src/.apaci.tplconf
  +pldconf=src/.apaci.pldconf
  +configlayout=config.layout
   configstatus=config.status
  +shadow=''
   
   ##
   ##  pre-determine runtime modes
   ##
  -
   help=no
   quiet=no
   verbose=no
  @@ -95,8 +96,7 @@
   ##
   ##  display version information
   ##
  -
  -if [ ".$quiet" = .no ]; then
  +if [ "x$quiet" = "xno" ]; then
       APV=`cat $src/include/httpd.h |\
            grep "#define SERVER_BASEVERSION" |\
            sed -e 's/^[^"]*"//' -e 's/".*$//' -e 's/^Apache\///'`
  @@ -106,7 +106,6 @@
   ##
   ##  important hint for the first-time users
   ##
  -
   if [ $# -eq 0 ]; then
       echo " + Warning: Configuring Apache with default settings."
       echo " + This is probably not what you really want."
  @@ -118,10 +117,9 @@
   ##
   ##  determine path to (optional) Perl interpreter
   ##
  -
   PERL=no-perl-on-this-system
   perlpath="`$aux/PrintPath perl5 perl miniperl`"
  -if [ ".$perlpath" != . ]; then
  +if [ "x$perlpath" != "x" ]; then
       PERL="$perlpath"
   fi
   
  @@ -131,12 +129,11 @@
   ##  and if it then is still broken we give a warning message.
   ##  If it works set the `Safe Echo Option' (SEO) variable.
   ##
  -
   SEO='' # CHANGE THIS VARIABLE HERE IF YOU HAVE PROBLEMS WITH ECHO!
   bytes=`echo $SEO '\1' | wc -c | awk '{ printf("%s", $1); }'`
  -if [ ".$bytes" != .3 ]; then
  +if [ "x$bytes" != "x3" ]; then
       bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'`
  -    if [ ".$bytes" != .3 ]; then
  +    if [ "x$bytes" != "x3" ]; then
           echo " + Warning: Your 'echo' command is slightly broken."
           echo " + It interprets escape sequences per default. We already"
           echo " + tried 'echo -E' but had no real success. If errors occur"
  @@ -153,69 +150,69 @@
   ##  standard Awks are really braindead and cause 
   ##  problems for our scripts under some platforms.
   ##
  -
   AWK=awk
   awkpath="`$aux/PrintPath nawk gawk awk`"
  -if [ ".$awkpath" != . ]; then
  +if [ "x$awkpath" != "x" ]; then
       AWK="$awkpath"
   fi
   
   ##
  +## Look for a good tar. If we don't find 'GNU tar' then make
  +## sure ours can handle the '-h' (don't copy symlink, copy
  +## the actual data) option.
  +##
  +TAR=tar
  +tarpath="`$aux/PrintPath gtar gnutar tar`"
  +if [ "x$tarpath" != "x" ]; then
  +    TAR="$tarpath"
  +fi
  +case "`$TAR --version 2>/dev/null`" in
  +    *GNU*) TAROPT="-hcf" ;;
  +    *) if $TAR -hcf - Makefile.tmpl > /dev/null 2>&1
  +       then
  +           TAROPT="-hcf"
  +       else
  +           TAROPT="-cf"
  +       fi
  +       ;;
  +esac
  +
  +##
   ##  determine default parameters
   ##
   
   #   default paths
  -prefix='/usr/local/apache'
  -exec_prefix='$prefix'
  -bindir='$exec_prefix/bin'
  -sbindir='$exec_prefix/sbin'
  -libexecdir='$exec_prefix/libexec'
  -mandir='$prefix/man'
  -sysconfdir='$prefix/etc'
  -datadir='$prefix/share'
  -includedir='$prefix/include'
  -localstatedir='$prefix/var'
  -runtimedir='$localstatedir/run'
  -logfiledir='$localstatedir/log'
  -proxycachedir='$localstatedir/proxy'
  -
  -#   customization flags for
  -#   automatic "apache" suffix 
  -customized_sysconfdir=0
  -customized_datadir=0
  -customized_localstatedir=0
  -customized_includedir=0
  +prefix=UNSET
   
  -#   check and debug
  -layout=0
  +#   layout configuration
  +with_layout=0
  +show_layout=0
   
   #   suexec defaults
   suexec=0
   suexec_ok=0
  +suexec_docroot='$datadir/htdocs'
  +suexec_logexec='$logfiledir/suexec_log'
   suexec_caller=www
   suexec_userdir=public_html
   suexec_uidmin=100
   suexec_gidmin=100
   suexec_safepath="/usr/local/bin:/usr/bin:/bin"
   
  -#   with support tools
  +#   various other flags
   support=1
  -
  -#   with adjustments
   confadjust=1
  -
  -#   module ordering
   permute=''
   
   #   determine rules
  -rules=""
  -rulelist=""
  +rules=''
  +rulelist=''
   OIFS="$IFS" IFS='
   '
   for rule in `grep '^Rule' $src/Configuration.tmpl`; do
  -    rule=`echo "$rule" | sed -e 's/^Rule[ ]*//'`
  +    rule=`echo "$rule" | sed -e 's/^Rule[ 	]*//'`
       name=`echo "$rule" | sed -e 's/=.*$//'`
  -    namelow=`echo "$name" | tr "A-Z" "a-z"`
  +    namelow=`echo "$name" | tr 'A-Z' 'a-z'`
       arg=`echo "$rule" | sed -e 's/^.*=//'`
       eval "rule_$namelow=$arg"
       rules="$rules:$namelow"
  @@ -225,13 +222,11 @@
   rules=`echo $rules | sed -e 's/^://'`
   
   #   determine modules
  -rm -f $addconf 2>/dev/null
  -touch $addconf
  -modules=""
  -modulelist=""
  +modules=''
  +modulelist=''
   OIFS="$IFS" IFS='
   '
  -for module in `egrep '^[# ]*(Add|Shared)Module' $src/Configuration.tmpl`; do
  +for module in `egrep '^[# 	]*(Add|Shared)Module' $src/Configuration.tmpl`; do
       add=yes
       share=no
       if [ ".`echo $module | grep '^#'`" != . ]; then
  @@ -243,26 +238,27 @@
       module=`echo "$module" |\
               sed -e 's%^.*/\(.*\)$%\1%' \
                   -e 's/\.[oa]$//' \
  +                -e 's/\.module$//' \
                   -e 's/^mod_//' \
                   -e 's/^lib//'`
       eval "module_$module=$add"
       eval "shared_$module=$share"
       modules="${modules}:$module"
       modulelist="${modulelist}:$module=$add"
  -    if [ ".$share" = .yes ]; then
  +    if [ "x$share" = "xyes" ]; then
           modulelist="${modulelist}*"
       fi
   done
   IFS="$OIFS"
   modules=`echo $modules | sed -e 's/^://'`
   
  -#   backward compatibility from old src/Configuration.tmpl
  +#   backward compatibility for old src/Configuration.tmpl
   #   parameter names to the canonical Autoconf-style shell
   #   variable names.
   OIFS="$IFS" IFS="$DIFS"
   for var in CFLAGS LDFLAGS LIBS INCLUDES DEPS; do
       eval "val=\$EXTRA_$var"
  -    if [ ".$val" != . ]; then
  +    if [ "x$val" != "x" ]; then
           eval "$var=\$val"
           eval "EXTRA_$var=\"\"; export EXTRA_$var"
           echo " + Hint: please use $var instead of EXTRA_$var next time"
  @@ -270,55 +266,34 @@
   done
   IFS="$OIFS"
   
  -#   create a config status script for restoring
  -#   the configuration via a simple shell script
  -if [ ".$help" = .no ]; then
  -    rm -f $configstatus 2>/dev/null
  -    echo "#!/bin/sh" >$configstatus
  -    echo "##" >>$configstatus
  -    echo "##  $configstatus -- APACI auto-generated configuration restore script" >>$configstatus
  -    echo "##" >>$configstatus
  -    echo "##  Use this shell script to re-run the APACI configure script for" >>$configstatus
  -    echo "##  restoring your configuration. Additional parameters can be supplied." >>$configstatus
  -    echo "##" >>$configstatus
  -    echo "" >>$configstatus
  -    for var in CC CPP OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
  -               LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB; do
  -        eval "val=\"\$$var\""
  -        if [ ".$val" != . ]; then
  -            echo "$var=$val" |\
  -            sed -e 's:\(["$\\]\):\\\1:g' \
  -                -e 's:\([A-Z]*=\):\1":' \
  -                -e 's:$:" \\:' >>$configstatus
  +##
  +##  support for the default layout
  +##
  +case "$*" in
  +    *--with-layout=* ) 
  +        ;;
  +    * ) 
  +        if [ "x$*" = "x" ]; then
  +            set -- '--with-layout=Apache'
  +        else
  +            set -- '--with-layout=Apache' "$@"
           fi
  -    done
  -    if [ $# -eq 0 ]; then
  -        echo "./configure" >>$configstatus
  -    else
  -        echo $SEO "./configure \\" >>$configstatus
  -        for arg
  -        do
  -            echo "$arg" |\
  -            sed -e 's:\(["$\\]\):\\\1:g' \
  -                -e 's:^:":' \
  -                -e 's:$:" \\:' >>$configstatus
  -        done
  -    fi
  -    echo '"$@"' >>$configstatus
  -    echo '' >>$configstatus
  -    chmod a+x $configstatus
  -fi
  +        ;;
  +esac
   
   ##
  -##  parse argument line options
  +##  Iterate over the command line options the first time.
   ##
  -
  -apc_prev=""
  +##  This time we pre-process options which need high priority 
  +##  on the command line independent of their position, so they 
  +##  can be overridden by others.
  +##
  +apc_prev=''
   OIFS1="$IFS" IFS="$DIFS"
   for apc_option
   do
       #   if previous option needs an argument, assign it.
  -    if [ ".$apc_prev" != . ]; then
  +    if [ "x$apc_prev" != "x" ]; then
           eval "$apc_prev=\$apc_option"
           apc_prev=""
           continue
  @@ -328,31 +303,198 @@
           -*=*) apc_optarg=`echo "$apc_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
              *) apc_optarg= ;;
       esac
  +    #  pre-process only a few options now
  +    case "$apc_option" in
  +        --help | -h | -help )
  +            echo "Usage: configure [options]"
  +            echo "Options: [defaults in brackets after descriptions]"
  +            echo "General options:"
  +            echo " --quiet, --silent      do not print messages"
  +            echo " --verbose, -v          print even more messages"
  +            echo " --shadow[=DIR]         switch to a shadow tree (under DIR) for building"
  +            echo ""
  +            echo "Stand-alone options:"
  +            echo " --help, -h             print this message"
  +            echo " --show-layout          print installation path layout (check and debug)"
  +            echo ""
  +            echo "Installation layout options:"
  +            echo " --with-layout=[F:]ID   use installation path layout ID (from file F)"
  +            echo " --target=TARGET        install name-associated files using basename TARGET"
  +            echo " --prefix=PREFIX        install architecture-independent files in PREFIX"
  +            echo " --exec-prefix=EPREFIX  install architecture-dependent files in EPREFIX"
  +            echo " --bindir=DIR           install user     executables in DIR"
  +            echo " --sbindir=DIR          install sysadmin executables in DIR"
  +            echo " --libexecdir=DIR       install program  executables in DIR"
  +            echo " --mandir=DIR           install manual pages in DIR"
  +            echo " --sysconfdir=DIR       install configuration files in DIR"
  +            echo " --datadir=DIR          install read-only  data files in DIR"
  +            echo " --includedir=DIR       install includes files in DIR"
  +            echo " --localstatedir=DIR    install modifiable data files in DIR"
  +            echo " --runtimedir=DIR       install runtime data in DIR"
  +            echo " --logfiledir=DIR       install logfile data in DIR"
  +            echo " --proxycachedir=DIR    install proxy cache data in DIR"
  +            echo ""
  +            echo "Configuration options:"
  +            echo " --enable-rule=NAME     enable  a particular Rule named 'NAME'"
  +            echo " --disable-rule=NAME    disable a particular Rule named 'NAME'"
  +            $aux/ppl.sh $rulelist
  +            echo " --add-module=FILE      on-the-fly copy & activate a 3rd-party Module"
  +            echo " --activate-module=FILE on-the-fly activate existing 3rd-party Module"
  +            echo " --permute-module=N1:N2 on-the-fly permute module 'N1' with module 'N2'"
  +            echo " --enable-module=NAME   enable  a particular Module named 'NAME'"
  +            echo " --disable-module=NAME  disable a particular Module named 'NAME'"
  +            $aux/ppl.sh $modulelist
  +            echo " --enable-shared=NAME   enable  build of Module named 'NAME' as a DSO"
  +            echo " --disable-shared=NAME  disable build of Module named 'NAME' as a DSO"
  +            echo " --with-perl=FILE       path to the optional Perl interpreter"
  +            echo " --without-support      disable the build and installation of support tools"
  +            echo " --without-confadjust   disable the user/situation adjustments in config"
  +            echo ""
  +            echo "suEXEC options:"
  +            echo " --enable-suexec        enable the suEXEC feature"
  +            echo " --suexec-caller=NAME   set the suEXEC username of the allowed caller [$suexec_caller]"
  +            echo " --suexec-docroot=DIR   set the suEXEC root directory [PREFIX/share/htdocs]"
  +            echo " --suexec-logfile=FILE  set the suEXEC logfile [PREFIX/var/log/suexec_log]"
  +            echo " --suexec-userdir=DIR   set the suEXEC user subdirectory [$suexec_userdir]"
  +            echo " --suexec-uidmin=UID    set the suEXEC minimal allowed UID [$suexec_uidmin]"
  +            echo " --suexec-gidmin=GID    set the suEXEC minimal allowed GID [$suexec_gidmin]"
  +            echo " --suexec-safepath=PATH set the suEXEC safe PATH [$suexec_safepath]"
  +            echo ""
  +            echo "Deprecated options:"
  +            echo " --layout               backward compat only: use --show-layout"
  +            echo " --compat               backward compat only: use --with-layout=Apache"
  +            exit 0
  +            ;;
  +        --with-layout=*|--compat)
  +            if [ "x$apc_option" = "x--compat" ]; then
  +                apc_optarg="Apache"
  +            fi
  +            case $apc_optarg in
  +                *:* ) 
  +                    file=`echo $apc_optarg | sed -e 's/:.*//'`
  +                    name=`echo $apc_optarg | sed -e 's/.*://'`
  +                    ;;
  +                * ) 
  +                    name=$apc_optarg
  +                    file=$configlayout
  +                    ;;
  +            esac
  +            if [ ! -f "$file" ]; then
  +                echo "configure:Error: Path layout definition file $file not found" 1>&2
  +                exit 1
  +            fi
  +            sed -e "1,/[ 	]*<[Ll]ayout[ 	]*$name[ 	]*>[ 	]*/d" \
  +                -e '/[ 	]*<\/Layout>[ 	]*/,$d' \
  +                -e "s/^[ 	]*//g" \
  +                -e "s/:[ 	]*/=\'/g" \
  +                -e "s/[ 	]*$/'/g" \
  +                $file >$pldconf
  +            . $pldconf
  +            OIFS="$IFS" IFS="$DIFS"
  +            for var in prefix exec_prefix bindir sbindir libexecdir mandir \
  +                       sysconfdir datadir includedir localstatedir runtimedir \
  +                       logfiledir proxycachedir; do
  +                eval "val=\"\$$var\""
  +                case $val in
  +                    *+ )
  +                        val=`echo $val | sed -e 's;\+$;;'`
  +                        eval "$var=\"\$val\""
  +                        eval "autosuffix_$var=yes"
  +                        ;;
  +                    * )
  +                        eval "autosuffix_$var=no"
  +                        ;;
  +                esac
  +            done
  +            IFS="$OIFS"
  +            rm -f $pldconf 2>/dev/null
  +            if [ "x$prefix" = "xUNSET" ]; then
  +                echo "configure:Error: Path layout definition not found or incorrect" 1>&2
  +                exit 1
  +            fi
  +            if [ "x$quiet" = "xno" ]; then
  +                echo " + using installation path layout: $name ($file)"
  +            fi
  +            with_layout=1
  +            ;;
  +        *)
  +            ;;
  +    esac
  +done
   
  +##
  +##  Iterate over the command line options the second time.
  +##
  +##  This time we parse the standard options.
  +##
  +addconf_created=0
  +apc_prev=''
  +OIFS1="$IFS" IFS="$DIFS"
  +for apc_option
  +do
  +    #   if previous option needs an argument, assign it.
  +    if [ "x$apc_prev" != "x" ]; then
  +        eval "$apc_prev=\$apc_option"
  +        apc_prev=""
  +        continue
  +    fi
  +    #   split out arguments
  +    case "$apc_option" in
  +        -*=*) apc_optarg=`echo "$apc_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  +           *) apc_optarg= ;;
  +    esac
       #  accept only the most important GNU Autoconf-style options
       case "$apc_option" in
  +        --help|-h|-help|--with-layout=*|-compat)
  +            #   just ignore already parsed options
  +            ;;
           --quiet | --silent) 
               quiet=yes
               ;;
           --verbose | -v)
               verbose=yes
               ;;
  -        --shadow)
  +        --shadow*)
  +            #   if we use an external shadow tree, first shadow all of ourself
  +            #   to this tree and switch over to to it for internal (=platform)
  +            #   shadowing...
  +            case "$apc_option" in
  +                --shadow=*)
  +                    shadow="$apc_optarg"
  +                    if [ "x$quiet" = "xno" ]; then
  +                        echo " + creating external package shadow tree ($shadow)"
  +                    fi
  +                    rm -rf $shadow 2>/dev/null
  +                    $aux/mkshadow.sh . $shadow
  +                    for file in $mkf $sedsubst $addconf $tplconf $pldconf $configstatus; do
  +                        rm -f $shadow/$file 2>/dev/null
  +                    done
  +                    if [ "x$quiet" = "xno" ]; then
  +                        echo " + switching to external package shadow tree ($shadow)"
  +                    fi
  +                    cd $shadow
  +                    ;;
  +            esac
               #   determine GNU platform triple
               gnutriple=`$aux/GuessOS | sed -e 's:/:-:g' | $AWK '{ printf("%s",$1); }'`
               #   create Makefile wrapper (the first time only)
               if [ ".`ls $top/src.* 2>/dev/null`" = . ]; then
  -                if [ .$quiet = .no ]; then
  +                if [ "x$quiet" = "xno" ]; then
                       echo " + creating Makefile (shadow wrapper)"
                   fi
                   echo "##" > Makefile
                   echo "##  Apache Makefile (shadow wrapper)" >> Makefile
                   echo "##" >> Makefile
                   echo "" >> Makefile
  +                if [ "x$shadow" != "x" ]; then
  +                    echo "SHADOW=$shadow" >> Makefile
  +                else
  +                    echo "SHADOW=." >> Makefile
  +                fi
                   echo "GNUTRIPLE=\`$aux/GuessOS | sed -e 's:/:-:g' | $AWK '{ printf(\"%s\",\$\$1); }'\`" >> Makefile
                   echo "" >> Makefile
                   echo "all build install install-quiet clean distclean:" >> Makefile
  -                echo "	@\$(MAKE) -f Makefile.\$(GNUTRIPLE) \$(MFLAGS) \$@" >> Makefile
  +                echo "	@cd \$(SHADOW); \$(MAKE) -f Makefile.\$(GNUTRIPLE) \$(MFLAGS) \$@" >> Makefile
                   echo "" >> Makefile
               fi
               #   set shadow paths
  @@ -363,8 +505,8 @@
               shadowaddconf="src.$gnutriple/.apaci.addconf"
               shadowtplconf="src.$gnutriple/.apaci.tplconf"
               #   (re)create shadow tree
  -            if [ .$quiet = .no ]; then
  -                echo " + create shadow tree ($shadowsrc)"
  +            if [ "x$quiet" = "xno" ]; then
  +                echo " + creating internal platform shadow tree ($shadowsrc)"
               fi
               rm -rf $shadowsrc
               $aux/mkshadow.sh $src $shadowsrc
  @@ -373,129 +515,66 @@
               src=$shadowsrc
               aux=$shadowaux
               sedsubst=$shadowsedsubst
  -            rm -f $addconf 2>/dev/null
               addconf=$shadowaddconf
  -            rm -f $addconf 2>/dev/null
  -            touch $addconf
               tplconf=$shadowtplconf
               ;;
  -        --help | -h | -help )
  -            echo "Usage: configure [options]"
  -            echo "Options: [defaults in brackets after descriptions]"
  -            echo "General options:"
  -            echo " --quiet, --silent      do not print messages"
  -            echo " --verbose, -v          print even more messages"
  -            echo " --shadow               switch to a shadow tree for building"
  -            echo ""
  -            echo "Stand-alone options:"
  -            echo " --help, -h             print this message"
  -            echo " --layout               print installation layout (check and debug)"
  -            echo ""
  -            echo "Installation layout options:"
  -            echo " --prefix=PREFIX        install architecture-independent files in PREFIX"
  -            echo " --exec-prefix=EPREFIX  install architecture-dependent files in EPREFIX"
  -            echo " --bindir=DIR           install user     executables in DIR  [EPREFIX/bin]"
  -            echo " --sbindir=DIR          install sysadmin executables in DIR  [EPREFIX/sbin]"
  -            echo " --libexecdir=DIR       install program  executables in DIR  [EPREFIX/libexec]"
  -            echo " --mandir=DIR           install manual pages in DIR          [PREFIX/man]"
  -            echo " --sysconfdir=DIR       install configuration files in DIR   [PREFIX/etc]"
  -            echo " --datadir=DIR          install read-only  data files in DIR [PREFIX/share]"
  -            echo " --includedir=DIR       install includes files in DIR        [PREFIX/include]"
  -            echo " --localstatedir=DIR    install modifiable data files in DIR [PREFIX/var]"
  -            echo " --runtimedir=DIR       install runtime data in DIR          [PREFIX/var/run]"
  -            echo " --logfiledir=DIR       install logfile data in DIR          [PREFIX/var/log]"
  -            echo " --proxycachedir=DIR    install proxy cache data in DIR      [PREFIX/var/proxy]"
  -            echo " --compat               install with old Apache 1.2 installation paths"
  -            echo ""
  -            echo "Configuration options:"
  -            echo " --enable-rule=NAME     enable  a particular Rule named 'NAME'"
  -            echo " --disable-rule=NAME    disable a particular Rule named 'NAME'"
  -            $aux/ppl.sh $rulelist
  -            echo " --add-module=FILE      on-the-fly copy & activate a third-party Module source"
  -            echo " --activate-module=FILE on-the-fly activate existing third-party Module source"
  -            echo " --permute-module=N1:N2 permute module 'N1' with module 'N2' in the configuration"
  -            echo " --enable-module=NAME   enable  a particular Module named 'NAME'"
  -            echo " --disable-module=NAME  disable a particular Module named 'NAME'"
  -            $aux/ppl.sh $modulelist
  -            echo " --enable-shared=NAME   enable  build of Module named 'NAME' as a shared object"
  -            echo " --disable-shared=NAME  disable build of Module named 'NAME' as a shared object"
  -            echo " --with-perl=FILE       set the path to the optional Perl interpreter to use"
  -            echo " --without-support      disable the build and installation of support tools"
  -            echo " --without-confadjust   disable some build user/situation adjustments to config files"
  -            echo ""
  -            echo "suEXEC options:"
  -            echo " --enable-suexec        enable the suEXEC feature"
  -            echo " --suexec-caller=NAME   set the suEXEC username of the allowed caller [$suexec_caller]"
  -            echo " --suexec-userdir=DIR   set the suEXEC user subdirectory [$suexec_userdir]"
  -            echo " --suexec-uidmin=UID    set the suEXEC minimal allowed UID [$suexec_uidmin]"
  -            echo " --suexec-gidmin=GID    set the suEXEC minimal allowed GID [$suexec_gidmin]"
  -            echo " --suexec-safepath=PATH set the suEXEC safe PATH [$suexec_safepath]"
  -            echo ""
  -            exit 0
  +        --show-layout|--layout)
  +            show_layout=1
               ;;
  -        --layout)
  -            layout=1
  +        --target=*)
  +            TARGET="$apc_optarg"
               ;;
           --prefix=*)
               prefix="$apc_optarg"
  +            autosuffix_prefix=no
               ;;
           --exec-prefix=*)
               exec_prefix="$apc_optarg"
  +            autosuffix_exec_prefix=no
               ;;
           --bindir=*)       
               bindir="$apc_optarg"
  +            autosuffix_bindir=no
               ;;
           --sbindir=*)       
               sbindir="$apc_optarg"
  +            autosuffix_sbindir=no
               ;;
           --libexecdir=*)
               libexecdir="$apc_optarg"    
  +            autosuffix_libexecdir=no
               ;;
           --mandir=*)        
               mandir="$apc_optarg"        
  +            autosuffix_mandir=no
               ;;
           --sysconfdir=*)    
               sysconfdir="$apc_optarg"    
  -            customized_sysconfdir=1
  +            autosuffix_sysconfdir=no
               ;;
           --datadir=*)       
               datadir="$apc_optarg"       
  -            customized_datadir=1
  +            autosuffix_datadir=no
               ;;
           --includedir=*)       
               includedir="$apc_optarg"       
  -            customized_includedir=1
  +            autosuffix_includedir=no
               ;;
           --localstatedir=*) 
               localstatedir="$apc_optarg" 
  -            customized_localstatedir=1
  +            autosuffix_localstatedir=no
               ;;
           --runtimedir=*) 
               runtimedir="$apc_optarg" 
  +            autosuffix_runtimedir=no
               ;;
           --logfiledir=*) 
               logfiledir="$apc_optarg" 
  +            autosuffix_logfiledir=no
               ;;
           --proxycachedir=*) 
               proxycachedir="$apc_optarg" 
  -            ;;
  -        --compat) 
  -            exec_prefix='$prefix'
  -            bindir='$exec_prefix/bin'
  -            sbindir='$exec_prefix/bin'
  -            libexecdir='$exec_prefix/libexec'
  -            mandir='$prefix/man'
  -            sysconfdir='$prefix/conf'
  -            datadir='$prefix'
  -            includedir='$prefix/include'
  -            localstatedir='$prefix'
  -            runtimedir='$localstatedir/logs'
  -            logfiledir='$localstatedir/logs'
  -            proxycachedir='$localstatedir/proxy'
  -            customized_sysconfdir=1
  -            customized_datadir=1
  -            customized_localstatedir=1
  -            customized_includedir=1
  +            autosuffix_proxycachedir=no
               ;;
           --add-module=*) 
               file="$apc_optarg"
  @@ -509,9 +588,14 @@
               fi
               modfilec=`echo $file | sed -e 's;^.*/;;'`
               modfileo=`echo $file | sed -e 's;^.*/;;' -e 's;\.c$;.o;'`
  -            if [ ".$file" != ".$src/modules/extra/$modfilec" ]; then
  +            if [ "x$file" != "x$src/modules/extra/$modfilec" ]; then
                   cp $file $src/modules/extra/$modfilec
               fi
  +            if [ "x$addconf_created" = "x0" ]; then
  +                addconf_created=1
  +                rm -f $addconf 2>/dev/null
  +                touch $addconf 2>/dev/null
  +            fi
               echo "" >>$addconf
               echo "## On-the-fly added module" >>$addconf
               echo "## (configure --add-module=$file)" >>$addconf
  @@ -525,7 +609,7 @@
               eval "shared_$module=no"
               modules="${modules}:$module"
               modulelist="${modulelist}:$module=yes"
  -            if [ ".$quiet" = .no ]; then
  +            if [ "x$quiet" = "xno" ]; then
                   echo " + on-the-fly added and activated $module module (modules/extra/$modfileo)"
               fi
               ;;
  @@ -538,6 +622,11 @@
                       ;;
               esac
               modfile=`echo $file | sed -e 's;^src/;;'`
  +            if [ "x$addconf_created" = "x0" ]; then
  +                addconf_created=1
  +                rm -f $addconf 2>/dev/null
  +                touch $addconf 2>/dev/null
  +            fi
               echo "" >>$addconf
               echo "## On-the-fly activated module" >>$addconf
               echo "## (configure --activate-module=$file)" >>$addconf
  @@ -551,7 +640,7 @@
               eval "shared_$module=no"
               modules="${modules}:$module"
               modulelist="${modulelist}:$module=yes"
  -            if [ ".$quiet" = .no ]; then
  +            if [ "x$quiet" = "xno" ]; then
                   echo " + activated $module module ($modfile)"
               fi
               ;;
  @@ -567,7 +656,7 @@
                       apc_optarg=`echo "$apc_optarg" | tr "A-Z" "a-z"`
                       apc_optarg_real=`echo "$apc_optarg" | tr "a-z" "A-Z"`
                       eval "exists=\$rule_${apc_optarg}" 
  -                    if [ ".$exists" = . ]; then
  +                    if [ "x$exists" = "x" ]; then
                           echo "configure:Error: No such rule named '${apc_optarg_real}'" 1>&2
                           exit 1
                       fi
  @@ -597,7 +686,7 @@
                              ;;
                          * ) 
                              eval "exists=\$module_${apc_optarg}" 
  -                           if [ ".$exists" = . ]; then
  +                           if [ "x$exists" = "x" ]; then
                                  echo "configure:Error: No such module named '${apc_optarg}'" 1>&2
                                  exit 1
                              fi
  @@ -619,7 +708,7 @@
                              OIFS="$IFS" IFS=':'
                              for module in $modules; do
                                  eval "add=\$module_${module}" 
  -                               if [ ".$add" = .no ]; then
  +                               if [ "x$add" = "xno" ]; then
                                      eval "module_${module}=yes" 
                                      eval "shared_${module}=yes" 
                                  fi
  @@ -629,7 +718,7 @@
                              ;;
                          * ) 
                              eval "exists=\$module_${apc_optarg}" 
  -                           if [ ".$exists" = . ]; then
  +                           if [ "x$exists" = "x" ]; then
                                  echo "configure:Error: No such module named '${apc_optarg}'" 1>&2
                                  exit 1
                              fi
  @@ -654,7 +743,7 @@
                       apc_optarg=`echo "$apc_optarg" | tr "A-Z" "a-z"`
                       apc_optarg_real=`echo "$apc_optarg" | tr "a-z" "A-Z"`
                       eval "exists=\$rule_${apc_optarg}" 
  -                    if [ ".$exists" = . ]; then
  +                    if [ "x$exists" = "x" ]; then
                           echo "configure:Error: No such rule named '${apc_optarg_real}'" 1>&2
                           exit 1
                       fi
  @@ -671,7 +760,7 @@
                              ;;
                          * ) 
                              eval "exists=\$module_${apc_optarg}" 
  -                           if [ ".$exists" = . ]; then
  +                           if [ "x$exists" = "x" ]; then
                                  echo "configure:Error: No such module named '${apc_optarg}'" 1>&2
                                  exit 1
                              fi
  @@ -690,7 +779,7 @@
                              ;;
                          * ) 
                              eval "exists=\$module_${apc_optarg}" 
  -                           if [ ".$exists" = . ]; then
  +                           if [ "x$exists" = "x" ]; then
                                  echo "configure:Error: No such module named '${apc_optarg}'" 1>&2
                                  exit 1
                              fi
  @@ -708,7 +797,7 @@
                       BEGIN|END)
                           ;;
                       *)  eval "exists=\$module_${mod}" 
  -                        if [ ".$exists" = . ]; then
  +                        if [ "x$exists" = "x" ]; then
                               echo "configure:Error: No such module named '${mod}'" 1>&2
                               exit 1
                           fi
  @@ -736,6 +825,14 @@
               suexec_caller="$apc_optarg"
               suexec_ok=1
               ;;
  +        --suexec-docroot=*)
  +            suexec_docroot="$apc_optarg"
  +            suexec_ok=1
  +            ;;
  +        --suexec-logfile=*)
  +            suexec_logexec="$apc_optarg"
  +            suexec_ok=1
  +            ;;
           --suexec-userdir=*)
               suexec_userdir="$apc_optarg"
               suexec_ok=1
  @@ -759,16 +856,55 @@
       esac
   done
   IFS="$OIFS1"
  -if [ ".$apc_prev" != . ]; then
  +if [ "x$apc_prev" != "x" ]; then
       echo "configure:Error: missing argument to --`echo $apc_prev | sed 's/_/-/g'`" 1>&2
       exit 1
   fi
  +if [ "x$addconf_created" = "x0" ]; then
  +    rm -f $addconf 2>/dev/null
  +    touch $addconf 2>/dev/null
  +fi
  +
  +##
  +##   create a config status script for restoring
  +##   the configuration via a simple shell script
  +##
  +rm -f $configstatus 2>/dev/null
  +echo "#!/bin/sh" >$configstatus
  +echo "##" >>$configstatus
  +echo "##  $configstatus -- APACI auto-generated configuration restore script" >>$configstatus
  +echo "##" >>$configstatus
  +echo "##  Use this shell script to re-run the APACI configure script for" >>$configstatus
  +echo "##  restoring your configuration. Additional parameters can be supplied." >>$configstatus
  +echo "##" >>$configstatus
  +echo "" >>$configstatus
  +for var in CC CPP OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
  +           LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB DEPS TARGET; do
  +    eval "val=\"\$$var\""
  +    if [ "x$val" != "x" ]; then
  +        echo "$var=$val" |\
  +        sed -e 's:\(["$\\]\):\\\1:g' \
  +            -e 's:\([A-Z]*=\):\1":' \
  +            -e 's:$:" \\:' >>$configstatus
  +    fi
  +done
  +echo $SEO "./configure \\" >>$configstatus
  +for arg
  +do
  +    echo "$arg" |\
  +    sed -e 's:\(["$\\]\):\\\1:g' \
  +        -e 's:^:":' \
  +        -e 's:$:" \\:' >>$configstatus
  +done
  +echo '"$@"' >>$configstatus
  +echo '' >>$configstatus
  +chmod a+x $configstatus
   
   ##
  -##  a few errors
  +##  a few errors and warnings
   ##
  -if [ ".$suexec" = .1 ]; then
  -    if [ ".$suexec_ok" = .0 ]; then
  +if [ "x$suexec" = "x1" ]; then
  +    if [ "x$suexec_ok" = "x0" ]; then
           echo "configure:Error: You enabled the suEXEC feature via --enable-suexec but"
           echo "                 without explicitly configuring it via at least one"
           echo "                 --suexec-xxxxx option. Seems like you are still not"
  @@ -776,65 +912,63 @@
           echo "                 and htdocs/manual/suexec.html documents first."
           exit 1
       fi
  -fi
  -
  -##
  -##  a few warnings
  -##
  -if [ ".$suexec" = .1 ]; then
       if [ ".`id | grep root`" = . ]; then
           echo " + Warning: You enabled the suEXEC feature. Be aware that you need" 1>&2
           echo " + root privileges for this, at the latest at the installation step." 1>&2
       fi
   fi
  -if [ ".$PERL" = .no-perl-on-this-system ]; then
  -    if [ .$quiet = .no ]; then
  +if [ "x$PERL" = "xno-perl-on-this-system" ]; then
  +    if [ "x$quiet" = "xno" ]; then
           echo " + Warning: no Perl interpreter available for support scripts."
           echo " + Perhaps you have to select one with --with-perl=FILE."
       fi
   fi
   
   ##
  +##  target name
  +##
  +if [ "x$TARGET" != "x" ]; then
  +    thetarget=$TARGET
  +else
  +    thetarget=httpd
  +fi
  +
  +##
   ##  expand path variables and make sure
   ##  they do not end with a backslash
   ##
   OIFS="$IFS" IFS="$DIFS"
  -for var in prefix exec_prefix bindir sbindir \
  -           libexecdir mandir sysconfdir datadir \
  -           includedir localstatedir runtimedir \
  -           logfiledir proxycachedir; do
  +for var in prefix exec_prefix bindir sbindir libexecdir mandir \
  +           sysconfdir datadir includedir localstatedir runtimedir \
  +           logfiledir proxycachedir suexec_docroot suexec_logexec; do
       eval "val=\"\$$var\"";
       val=`echo $val | sed -e 's:/*$::'`
       eval "$var=\"$val\""
  -    case $var in
  -       libexecdir|sysconfdir|datadir|localstatedir|includedir ) 
  -           eval "val=\$$var"
  -           case $val in
  -               *apache | *apache* ) ;;
  -               * ) eval "customized=\$customized_$var"
  -                   if [ ".$customized" = .0 ]; then
  -                       eval "$var=\"\$$var/apache\""
  -                   fi
  -                   ;;
  -           esac
  -           ;;
  -    esac
  +    #   expand value
  +    eval "val=\$$var"
  +    #   add target suffix when requested
  +    if [ ".`echo $val | grep $thetarget`" = . ]; then
  +        eval "autosuffix=\$autosuffix_$var"
  +        if [ "x$autosuffix" = "xyes" ]; then
  +            eval "$var=\"\$$var/$thetarget\""
  +        fi
  +    fi
   done
   IFS="$OIFS"
   
   ##
   ##  determine special configurable Makefile targets
   ##
  -if [ ".$support" = .1 ]; then
  -      build_support=build-support
  -    install_support=install-support
  -      clean_support=clean-support
  -  distclean_support=distclean-support
  +if [ "x$support" = "x1" ]; then
  +    build_support='build-support'
  +    install_support='install-support'
  +    clean_support='clean-support'
  +    distclean_support='distclean-support'
   else
  -      build_support=
  -    install_support=
  -      clean_support=
  -  distclean_support=
  +    build_support=''
  +    install_support=''
  +    clean_support=''
  +    distclean_support=''
   fi
   
   ##
  @@ -844,7 +978,7 @@
   conf_port="80"
   conf_serveradmin="you@your.address"
   conf_servername="new.host.name"
  -if [ ".$confadjust" = .1 ]; then
  +if [ "x$confadjust" = "x1" ]; then
       if [ ".`egrep '^nobody:' /etc/group`" != . ]; then
           conf_group="nobody"
       else
  @@ -876,7 +1010,7 @@
   ##
   ##  check and debug
   ##
  -if [ ".$layout" = .1 ]; then
  +if [ "x$show_layout" = "x1" ]; then
       echo ""
       echo "Installation paths:"
       echo "               prefix: $prefix"
  @@ -895,33 +1029,46 @@
       echo ""
       echo "Compilation paths:"
       echo "           HTTPD_ROOT: $prefix"
  -    echo "           SUEXEC_BIN: $sbindir/suexec"
       echo "      SHARED_CORE_DIR: $libexecdir"
  -    echo "       DEFAULT_PIDLOG: ${runtimedir_relative}httpd.pid"
  -    echo "   DEFAULT_SCOREBOARD: ${runtimedir_relative}httpd.scoreboard"
  -    echo "     DEFAULT_LOCKFILE: ${runtimedir_relative}httpd.lock"
  +    echo "       DEFAULT_PIDLOG: ${runtimedir_relative}${thetarget}.pid"
  +    echo "   DEFAULT_SCOREBOARD: ${runtimedir_relative}${thetarget}.scoreboard"
  +    echo "     DEFAULT_LOCKFILE: ${runtimedir_relative}${thetarget}.lock"
       echo "      DEFAULT_XFERLOG: ${logfiledir_relative}access_log"
       echo "     DEFAULT_ERRORLOG: ${logfiledir_relative}error_log"
       echo "    TYPES_CONFIG_FILE: ${sysconfdir_relative}mime.types"
  -    echo "   SERVER_CONFIG_FILE: ${sysconfdir_relative}httpd.conf"
  +    echo "   SERVER_CONFIG_FILE: ${sysconfdir_relative}${thetarget}.conf"
       echo "   ACCESS_CONFIG_FILE: ${sysconfdir_relative}access.conf"
       echo " RESOURCE_CONFIG_FILE: ${sysconfdir_relative}srm.conf"
       echo ""
  +    if [ "x$suexec" = "x1" ]; then
  +        echo "suEXEC setup:"
  +        echo "        suexec binary: $sbindir/suexec"
  +        echo "        document root: $suexec_docroot"
  +        echo "       userdir suffix: $suexec_userdir"
  +        echo "              logfile: $suexec_logexec"
  +        echo "            safe path: $suexec_safepath"
  +        echo "            caller ID: $suexec_caller"
  +        echo "      minimum user ID: $suexec_uidmin"
  +        echo "     minimum group ID: $suexec_gidmin"
  +        echo ""
  +    fi
       exit 0
   fi
   
   ##
   ##  create Makefile from Makefile.tmpl
   ##
  -if [ .$quiet = .no ]; then
  +if [ "x$quiet" = "xno" ]; then
       echo "Creating $mkf"
   fi
   sed <Makefile.tmpl >$mkf \
   -e "s%@PERL@%$PERL%g" \
  --e "s%@TOP@%$top%g" \
  +-e "s%@TAR@%$TAR%g" \
  +-e "s%@TAROPT@%$TAROPT%g" \
   -e "s%@SRC@%$src%g" \
   -e "s%@MKF@%$mkf%g" \
   -e "s%@AUX@%$aux%g" \
  +-e "s%@TARGET@%$thetarget%g" \
   -e "s%@prefix@%$prefix%g" \
   -e "s%@exec_prefix@%$exec_prefix%g" \
   -e "s%@bindir@%$bindir%g" \
  @@ -938,6 +1085,8 @@
   -e "s%@proxycachedir@%$proxycachedir%g" \
   -e "s%@suexec@%$suexec%g" \
   -e "s%@suexec_caller@%$suexec_caller%g" \
  +-e "s%@suexec_docroot@%$suexec_docroot%g" \
  +-e "s%@suexec_logexec@%$suexec_logexec%g" \
   -e "s%@suexec_userdir@%$suexec_userdir%g" \
   -e "s%@suexec_uidmin@%$suexec_uidmin%g" \
   -e "s%@suexec_gidmin@%$suexec_gidmin%g" \
  @@ -962,13 +1111,13 @@
   echo "echo '-DHTTPD_ROOT=\"$prefix\"'" >>$src/apaci
   echo "echo '-DSUEXEC_BIN=\"$sbindir/suexec\"'" >>$src/apaci
   echo "echo '-DSHARED_CORE_DIR=\"$libexecdir\"'" >>$src/apaci
  -echo "echo '-DDEFAULT_PIDLOG=\"${runtimedir_relative}httpd.pid\"'" >>$src/apaci
  -echo "echo '-DDEFAULT_SCOREBOARD=\"${runtimedir_relative}httpd.scoreboard\"'" >>$src/apaci
  -echo "echo '-DDEFAULT_LOCKFILE=\"${runtimedir_relative}httpd.lock\"'" >>$src/apaci
  +echo "echo '-DDEFAULT_PIDLOG=\"${runtimedir_relative}${thetarget}.pid\"'" >>$src/apaci
  +echo "echo '-DDEFAULT_SCOREBOARD=\"${runtimedir_relative}${thetarget}.scoreboard\"'" >>$src/apaci
  +echo "echo '-DDEFAULT_LOCKFILE=\"${runtimedir_relative}${thetarget}.lock\"'" >>$src/apaci
   echo "echo '-DDEFAULT_XFERLOG=\"${logfiledir_relative}access_log\"'" >>$src/apaci
   echo "echo '-DDEFAULT_ERRORLOG=\"${logfiledir_relative}error_log\"'" >>$src/apaci
   echo "echo '-DTYPES_CONFIG_FILE=\"${sysconfdir_relative}mime.types\"'" >>$src/apaci
  -echo "echo '-DSERVER_CONFIG_FILE=\"${sysconfdir_relative}httpd.conf\"'" >>$src/apaci
  +echo "echo '-DSERVER_CONFIG_FILE=\"${sysconfdir_relative}${thetarget}.conf\"'" >>$src/apaci
   echo "echo '-DACCESS_CONFIG_FILE=\"${sysconfdir_relative}access.conf\"'" >>$src/apaci
   echo "echo '-DRESOURCE_CONFIG_FILE=\"${sysconfdir_relative}srm.conf\"'" >>$src/apaci
   chmod a+x $src/apaci
  @@ -977,7 +1126,7 @@
   ##
   ##  create $src/Configuration.apaci file
   ##
  -if [ .$quiet = .no ]; then
  +if [ "x$quiet" = "xno" ]; then
       echo "Creating Configuration.apaci in $src"
   fi
   rm -f $sedsubst 2>/dev/null
  @@ -986,9 +1135,9 @@
   #   generate settings from imported environment variables
   OIFS="$IFS" IFS="$DIFS"
   for var in CC CPP OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
  -           LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB DEPS; do
  +           LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB DEPS TARGET; do
       eval "val=\"\$$var\"";
  -    if [ ".$val" != . ]; then
  +    if [ "x$val" != "x" ]; then
           case $var in 
               CFLAGS|LDFLAGS|LIBS|INCLUDES|DEPS) 
                   echo $SEO "s%^#*\\(EXTRA_$var=\\).*%\\1$val%g" >>$sedsubst
  @@ -1008,7 +1157,7 @@
       name="`echo $rule | tr "a-z" "A-Z"`"
       eval "val=\$rule_$rule"
       echo $SEO "s%^\\(Rule $name=\\).*%\\1$val%g" >>$sedsubst
  -    if [ $verbose = yes ]; then
  +    if [ "x$verbose" = "xyes" ]; then
           echo " + Rule $name=$val"
       fi
   done
  @@ -1019,27 +1168,27 @@
   OIFS="$IFS" IFS=':'
   for module in $modules; do
       eval "share=\$shared_$module"
  -    if [ $share = yes ]; then
  +    if [ "x$share" = "xyes" ]; then
           some_shares=1
       fi
   done
   IFS="$OIFS"
  -if [ $some_shares = 1 ]; then
  -    if [ $module_so = no ]; then
  +if [ "x$some_shares" = "x1" ]; then
  +    if [ "x$module_so" = "xno" ]; then
           module_so=yes
  -        if [ .$quiet = .no ]; then
  +        if [ "x$quiet" = "xno" ]; then
               echo " + enabling mod_so for DSO support"
           fi
       fi
   fi
  -if [ ".$shared_so" = .yes ]; then
  +if [ "x$shared_so" = "xyes" ]; then
       shared_so=no
       echo "configure:Error: Module mod_so cannot be made a DSO itself" 1>&2
       exit 1
   fi
   
   #   module permutation support
  -if [ ".$permute" != . ]; then
  +if [ "x$permute" != "x" ]; then
       sed -e '/## mod_mmap_static/,$d' <src/Configuration.tmpl >$tplconf
       OIFS="$IFS" IFS='
   '
  @@ -1047,6 +1196,7 @@
           name=`echo "$line" |\
                 sed -e 's%^.*/\(.*\)$%\1%' \
                     -e 's/\.[oa]$//' \
  +                  -e 's/\.module$//' \
                     -e 's/^mod_//' \
                     -e 's/^lib//'`
           echo "${name}:${line}"
  @@ -1113,21 +1263,21 @@
   OIFS="$IFS" IFS=':'
   for module in $modules; do
       eval "add=\$module_$module"
  -    if [ $add = yes ]; then
  -        echo $SEO "s%^.*\\(AddModule.*$module\\..*\\)%\\1%g" >>$sedsubst
  -        echo $SEO "s%^.*\\(SharedModule.*$module\\..*\\)%\\1%g" >>$sedsubst
  +    if [ "x$add" = "xyes" ]; then
  +        echo $SEO "s%^.*\\(AddModule.*[_b/]$module\\..*\\)%\\1%g" >>$sedsubst
  +        echo $SEO "s%^.*\\(SharedModule.*[_b/]$module\\..*\\)%\\1%g" >>$sedsubst
           m="yes [static]"
       else
  -        echo $SEO "s%^.*\\(AddModule.*$module\\..*\\)%# \\1%g" >>$sedsubst
  -        echo $SEO "s%^.*\\(SharedModule.*$module\\..*\\)%# \\1%g" >>$sedsubst
  +        echo $SEO "s%^.*\\(AddModule.*[_b/]$module\\..*\\)%# \\1%g" >>$sedsubst
  +        echo $SEO "s%^.*\\(SharedModule.*[_b/]$module\\..*\\)%# \\1%g" >>$sedsubst
           m=no
       fi
       eval "share=\$shared_$module"
  -    if [ $share = yes ]; then
  -        echo $SEO "s%^\\(.*\\)AddModule\\(.*$module\\.\\)[oa]\\(.*\\)%\\1SharedModule\\2so\\3%g" >>$sedsubst
  +    if [ "x$share" = "xyes" ]; then
  +        echo $SEO "s%^\\(.*\\)AddModule\\(.*[_b/]$module\\.\\)[oam].*\\(.*\\)%\\1SharedModule\\2so\\3%g" >>$sedsubst
           m="yes [shared]"
       fi
  -    if [ $verbose = yes ]; then
  +    if [ "x$verbose" = "xyes" ]; then
           echo " + Module $module: $m"
       fi
   done
  @@ -1168,12 +1318,28 @@
   ##  create all other Makefiles by running the proprietary 
   ##  $src/Configure script with our custom Configuration.apaci file
   ##
  -if [ .$quiet = .yes ]; then
  +if [ "x$quiet" = "xyes" ]; then
       (cd $src; ./Configure -file Configuration.apaci >/dev/null);
   else
       (cd $src; ./Configure -file Configuration.apaci |\
        sed -e '/^Using config file:.*/d' \
            -e "s:Makefile in :Makefile in $src\\/:" \
            -e "s:Makefile\$:Makefile in $src:")
  +fi
  +
  +##
  +##  final hints
  +##
  +if [ "x$quiet" = "xno" ]; then
  +    if [ "x$shadow" != "x" ]; then
  +        echo "Hint: You now have to build inside $shadow."
  +        echo "This can be done either by running the canonical commands"
  +        echo "  \$ cd $shadow"
  +        echo "  \$ make"
  +        echo "  \$ make install"
  +        echo "or by running this alternative commands"
  +        echo "  \$ make -f $shadow/Makefile"
  +        echo "  \$ make -f $shadow/Makefile install"
  +    fi
   fi
   
  
  
  
  1.1                  apache-apr/pthreads/config.layout
  
  Index: config.layout
  ===================================================================
  ##
  ##  config.layout -- APACI Pre-defined Installation Path Layouts
  ##
  ##  Hints:
  ##  - layouts can be loaded with APACI's --with-layout=ID option
  ##  - when no --with-layout option is given, the default layout is `Apache'
  ##  - a trailing plus character (`+') on paths is replaced with a 
  ##    `/<target>' suffix where <target> is the the argument from 
  ##    option --target (defaults to `httpd').
  ##
  
  #   Classical Apache path layout.
  <Layout Apache>
      prefix:        /usr/local/apache
      exec_prefix:   $prefix
      bindir:        $exec_prefix/bin
      sbindir:       $exec_prefix/bin
      libexecdir:    $exec_prefix/libexec
      mandir:        $prefix/man
      sysconfdir:    $prefix/conf
      datadir:       $prefix
      includedir:    $prefix/include
      localstatedir: $prefix
      runtimedir:    $localstatedir/logs
      logfiledir:    $localstatedir/logs
      proxycachedir: $localstatedir/proxy
  </Layout>
  
  #   GNU standards conforming path layout.
  #   See FSF's GNU project `make-stds' document for details.
  <Layout GNU>
      prefix:        /usr/local
      exec_prefix:   $prefix
      bindir:        $exec_prefix/bin
      sbindir:       $exec_prefix/sbin
      libexecdir:    $exec_prefix/libexec
      mandir:        $prefix/man
      sysconfdir:    $prefix/etc+
      datadir:       $prefix/share+
      includedir:    $prefix/include+
      localstatedir: $prefix/var+
      runtimedir:    $localstatedir/run
      logfiledir:    $localstatedir/log
      proxycachedir: $localstatedir/proxy
  </Layout>
  
  #   Apache binary distribution path layout
  <Layout BinaryDistribution>
      prefix:        /usr/local/apache
      exec_prefix:
      bindir:        bin
      sbindir:       bin
      libexecdir:    libexec
      mandir:        man
      sysconfdir:    conf
      datadir:
      includedir:    include
      localstatedir:
      runtimedir:    logs
      logfiledir:    logs
      proxycachedir: proxy
  </Layout>
  
  
  
  1.2       +59 -16    apache-apr/pthreads/conf/httpd.conf-dist
  
  Index: httpd.conf-dist
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/conf/httpd.conf-dist,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- httpd.conf-dist	1999/01/21 23:08:29	1.1
  +++ httpd.conf-dist	1999/02/07 06:29:01	1.2
  @@ -111,7 +111,7 @@
   #
   # MaxKeepAliveRequests: The maximum number of requests to allow
   # during a persistent connection. Set to 0 to allow an unlimited amount.
  -# We reccomend you leave this number high, for maximum performance.
  +# We recommend you leave this number high, for maximum performance.
   #
   MaxKeepAliveRequests 100
   
  @@ -326,6 +326,23 @@
   UserDir public_html
   
   #
  +# Control access to UserDir directories.  The following is an example
  +# for a site where these directories are restricted to read-only.
  +#
  +#<Directory /*/public_html>
  +#    AllowOverride FileInfo AuthConfig Limit
  +#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
  +#    <Limit GET POST OPTIONS PROPFIND>
  +#        Order allow,deny
  +#        Allow from all
  +#    </Limit>
  +#    <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
  +#        Order deny,allow
  +#        Deny from all
  +#    </Limit>
  +#</Directory>
  +
  +#
   # DirectoryIndex: Name of the file or files to use as a pre-written HTML
   # directory index.  Separate multiple entries with spaces.
   #
  @@ -476,6 +493,13 @@
   #
   Alias /icons/ "@@ServerRoot@@/icons/"
   
  +<Directory "@@ServerRoot@@/icons">
  +    Options Indexes MultiViews
  +    AllowOverride None
  +    Order allow,deny
  +    Allow from all
  +</Directory>
  +
   #
   # ScriptAlias: This controls which directories contain server scripts.
   # ScriptAliases are essentially the same as Aliases, except that
  @@ -493,6 +517,8 @@
   <Directory "@@ServerRoot@@/cgi-bin">
       AllowOverride None
       Options None
  +    Order allow,deny
  +    Allow from all
   </Directory>
   
   #
  @@ -585,7 +611,7 @@
   # AddEncoding allows you to have certain browsers (Mosaic/X 2.1+) uncompress
   # information on the fly. Note: Not all browsers support this.
   # Despite the name similarity, the following Add* directives have nothing
  -# to do with the FancyIndexing customisation directives above.
  +# to do with the FancyIndexing customization directives above.
   #
   AddEncoding x-compress Z
   AddEncoding x-gzip gz
  @@ -697,9 +723,9 @@
   #  request will *not* be available to such a script.
   
   #
  -# The following directives disable keepalives and HTTP header flushes.
  -# The first directive disables it for Netscape 2.x and browsers which
  -# spoof it. There are known problems with these.
  +# The following directives modify normal HTTP response behavior.
  +# The first directive disables keepalive for Netscape 2.x and browsers that
  +# spoof it. There are known problems with these browser implementations.
   # The second directive is for Microsoft Internet Explorer 4.0b2
   # which has a broken HTTP/1.1 implementation and does not properly
   # support keepalive when it is used on 301 or 302 (redirect) responses.
  @@ -752,10 +778,17 @@
   #</Location>
   
   #
  -# Proxy Server directives. Uncomment the following line to
  +# Proxy Server directives. Uncomment the following lines to
   # enable the proxy server:
   #
  +#<IfModule mod_proxy.c>
   #ProxyRequests On
  +#
  +#<Directory proxy:*>
  +#    Order deny,allow
  +#    Deny from all
  +#    Allow from .your_domain.com
  +#</Directory>
   
   #
   # Enable/disable the handling of HTTP/1.1 "Via:" headers.
  @@ -776,25 +809,35 @@
   #CacheDefaultExpire 1
   #NoCache a_domain.com another_domain.edu joes.garage_sale.com
   
  +#</IfModule>
  +# End of proxy directives.
  +
   ### Section 3: Virtual Hosts
   #
  +# VirtualHost: If you want to maintain multiple domains/hostnames on your
  +# machine you can setup VirtualHost containers for them.
  +# Please see the documentation at <URL:http://www.apache.org/docs/vhosts/>
  +# for further details before you try to setup virtual hosts.
  +# You may use the command line option '-S' to verify your virtual host
  +# configuration.
  +
  +#
  +# If you want to use name-based virtual hosts you need to define at
  +# least one IP address (and port number) for them.
  +#
  +#NameVirtualHost 12.34.56.78:80
  +#NameVirtualHost 12.34.56.78
   
   #
  -# VirtualHost: Allows the daemon to respond to requests for more than one
  -# server address, if your server machine is configured to accept IP packets
  -# for multiple addresses. This can be accomplished with the ifconfig 
  -# alias flag, or through kernel patches like VIF.
  -#
  -# Almost any Apache directive may go into a VirtualHost# container.
  -# See the documentation at <URL:http://www.apache.org/docs/vhosts.html>, and
  -# also the BindAddress entry.
  +# VirtualHost example:
  +# Almost any Apache directive may go into a VirtualHost container.
   #
  -#<VirtualHost host.some_domain.com>
  +#<VirtualHost ip.address.of.host.some_domain.com>
   #    ServerAdmin webmaster@host.some_domain.com
   #    DocumentRoot /www/docs/host.some_domain.com
   #    ServerName host.some_domain.com
   #    ErrorLog logs/host.some_domain.com-error_log
  -#    TransferLog logs/host.some_domain.com-access_log
  +#    CustomLog logs/host.some_domain.com-access_log common
   #</VirtualHost>
   
   #<VirtualHost _default_:*>
  
  
  
  1.2       +17 -10    apache-apr/pthreads/conf/httpd.conf-dist-win
  
  Index: httpd.conf-dist-win
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/conf/httpd.conf-dist-win,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- httpd.conf-dist-win	1999/01/21 23:08:29	1.1
  +++ httpd.conf-dist-win	1999/02/07 06:29:01	1.2
  @@ -749,23 +749,30 @@
   
   ### Section 3: Virtual Hosts
   #
  +# VirtualHost: If you want to maintain multiple domains/hostnames on your
  +# machine you can setup VirtualHost containers for them.
  +# Please see the documentation at <URL:http://www.apache.org/docs/vhosts/>
  +# for further details before you try to setup virtual hosts.
  +# You may use the command line option '-S' to verify your virtual host
  +# configuration.
   
   #
  -# VirtualHost: Allows the daemon to respond to requests for more than one
  -# server address, if your server machine is configured to accept IP packets
  -# for multiple addresses. This can be accomplished with the ifconfig 
  -# alias flag, or through kernel patches like VIF.
  +# If you want to use name-based virtual hosts you need to define at
  +# least one IP address (and port number) for them.
   #
  -# Almost any Apache directive may go into a VirtualHost# container.
  -# See the documentation at <URL:http://www.apache.org/docs/vhosts.html>, and
  -# also the BindAddress entry.
  +#NameVirtualHost 12.34.56.78:80
  +#NameVirtualHost 12.34.56.78
  +
  +#
  +# VirtualHost example:
  +# Almost any Apache directive may go into a VirtualHost container.
   #
  -#<VirtualHost host.some_domain.com>
  +#<VirtualHost ip.address.of.host.some_domain.com>
   #    ServerAdmin webmaster@host.some_domain.com
   #    DocumentRoot /www/docs/host.some_domain.com
   #    ServerName host.some_domain.com
  -#    ErrorLog logs/host.some_domain.com-error.log
  -#    TransferLog logs/host.some_domain.com-access.log
  +#    ErrorLog logs/host.some_domain.com-error_log
  +#    CustomLog logs/host.some_domain.com-access_log common
   #</VirtualHost>
   
   #<VirtualHost _default_:*>
  
  
  
  1.2       +178 -15   apache-apr/pthreads/conf/mime.types
  
  Index: mime.types
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/conf/mime.types,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mime.types	1999/01/21 23:08:29	1.1
  +++ mime.types	1999/02/07 06:29:01	1.2
  @@ -1,51 +1,175 @@
  -# This file controls what MIME types are sent to the client for the
  -# given file extensions.  Sending the correct MIME type to the client
  +# This is a comment. I love comments.
  +
  +# This file controls what Internet media types are sent to the client for
  +# given file extension(s).  Sending the correct media type to the client
   # is important so they know how to handle the content of the file.
   # Extra types can either be added here or by using an AddType directive
  -# in your config files. For more information about MIME types
  -# please read RFC 2045, 2046, 2047, 2048, and 2077.
  +# in your config files. For more information about Internet media types,
  +# please read RFC 2045, 2046, 2047, 2048, and 2077.  The Internet media type
  +# registry is at <ftp://ftp.iana.org/in-notes/iana/assignments/media-types/>.
   
   # MIME type			Extension
  +application/EDI-Consent
  +application/EDI-X12
  +application/EDIFACT
   application/activemessage
  -application/andrew-inset
  +application/andrew-inset	ez
   application/applefile
   application/atomicmail
  +application/cals-1840
  +application/commonground
  +application/cybercash
   application/dca-rft
   application/dec-dx
  +application/eshop
  +application/hyperstudio
  +application/iges
   application/mac-binhex40	hqx
   application/mac-compactpro	cpt
   application/macwriteii
  +application/marc
  +application/mathematica
   application/msword		doc
   application/news-message-id
   application/news-transmission
   application/octet-stream	bin dms lha lzh exe class
   application/oda			oda
   application/pdf			pdf
  +application/pgp-encrypted
  +application/pgp-keys
  +application/pgp-signature
  +application/pkcs10
  +application/pkcs7-mime
  +application/pkcs7-signature
   application/postscript		ai eps ps
  -application/powerpoint		ppt
  +application/prs.alvestrand.titrax-sheet
  +application/prs.cww
  +application/prs.nprend
   application/remote-printing
  +application/riscos
   application/rtf			rtf
  +application/set-payment
  +application/set-payment-initiation
  +application/set-registration
  +application/set-registration-initiation
  +application/sgml
  +application/sgml-open-catalog
   application/slate
  -application/smil		smi smil sml
  +application/smil		smi smil
  +application/vemmi
  +application/vnd.3M.Post-it-Notes
  +application/vnd.FloGraphIt
  +application/vnd.acucobol
  +application/vnd.anser-web-certificate-issue-initiation
  +application/vnd.anser-web-funds-transfer-initiation
  +application/vnd.audiograph
  +application/vnd.businessobjects
  +application/vnd.claymore
  +application/vnd.comsocaller
  +application/vnd.dna
  +application/vnd.dxr
  +application/vnd.ecdis-update
  +application/vnd.ecowin.chart
  +application/vnd.ecowin.filerequest
  +application/vnd.ecowin.fileupdate
  +application/vnd.ecowin.series
  +application/vnd.ecowin.seriesrequest
  +application/vnd.ecowin.seriesupdate
  +application/vnd.enliven
  +application/vnd.epson.salt
  +application/vnd.fdf
  +application/vnd.ffsns
  +application/vnd.framemaker
  +application/vnd.fujitsu.oasys
  +application/vnd.fujitsu.oasys2
  +application/vnd.fujitsu.oasys3
  +application/vnd.fujitsu.oasysgp
  +application/vnd.fujitsu.oasysprs
  +application/vnd.fujixerox.docuworks
  +application/vnd.hp-HPGL
  +application/vnd.hp-PCL
  +application/vnd.hp-PCLXL
  +application/vnd.hp-hps
  +application/vnd.ibm.MiniPay
  +application/vnd.ibm.modcap
  +application/vnd.intercon.formnet
  +application/vnd.intertrust.digibox
  +application/vnd.intertrust.nncp
  +application/vnd.is-xpr
  +application/vnd.japannet-directory-service
  +application/vnd.japannet-jpnstore-wakeup
  +application/vnd.japannet-payment-wakeup
  +application/vnd.japannet-registration
  +application/vnd.japannet-registration-wakeup
  +application/vnd.japannet-setstore-wakeup
  +application/vnd.japannet-verification
  +application/vnd.japannet-verification-wakeup
  +application/vnd.koan
  +application/vnd.lotus-1-2-3
  +application/vnd.lotus-approach
  +application/vnd.lotus-freelance
  +application/vnd.lotus-organizer
  +application/vnd.lotus-screencam
  +application/vnd.lotus-wordpro
  +application/vnd.meridian-slingshot
  +application/vnd.mif		mif
  +application/vnd.minisoft-hp3000-save
  +application/vnd.mitsubishi.misty-guard.trustweb
  +application/vnd.ms-artgalry
  +application/vnd.ms-asf
  +application/vnd.ms-excel
  +application/vnd.ms-powerpoint	ppt
  +application/vnd.ms-project
  +application/vnd.ms-tnef
  +application/vnd.ms-works
  +application/vnd.music-niff
  +application/vnd.musician
  +application/vnd.netfpx
  +application/vnd.noblenet-directory
  +application/vnd.noblenet-sealer
  +application/vnd.noblenet-web
  +application/vnd.novadigm.EDM
  +application/vnd.novadigm.EDX
  +application/vnd.novadigm.EXT
  +application/vnd.osa.netdeploy
  +application/vnd.powerbuilder6
  +application/vnd.powerbuilder6-s
  +application/vnd.rapid
  +application/vnd.seemail
  +application/vnd.shana.informed.formtemplate
  +application/vnd.shana.informed.interchange
  +application/vnd.shana.informed.package
  +application/vnd.street-stream
  +application/vnd.svd
  +application/vnd.swiftview-ics
  +application/vnd.truedoc
  +application/vnd.visio
  +application/vnd.webturbo
  +application/vnd.wrq-hp3000-labelled
  +application/vnd.wt.stf
  +application/vnd.xara
  +application/vnd.yellowriver-custom-menu
   application/wita
   application/wordperfect5.1
   application/x-bcpio		bcpio
   application/x-cdlink		vcd
  +application/x-chess-pgn		pgn
   application/x-compress
   application/x-cpio		cpio
   application/x-csh		csh
   application/x-director		dcr dir dxr
   application/x-dvi		dvi
  +application/x-futuresplash	spl
   application/x-gtar		gtar
   application/x-gzip
   application/x-hdf		hdf
   application/x-javascript	js
   application/x-koan		skp skd skt skm
   application/x-latex		latex
  -application/x-mif		mif
   application/x-netcdf		nc cdf
   application/x-sh		sh
   application/x-shar		shar
  +application/x-shockwave-flash	swf
   application/x-stuffit		sit
   application/x-sv4cpio		sv4cpio
   application/x-sv4crc		sv4crc
  @@ -59,21 +183,35 @@
   application/x-troff-ms		ms
   application/x-ustar		ustar
   application/x-wais-source	src
  +application/x400-bp
  +application/xml
   application/zip			zip
  +audio/32kadpcm
   audio/basic			au snd
   audio/midi			mid midi kar
   audio/mpeg			mpga mp2 mp3
  +audio/vnd.qcelp
   audio/x-aiff			aif aiff aifc
  -audio/x-pn-realaudio		ram
  +audio/x-pn-realaudio		ram rm
   audio/x-pn-realaudio-plugin	rpm
   audio/x-realaudio		ra
   audio/x-wav			wav
   chemical/x-pdb			pdb xyz
  +image/cgm
  +image/g3fax
   image/gif			gif
   image/ief			ief
   image/jpeg			jpeg jpg jpe
  +image/naplps
   image/png			png
  +image/prs.btif
   image/tiff			tiff tif
  +image/vnd.dwg
  +image/vnd.dxf
  +image/vnd.fpx
  +image/vnd.net-fpx
  +image/vnd.svf
  +image/vnd.xiff
   image/x-cmu-raster		ras
   image/x-portable-anymap		pnm
   image/x-portable-bitmap		pbm
  @@ -83,30 +221,55 @@
   image/x-xbitmap			xbm
   image/x-xpixmap			xpm
   image/x-xwindowdump		xwd
  +message/delivery-status
  +message/disposition-notification
   message/external-body
  +message/http
   message/news
   message/partial
   message/rfc822
   model/iges			igs iges
  -model/vrml			wrl vrml
   model/mesh			msh mesh silo
  +model/vnd.dwf
  +model/vrml			wrl vrml
   multipart/alternative
   multipart/appledouble
  +multipart/byteranges
   multipart/digest
  +multipart/encrypted
  +multipart/form-data
  +multipart/header-set
   multipart/mixed
   multipart/parallel
  +multipart/related
  +multipart/report
  +multipart/signed
  +multipart/voice-message
   text/css			css
  +text/directory
  +text/enriched
   text/html			html htm
  -text/plain			txt
  +text/plain			asc txt
  +text/prs.lines.tag
  +text/rfc822-headers
   text/richtext			rtx
  +text/rtf			rtf
  +text/sgml			sgml sgm
   text/tab-separated-values	tsv
  +text/uri-list
  +text/vnd.abc
  +text/vnd.flatland.3dml
  +text/vnd.fmi.flexstor
  +text/vnd.in3d.3dml
  +text/vnd.in3d.spot
  +text/vnd.latex-z
   text/x-setext			etx
  -text/x-sgml			sgml sgm
  -text/xml			xml dtd
  +text/xml			xml
   video/mpeg			mpeg mpg mpe
   video/quicktime			qt mov
  +video/vnd.motorola.video
  +video/vnd.motorola.videop
  +video/vnd.vivo
   video/x-msvideo			avi
   video/x-sgi-movie		movie
   x-conference/x-cooltalk		ice
  -
  -# This is a comment. I love comments.
  
  
  
  1.2       +5 -8      apache-apr/pthreads/icons/README
  
  Index: README
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/icons/README,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- README	1999/01/21 23:08:30	1.1
  +++ README	1999/02/07 06:29:03	1.2
  @@ -3,19 +3,16 @@
        These icons were originally made for Mosaic for X and have been
        included in the NCSA httpd and Apache server distributions in the
        past. They are in the public domain and may be freely included in any
  -     application. The originals were done by Kevin Hughes (kevinh@eit.com).
  +     application. The originals were done by Kevin Hughes 
  +     (kevinh@kevcom.com).
   
        Many thanks to Andy Polyakov for tuning the icon colors and adding a
        few new images. If you'd like to contribute additions or ideas to
        this set, please let me know.
   
  -     The distribution site for these icons is at:
  -
  -          http://www.eit.com/goodies/www.icons/
  -
  -     Kevin Hughes
  -     September 11, 1995
  -
  +     Almost all of these icons are 20x22 pixels in size.  There are
  +     alternative icons in the "small" directory that are 16x16 in size,
  +     provided by Mike Brown (mike@hyperreal.org).
   
   Suggested Uses
   
  
  
  
  1.1                  apache-apr/pthreads/icons/small/README.txt
  
  Index: README.txt
  ===================================================================
  
  These icons are provided as an alternative to the standard Apache
  icon graphics.  All graphics in this directory, with the exception
  of rainbow.gif, are 16x16 pixels in size, rather than the 20x22
  dimension icons which are the normal defaults for Apache and are
  in the parent directory of this one.
  
  
  
  1.1                  apache-apr/pthreads/icons/small/back.gif
  
  Index: back.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/binary.gif
  
  Index: binary.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/binhex.gif
  
  Index: binhex.gif
  ===================================================================
  GIF89a
  O��Ɇ��Q&�qVL��l���#�m�p8�H
  
  
  1.1                  apache-apr/pthreads/icons/small/blank.gif
  
  Index: blank.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/broken.gif
  
  Index: broken.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/burst.gif
  
  Index: burst.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/comp1.gif
  
  Index: comp1.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/comp2.gif
  
  Index: comp2.gif
  ===================================================================
  GIF89a
  ��0�pċ�eR��:�IR4:����0�Ep���x\L
  
  
  1.1                  apache-apr/pthreads/icons/small/compressed.gif
  
  Index: compressed.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/continued.gif
  
  Index: continued.gif
  ===================================================================
  GIF89a
  �E� ]�
  �i���bp�����-HǓ�Ti:��G
  
  
  1.1                  apache-apr/pthreads/icons/small/dir.gif
  
  Index: dir.gif
  ===================================================================
  GIF89a
  �t���`$e��P	8 ����]��n�$
  
  
  1.1                  apache-apr/pthreads/icons/small/dir2.gif
  
  Index: dir2.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/doc.gif
  
  Index: doc.gif
  ===================================================================
  GIF89a
  !���#(���E
  
  
  1.1                  apache-apr/pthreads/icons/small/forward.gif
  
  Index: forward.gif
  ===================================================================
  GIF89a
  �������.r$
  
  
  1.1                  apache-apr/pthreads/icons/small/generic.gif
  
  Index: generic.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/generic2.gif
  
  Index: generic2.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/generic3.gif
  
  Index: generic3.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/image.gif
  
  Index: image.gif
  ===================================================================
  GIF89a
  �s���(�!x�al� ���o#LJ�
�0�m@�{�іT�z��Tp.�˅@���	
  
  
  1.1                  apache-apr/pthreads/icons/small/image2.gif
  
  Index: image2.gif
  ===================================================================
  GIF89a
  �w�FQ��N-����X"�ʡGt@i��f����[�h��z�L
  
  
  1.1                  apache-apr/pthreads/icons/small/index.gif
  
  Index: index.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/key.gif
  
  Index: key.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/movie.gif
  
  Index: movie.gif
  ===================================================================
  GIF89a
  �(�R���X$ر�x&У���^GY)��
i���+���NW
  �J�
  
  
  1.1                  apache-apr/pthreads/icons/small/patch.gif
  
  Index: patch.gif
  ===================================================================
  GIF89a
  �!]���jRS�&����
 	
  
  
  1.1                  apache-apr/pthreads/icons/small/ps.gif
  
  Index: ps.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/rainbow.gif
  
  Index: rainbow.gif
  ===================================================================
  GIF87a/
  b���@�l��Yj�U+�-�x���;7��e����[lL�0t�X�x��)&"�`C�M�:`ټ��gyB�m�t��WX�Z�k�(b�PC[
��Z�n�ˆo�q��9@�@��9�$�s��ǘ>��u�%��h½���"Ȅ'CF�y�@�+Y�ލ{7
  �+P��>)��|ٿ���/
  	w�P�J,%�X�-���ˋ0
  �3&S��8#M
  V��c6An�H�cNK��;����PIe>WP@[�e���>@M�Dfb4�j~t�n�tRqιR�u”�MN�٧N��S�����M��T�B�U�\Q ĥbdjh��V
n�%*��p�^����� kb�يk��UFYf�;,��k�������,��1`n���[��m�!�ms�un��@nڝ�x�w��@(�nP�޼��'�}��o����+��&� �OR�_�0��hXJ�N�
  ,Ӳ�-�
  )J�[��%B�Z��߾"M
�p�B'��8�.e@�T5�W��r�Sc�]��W��L�8Gќ.u�c]�d����nZպ]����q�[�^�<�`y�Z��%�L^{��^����}���<� �J��BZX,��I�#�,4�����0��0x��,���Q3�	�hR0g�|RϮ��*YI�Y�	���pLe��4�5��q
  ]�ó�Dm:�ӟ�V�#&�)wkTޚ�J�m��\�b8�!�-r!1��/v�rd��4GR]u�s�ь�>�Җڡ��Iֲ�غ��&ZҪ� o��g[?U$t��H�!�\�B�w��T�b2^���}�����G|�(�1�T�R}J�&<�0�Ѳ~��ֺK���B��_Ȇ1W���	d�˘��=<0�6� :.�A
F�
  A��@�,��a�V�r��Q��9�PN�tI�v�C�D�=b?E(C)�5�A��Z�,�+���W��L����h�Q��q0�iEz+��
  �)�
��R��q5�j
u�5�����iw{zD&2��id���(o�I�$z�:��g��Ԟ���P�W@�#�)�ծF�}�x%�\VS�UD#r��̱��o�2"���/�����7��$���I$��`��{�������¦-ıb�Hd��N�ĝp��f�&�;��{B�NF����
�w�U�B�*[J�p��8Q���T���::��f��n>ir�+,�����JM���,g����v��]�n���Y$y������F����ծw��z�'9
��]���@�)�߂U��S��2d���/D�H+����^��Er%�0-|ᔥ
  ��Š�����No�Y@F':t'8pnF���6>1D�TDs���D�Uo
  ue
%[��)��8Z�[]�*�39�+�rph�p
  �F��p�W:�ww�,Z�z��g�!;W-�DH�e��-�%<#7.�I)i��<�6=�I���i��=��s�/Z�_��s��J�
  
  
  1.1                  apache-apr/pthreads/icons/small/sound.gif
  
  Index: sound.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/sound2.gif
  
  Index: sound2.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/tar.gif
  
  Index: tar.gif
  ===================================================================
  GIF89a
  ��Zw�^Q��U�3��2;���/3�
  �Sq���G)6��v�*���6�x<�-
  
  
  1.1                  apache-apr/pthreads/icons/small/text.gif
  
  Index: text.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/transfer.gif
  
  Index: transfer.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/unknown.gif
  
  Index: unknown.gif
  ===================================================================
  GIF89a
  
  
  1.1                  apache-apr/pthreads/icons/small/uu.gif
  
  Index: uu.gif
  ===================================================================
  GIF89a
  
  
  1.2       +329 -0    apache-apr/pthreads/src/ApacheCore.def
  
  Index: ApacheCore.def
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/ApacheCore.def,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ApacheCore.def	1999/01/21 23:08:31	1.1
  +++ ApacheCore.def	1999/02/07 06:29:08	1.2
  @@ -1 +1,330 @@
  +; apachecore.def : 
  +
   LIBRARY ApacheCore
  +DESCRIPTION ''
  +
  +EXPORTS
  +	; Add new API calls to the end of this list.
  +	ap_MD5Final   @1
  +	ap_MD5Init   @2
  +	ap_MD5Update   @3
  +	ap_acquire_mutex   @4
  +	ap_add_cgi_vars	  @5
  +	ap_add_common_vars   @6
  +	ap_add_loaded_module   @7
  +	ap_add_module   @8
  +	ap_add_named_module   @9
  +	ap_add_per_dir_conf   @10
  +	ap_add_per_url_conf   @11
  +	ap_add_version_component   @12
  +	ap_allow_options   @13
  +	ap_allow_overrides   @14
  +	ap_append_arrays   @15
  +	ap_array_cat   @16
  +	ap_auth_name   @17
  +	ap_auth_type   @18
  +	ap_basic_http_header   @19
  +	ap_bclose   @20
  +	ap_bcreate   @21
  +	ap_bfilbuf   @22
  +	ap_bfileno   @23
  +	ap_bflsbuf   @24
  +	ap_bflush   @25
  +	ap_bgetopt   @26
  +	ap_bgets   @27
  +	ap_bhalfduplex   @28
  +	ap_block_alarms   @29
  +	ap_blookc   @30
  +	ap_bnonblock   @31
  +	ap_bonerror   @32
  +	ap_bpushfd   @33
  +	ap_bpushh   @34
  +	ap_bputs   @35
  +	ap_bread   @36
  +	ap_bsetflag   @37
  +	ap_bsetopt   @38
  +	ap_bskiplf   @39
  +	ap_bspawn_child   @40
  +	ap_bwrite   @41
  +	ap_bytes_in_free_blocks   @42
  +	ap_bytes_in_pool   @43
  +	ap_call_exec   @44
  +	ap_can_exec   @45
  +	ap_cfg_closefile   @46
  +	ap_cfg_getc   @47
  +	ap_cfg_getline   @48
  +	ap_chdir_file   @49
  +	ap_check_alarm   @50
  +	ap_check_cmd_context   @51
  +	ap_checkmask   @52
  +	ap_cleanup_for_exec   @53
  +	ap_clear_module_list   @54
  +	ap_clear_pool   @55
  +	ap_clear_table   @56
  +	ap_close_piped_log   @57
  +	ap_construct_server   @58
  +	ap_construct_url   @59
  +	ap_content_type_tolower   @60
  +	ap_copy_array   @61
  +	ap_copy_array_hdr   @62
  +	ap_copy_table   @63
  +	ap_count_dirs   @64
  +	ap_cpystrn   @65
  +	ap_create_environment   @66
  +	ap_create_mutex   @67
  +	ap_create_per_dir_config   @68
  +	ap_custom_response   @69
  +	ap_default_port_for_request   @70
  +	ap_default_port_for_scheme   @71
  +	ap_default_type   @72
  +	ap_destroy_mutex   @73
  +	ap_destroy_pool   @74
  +	ap_destroy_sub_req   @75
  +	ap_die   @76
  +	ap_discard_request_body   @77
  +	ap_document_root   @78
  +	ap_each_byterange   @79
  +	ap_error_log2stderr   @80
  +	ap_escape_html   @81
  +	ap_escape_path_segment   @82
  +	ap_escape_quotes   @83
  +	ap_escape_shell_cmd   @84
  +	ap_exists_scoreboard_image   @85
  +	ap_finalize_request_protocol   @86
  +	ap_find_command   @87
  +	ap_find_command_in_modules   @88
  +	ap_find_last_token   @89
  +	ap_find_linked_module   @90
  +	ap_find_module_name   @91
  +	ap_find_path_info   @92
  +	ap_find_token   @93
  +	ap_get_basic_auth_pw   @94
  +	ap_get_client_block   @95
  +	ap_get_gmtoff   @96
  +	ap_get_limit_req_body   @97
  +	ap_get_remote_host   @98
  +	ap_get_remote_logname   @99
  +	ap_get_server_built   @100
  +	ap_get_server_name   @101
  +	ap_get_server_port   @102
  +	ap_get_server_version   @103
  +	ap_get_time   @104
  +	ap_get_token   @105
  +	ap_getparents   @106
  +	ap_getword   @107
  +	ap_getword_conf   @108
  +	ap_getword_conf_nc   @109
  +	ap_getword_nc   @110
  +	ap_getword_nulls   @111
  +	ap_getword_nulls_nc   @112
  +	ap_getword_white   @113
  +	ap_getword_white_nc   @114
  +	ap_gm_timestr_822   @115
  +	ap_gname2id   @116
  +	ap_handle_command   @117
  +	ap_hard_timeout   @118
  +	ap_ht_time   @119
  +	ap_ind   @120
  +	ap_index_of_response   @121
  +	ap_init_virtual_host   @122
  +	ap_internal_redirect   @123
  +	ap_internal_redirect_handler   @124
  +	ap_is_directory   @125
  +	ap_is_fnmatch   @126
  +	ap_is_initial_req   @127
  +	ap_is_matchexp   @128
  +	ap_is_url   @129
  +	ap_kill_cleanup   @130
  +	ap_kill_cleanups_for_fd   @131
  +	ap_kill_cleanups_for_socket   @132
  +	ap_kill_timeout   @133
  +	ap_log_assert   @134
  +	ap_log_error_old   @135
  +	ap_log_reason   @136
  +	ap_log_unixerr   @137
  +	ap_make_array   @138
  +	ap_make_dirstr   @139
  +	ap_make_dirstr_parent   @140
  +	ap_make_dirstr_prefix   @141
  +	ap_make_full_path   @142
  +	ap_make_sub_pool   @143
  +	ap_make_table   @144
  +	ap_matches_request_vhost   @145
  +	ap_md5   @146
  +	ap_md5_binary   @147
  +	ap_md5contextTo64   @148
  +	ap_md5digest   @149
  +	ap_meets_conditions   @150
  +	ap_no2slash   @151
  +	ap_note_auth_failure   @152
  +	ap_note_basic_auth_failure   @153
  +	ap_note_cleanups_for_fd   @154
  +	ap_note_cleanups_for_file   @155
  +	ap_note_cleanups_for_h   @156
  +	ap_note_cleanups_for_socket   @157
  +	ap_note_digest_auth_failure   @158
  +	ap_note_subprocess   @159
  +	ap_open_mutex   @160
  +	ap_open_piped_log   @161
  +	ap_os_canonical_filename   @162
  +	ap_os_escape_path   @163
  +	ap_overlap_tables   @164
  +	ap_overlay_tables   @165
  +	ap_palloc   @166
  +	ap_parseHTTPdate   @167
  +	ap_parse_hostinfo_components   @168
  +	ap_parse_uri   @169
  +	ap_parse_uri_components   @170
  +	ap_pcalloc   @171
  +	ap_pcfg_open_custom   @172
  +	ap_pcfg_openfile   @173
  +	ap_pclosedir   @174
  +	ap_pclosef   @175
  +	ap_pcloseh   @176
  +	ap_pclosesocket   @177
  +	ap_pduphostent   @178
  +	ap_pfclose   @179
  +	ap_pfdopen   @180
  +	ap_pfopen   @181
  +	ap_pgethostbyname   @182
  +	ap_popendir   @183
  +	ap_popenf   @184
  +	ap_pregcomp   @185
  +	ap_pregfree   @186
  +	ap_pregsub   @187
  +	ap_psignature   @188
  +	ap_psocket   @189
  +	ap_pstrdup   @190
  +	ap_pstrndup   @191
  +	ap_push_array   @192
  +	ap_pvsprintf   @193
  +	ap_rationalize_mtime   @194
  +	ap_register_cleanup   @195
  +	ap_release_mutex   @196
  +	ap_remove_loaded_module   @197
  +	ap_remove_module   @198
  +	ap_requires   @199
  +	ap_reset_timeout   @200
  +	ap_rflush   @201
  +	ap_rind   @202
  +	ap_rputc   @203
  +	ap_rputs   @204
  +	ap_run_cleanup   @205
  +	ap_run_sub_req   @206
  +	ap_rwrite   @207
  +	ap_satisfies   @208
  +	ap_scan_script_header_err   @209
  +	ap_scan_script_header_err_buff   @210
  +	ap_scan_script_header_err_core   @211
  +	ap_send_fb   @212
  +	ap_send_fb_length   @213
  +	ap_send_fd   @214
  +	ap_send_fd_length   @215
  +	ap_send_http_header   @216
  +	ap_send_http_trace   @217
  +	ap_send_mmap   @218
  +	ap_send_size   @219
  +	ap_server_root_relative   @220
  +	ap_set_byterange   @221
  +	ap_set_content_length   @222
  +	ap_set_etag   @223
  +	ap_set_keepalive   @224
  +	ap_set_last_modified   @225
  +	ap_setup_client_block   @226
  +	ap_should_client_block   @227
  +	ap_soft_timeout   @228
  +	ap_some_auth_required   @229
  +	ap_spawn_child   @230
  +	ap_srm_command_loop   @231
  +	ap_str_tolower   @232
  +	ap_strcasecmp_match   @233
  +	ap_strcmp_match   @234
  +	ap_sub_req_lookup_file   @235
  +	ap_sub_req_lookup_uri   @236
  +	ap_sync_scoreboard_image   @237
  +	ap_table_add   @238
  +	ap_table_addn   @239
  +	ap_table_get   @240
  +	ap_table_merge   @241
  +	ap_table_mergen   @242
  +	ap_table_set   @243
  +	ap_table_setn   @244
  +	ap_table_unset   @245
  +	ap_tm2sec   @246
  +	ap_uname2id   @247
  +	ap_unblock_alarms   @248
  +	ap_unescape_url   @249
  +	ap_unparse_uri_components   @250
  +	ap_update_mtime   @251
  +	ap_uudecode   @252
  +	ap_uuencode   @253
  +	ap_vbprintf   @254
  +	ap_vformatter   @255
  +	ap_vsnprintf   @256
  +	closedir   @257
  +	opendir   @258
  +	os_spawnv   @259
  +	os_spawnve   @260
  +	os_stat   @261
  +	readdir   @262
  +	regcomp   @263
  +	regexec   @264
  +	regfree   @265
  +	access_module @266
  +	alias_module   @267
  +	ap_bprintf   @268
  +	ap_bvputs   @269
  +	ap_day_snames @270  
  +	ap_extended_status  @271   
  +	ap_limit_section   @272
  +	ap_loaded_modules   @273
  +	ap_log_error   @274
  +	ap_log_printf   @275
  +	ap_log_rerror   @276
  +	ap_month_snames  @277
  +	ap_null_cleanup   @278
  +	ap_psprintf   @279
  +	ap_pstrcat   @280
  +	ap_restart_time  @281 
  +	ap_rprintf   @282
  +	ap_rvputs   @283
  +	ap_scoreboard_image   @284
  +	ap_send_header_field   @285
  +	ap_server_argv0   @286
  +	ap_server_root   @287
  +	ap_set_file_slot  @288
  +	ap_set_flag_slot   @289
  +	ap_set_string_slot  @290
  +	ap_set_string_slot_lower  @291 
  +	ap_snprintf   @292
  +	ap_suexec_enabled  @293 
  +	ap_table_do   @294
  +	apache_main   @295
  +	asis_module   @296
  +	auth_module   @297
  +	autoindex_module  @298 
  +	cgi_module   @299
  +	config_log_module  @300 
  +	core_module   @301
  +	dir_module   @302
  +	env_module   @303
  +	imap_module   @304
  +	includes_module  @305   
  +	mime_module   @306
  +	negotiation_module @307  
  +	os_spawnle   @308
  +	setenvif_module  @309 
  +	so_module   @310
  +	top_module   @311
  +	ap_fnmatch   @312
  +	ap_method_number_of   @313
  +	ap_exists_config_define   @314
  +	ap_single_module_configure   @315
  +	ap_single_module_init   @316
  +	ap_make_etag   @317
  +	ap_array_pstrcat   @318
  +	ap_os_is_filename_valid   @319
  +	ap_find_opaque_token   @320
  +	ap_MD5Encode   @321
  +	ap_validate_password   @322
  +
  
  
  
  1.2       +0 -4      apache-apr/pthreads/src/ApacheCore.dsp
  
  Index: ApacheCore.dsp
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/ApacheCore.dsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ApacheCore.dsp	1999/01/21 23:08:31	1.1
  +++ ApacheCore.dsp	1999/02/07 06:29:08	1.2
  @@ -142,10 +142,6 @@
   # End Source File
   # Begin Source File
   
  -SOURCE=.\main\md5c.c
  -# End Source File
  -# Begin Source File
  -
   SOURCE=.\modules\standard\mod_access.c
   # End Source File
   # Begin Source File
  
  
  
  1.2       +8 -4      apache-apr/pthreads/src/BUILD.NOTES
  
  Index: BUILD.NOTES
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/BUILD.NOTES,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- BUILD.NOTES	1999/01/21 23:08:31	1.1
  +++ BUILD.NOTES	1999/02/07 06:29:08	1.2
  @@ -25,9 +25,13 @@
     3.6.X and you receive an error such as:
   
       "Expected </Directory> but saw </Directory>"
  +  or
  +    "Expected </Files> but saw </Files>"
   
  -  then you have a encountered a bug in xlC.  This is a problem with the
  +  then you have encountered a bug in xlC.  This is a problem with the
     3.6.X versions of xlC, and is not a problem with the Apache code.
  -  A patch for this version is to be provided by IBM in the coming days.
  -  (Oct 98)  When this patch is made available the URL will be provided here.
  -  For a precompiled build please check: <http://www.apache.org/dist/binaries/>
  +  A set of PTF's which correct the problem are available from:
  +  http://service.software.ibm.com/support/rs6000
  +  The PTF's are:  U462005, U462006, U462007, and U462023 through
  +  U462030.  The PTF's have been tested and do indeed fix the problem.
  +
  
  
  
  1.2       +428 -0    apache-apr/pthreads/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/CHANGES,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- CHANGES	1999/01/21 23:08:31	1.1
  +++ CHANGES	1999/02/07 06:29:08	1.2
  @@ -1,4 +1,432 @@
  +Changes with Apache 1.3.5
  +
  +  *) Remove unused code to disable transparent negotiation when
  +     negotiating on encoding only, as we now handle encoding too
  +     (though this is nonstandard for TCN), and fix bugs in debugging
  +     statements within mod_negotiation. [Koen Holtman]
  +
  +  *) Fixed a rare memory corruption possibility in mod_dir if the index
  +     file is negotiable and no acceptable variant can be found.
  +     [Dean Gaudet, Roy Fielding, Martin Kraemer]
  +
  +  *) Win32: Add new config directive, ScriptInterpreterSource, to enable
  +     searching the Win32 registry for script interpreters.
  +     [Bill Stoddard]
  +
  +  *) Win32: The compiled-in default filename for the error log is now
  +     error.log, which matches the default in the distributed httpd.conf.
  +     [Paul Sutton]
  +
  +  *) Win32: Any error messages from -i or -u command line options are now
  +     displayed on the console output rather than sent to the error log.
  +     Also the "Running Apache..." message is not output unless Apache is
  +     going to serve requests. [Paul Sutton]
  +
  +  *) Rework the MD5 authentication scheme to use FreeBSD's algorithm,
  +     and use a private significator ('$apr1$') to mark passwords as
  +     being smashed with our own algorithm.  Also abstract the password
  +     checking into a new ap_validate_password() routine.  [Ken Coar]
  +
  +  *) Win32: The filename validity checker now allows "COM" but refuses 
  +     access to "COM1" through "COM4". This allows filenames such
  +     as "com.name" to be served. [Paul Sutton] PR#3769.
  +
  +  *) BS2000: Adapt to the new ufork() system call interface which will
  +     make subtasking easier on the OSD/POSIX mainframe environment.
  +     [Martin Kraemer]
  +
  +  *) Add a compatibility define for escape_uri() -> ap_escape_uri() to
  +     ap_compat.h. [David White <da...@persimmon.com>] PR#3725
  +
  +  *) Make NDBM file suffix determination for mod_rewrite more accurate, i.e.
  +     use `.db' instead of `.pag' not only for FreeBSD, but also when
  +     the NDBM library looks like Berkeley-DB based.
  +     [Ralf S. Engelschall] PR#3773
  +
  +  *) Fix checking of ETags and other opaque 'tokens' by adding
  +     ap_find_opaque_token().  PR#2065, 3657 [Ken Coar]
  +
  +  *) Add ability to handle DES or MD5 authentication passwords.
  +     [Ryan Bloom <rb...@Raleigh.IBM.Com>]
  +
  +  *) Fix O(n^2) memory consumption in mod_speling.  [Dean Gaudet]
  +
  +  *) SECURITY: Avoid some buffer overflow problems when escaping
  +     quoted strings.  (This overflow was on the heap and we believe
  +     impossible to exploit.)  [Rick Perry <pe...@ece.vill.edu>]
  +
  +  *) Let src/Configure be aware of CFLAGS options starting with plus
  +     signs as it's the case for the HP/UX compiler.
  +     [Doug Yatcilla <ya...@umdnj.edu>] PR#3681
  +
  +  *) Remove the hard-wire of TAR=tar (we now check for gtar and gnutar first)
  +     and check to see if the tar we wind up with supports '-h'.
  +     [Jim Jagielski] PR#3671
  +
  +  *) A consistant and conservative style for all shell scripts has been
  +     implemented. Basically, all shell string tests use the traditional
  +     hack of 'if [ "x$var" != "x" ]' or 'if [ "x$var" = "xstring" ]'
  +     to protect against bare null variable strings (ie: wrapping both
  +     sides with double quotes and prepending 'x'). 'x' was chosen
  +     because it's more universal and hopefully easier for old shell
  +     prgrammers, as well as being easier to search for in 'vi' (/x\$) :)
  +     [Jim Jagielski]
  +
  +  *) The status module now prints out both the main server generation as
  +     well as the generation of each process. Also, the vhost info is
  +     printed with '?notable'. [Jim Jagielski]
  +
  +  *) Move src/main/md5c.c to src/ap/ap_md5c.c; it's httpd-neutral
  +     and this makes its functions available to things in src/support.
  +     [Ken Coar]
  +
   Changes with Apache 1.3.4
  +
  +  *) Renamed macros status_drops_connection to ap_status_drops_connection
  +     and vestigial scan_script_header to ap_scan_script_header_err,
  +     mostly for aesthetic reasons. [Roy Fielding]
  +
  +  *) The query switch "httpd -S" didn't exit after showing the
  +     vhost settings. That was inconsistent with the other query functions.
  +     [Martin Kraemer]
  +
  +  *) Moved the MODULE_MAGIC_COOKIE from before the versions and
  +     filename to the end of the STANDARD_MODULE_STUFF.  Its
  +     presence at the beginning prevented reporting of the filename
  +     for modules compiled before 1 January 1999.  [Ken Coar]
  +
  +  *) SECURITY: ap_os_is_filename_valid() has been added to Win32
  +     to detect and prevent access to special DOS device file names.
  +     [Paul Sutton, Ken Parzygnat]
  +     
  +  *) WIN32: Created new makefiles Makefile_win32.txt (normal build)
  +     and Makefile_win32_debug.txt (debug build) that work on Win95.
  +     Run each of the following from the src directory:
  +        nmake /f Makefile_win32.txt           # compiles normal build
  +        nmake /f Makefile_win32.txt install   # compiles and installs
  +        nmake /f Makefile_win32.txt clean     # removes compiled junk
  +        nmake /f Makefile_win32_debug.txt     # compiles debug build
  +        nmake /f Makefile_win32_debug.txt install
  +        nmake /f Makefile_win32_debug.txt clean
  +     [Roy Fielding]
  +
  +  *) Added binbuild.sh and findprg.sh helpers to make it easier for us
  +     to build binary distributions. [Lars Eilebrecht]
  +
  +  *) IndexOptions SuppressColumnSorting only turned off making
  +     the column headers anchors; you could still change the display
  +     order by manually adding a '?N=A' or similar query string to the
  +     URL.  Now SuppressColumnSorting locks in the sort order so
  +     it can't be overridden this way.  [Ken Coar]
  +
  +  *) Added IndexOrderDefault directive to supply a default sort order
  +     for FancyIndexed directory listings.  [Ken Coar] PR#1699
  +
  +  *) Change the ap_assert macro to a variant that works on all platforms.
  +     [Richard Prinz <ri...@cso.net>] PR#2575
  +
  +  *) Make sure under ELF-based NetBSD (now) and OpenBSD (future) we don't
  +     search for an underscore on dlsym() (as it's already the case
  +     for FreeBSD 3.0). [Todd Vierling <tv...@pobox.com>] PR#2462
  +  
  +  *) Small fix for mod_env.html: The module was documented as to be _not_
  +     compiled into Apache per default, although it _IS_ compiled into 
  +     Apache per default. [Sim Harbert <si...@mindspring.com>] PR#3572
  +
  +  *) Instead of fixing a bug in the generation procedure for config.status (a
  +     backslash was missing) we remove the bug together with it's complete
  +     context because the special cases of the past can now no longer occur
  +     because of the recent magic for the --with-layout default.
  +     [Ralf S. Engelschall] PR#3590
  + 
  +  *) Make top-level Makefile aware of a parallel build procedures (make -j) by
  +     making sure the src/support/ tools are _forced_ to be build last (they
  +     depend on other libraries).
  +     [Markus Theissinger <ma...@gmx.de>]
  +
  +  *) Fix installation procedure: Now that os-inline.c is actually used (a
  +     recently fixed bug prevented this) we need to also install os-include.c
  +     in addition to os.h into the PREFIX/include/ location or building of
  +     module DSOs with APXS fails. [Ralf S. Engelschall] PR#3527
  +
  +  *) Added MODULE_MAGIC_COOKIE as the first field in a module structure to
  +     allow us to distinguish between a garbled DSO (or even a file which isn't
  +     an Apache module DSO at all) and a DSO which doesn't match the current
  +     Apache API. [Ralf S. Engelschall] PR#3152
  + 
  +  *) Two minor enhancements to mod_rewrite: First RewriteRule now also
  +     supports the ``nocase|NC'' flag (as RewriteCond already does for ages) to
  +     match case insensitive (this especially avoids nasty patterns like
  +     `[tT][eE][sS][tT]'). Second two additional internal map functions
  +     `escape' and `unescape' were added which can be used to escape/unescape
  +     to/from hex-encodings in URLs parts (this is especially useful in
  +     combination with map lookups). 
  +     [Magnus Bodin, Ian Kallen, Ralf S. Engelschall]
  +
  +  *) Renamed the macro escape_uri() to ap_escape_uri() which was
  +     forgotten (because it was a macro) in the symbol renaming process.
  +     [Ralf S. Engelschall]
  +
  +  *) Fix some inconsistencies related to the scopes of directives. The only
  +     user visible change is that the directives `UseCanonicalName' and
  +     `ContentDigest' now use the (more correct) `Options' scope instead of
  +     (less correct) `AuthConfig' scope.  [Ralf S. Engelschall]
  +
  +  *) Using DSO, the Server token was being mangled. Specifically, the
  +     module's token was being added first before the Apache token. This
  +     has been fixed. [Jim Jagielski]
  +
  +  *) Major overhaul of mod_negotiation.c, part 2.
  +     - properly handle "identity" within Accept-Encoding.
  +     - allow encoded variants in RVSA negotiation and let them appear in
  +       the Alternates field using the non-standard "encoding" tag-list.
  +     - fixed both negotiation algorithms so that an explicitly accepted
  +       encoding is preferred over no encoding if "identity" is not
  +       included within Accept-Encoding.
  +     - added ap_array_pstrcat() to alloc.c for efficient concatenation
  +       of large substring sequences.
  +     - replaced O(n^2) memory hogs in mod_negotiation with ap_array_pstrcat.
  +     [Roy Fielding]
  +
  +  *) Major overhaul of mod_negotiation.c, part 1.
  +     - cleanups to mod_negotiation comments and code structure
  +     - made compliant with HTTP/1.1 proposed standard (rfc2068) and added
  +       support for everything in the upcoming HTTP/1.1
  +       revision (draft-ietf-http-v11-spec-rev-06.txt).
  +         - language tag matching also handles tags with more than 2
  +           levels like x-y-z
  +         - empty Accept, Accept-Language, Accept-Charset headers are
  +           processed correctly; previously an empty header would make all
  +           values acceptable instead of unacceptable.
  +         - allowed for q values in Accept-Encoding
  +     - added support for transparent content negotiation (rfc2295 and
  +       rfc2296) (though we do not implement all features in these drafts,
  +       e.g. no feature negotiation).  Removed old experimental version.
  +     - implemented 'structured entity tags' for better cache correctness
  +       (structured entity tags ensure that caches which can deal with Vary
  +       will (eventually) be updated if the set of variants on the server
  +       is changed)
  +         - this involved adding a vlist_validator element to request_rec
  +         - this involved adding the ap_make_etag() function to the global API
  +     - modified guessing of charsets used by Apache negotiation algorithm 
  +       to guess 'no charset' if the variant is not a text/* type
  +     - added code to sort multiviews variants into a canonical order so that
  +       negotiation results are consistent across backup/restores and mirrors
  +     - removed possibility of a type map file resolving to another type map
  +       file as its best variant
  +     [Koen Holtman, Roy Fielding, Lars Eilebrecht] PR#3451, 3299, 1987
  +
  +  *) RFC2396 allows the syntax http://host:/path (with no port number)
  +     but the proxy disallowed it (ap_proxy_canon_netloc()).
  +     [David Kristol <dm...@bell-labs.com>] PR#3530
  +
  +  *) When modules update/modify the file name in the configfile_t structure,
  +     syntax errors will report the updated name, not the original one.
  +     [Fabien Coelho <co...@cri.ensmp.fr>] PR#3573
  +
  +  *) Correct some filename case assumptions from WIN32 to
  +     CASE_BLIND_FILESYSTEM.  [Brian Havard <br...@kheldar.apana.org.au>]
  +
  +  *) For %v log ServerName regardless of the UseCanonicalName
  +     setting (similarly for %p).  [Dean Gaudet]
  +
  +  *) Configure was initializing the variables $OSDIR, $INCDIR and $SHELL
  +     rather late (too late for some invocations of TestCompile).
  +     This improves the make environment available to TestCompile and
  +     the *.module scripts. [Martin Kraemer]
  +
  +  *) The hashbang emulation code in ap_execve.c would interpret
  +     #!/hashbang/scripts correctly, but failed to fall back to a
  +     standard shell for scripts which did NOT start with #!
  +     Now SHELL_PATH is started in these cases. [Martin Kraemer]
  +
  +  *) PORT: Added the Cyberguard V2 port [Richard Stagg <st...@lentil.org>]
  +     PR#3336
  +
  +  *) Update APXS manual page: some -q option arguments were missing
  +     and another was incorrect. [Mark Anderson <md...@discerning.com>] PR#3553
  +
  +  *) Cleanup the command line options: `-?' was documented to show
  +     the usage list but does it with an error because `?' is not a valid
  +     command. OTOH a lot of users expect `-h' to print such a usage list and
  +     instead are annoyed for ages by our huge unreadable list of directives.
  +     So we now changed the command line options this way:
  +     1. `-L' => `-R' 
  +        Intent: we need `-L' to be free, and `-R' for the DSO run-time path is
  +        very similar to the popular linker option.
  +     2. `-h' => `-L'
  +        Intent: while -l gives the small list of modules, -L now gives the
  +        large list of directives implemented by these modules.  This is also
  +        consistent with -v (short version info) and -V (large version info).
  +     3. `-?' => `-h' 
  +        Intent: it's now the expected option ;-)
  +     The manual page was adjusted accordingly. 
  +     [Ralf S. Engelschall] PR#2714
  +
  +  *) Fixed problem of fclose() on an unopened file in suexec if LOG_EXEC
  +     wasn't defined.  [Rick Franchuk <ri...@transpect.net>]
  +
  +  *) Removed recently introduced bugs and disfigurements in APACI:
  +     o fixed argument line processing: using $args was broken: It was not
  +       initialized and using args="$args $apc_option" and even args="$args
  +       \"$apc_option\"" fails in the second processing round for any arguments
  +       containing whitespaces. The only correct way is to use the construct
  +       "$@" (but not possible here) or iterate _both_ times over the implicit
  +       argument line (no argument to for-loop) which is what we now use.
  +     o make --with-layout=Apache the default without creating
  +       redundancy (copying the --with-layout block in the argument parsing
  +       loop).  We achieve this by using the "$@" construct together with the
  +       `set' command to prepend --with-layout=Apache to the command line in
  +       case --with-layout is not used.
  +     o fixed auto-suffix handling now that config.layout exists.
  +       Paths which are auto-suffixed are marked with a trailing plus sign in
  +       config.layout and every path now can be marked this way (not only the
  +       four paths for which we do it currently).  Additionally the suffix is
  +       no longer a static one. Instead it's now `/<target>' where <target> is
  +       the argument of the --target option or per default `httpd'.
  +     o allow also tabs (and only spaces) where we match whitespaces
  +     o various fixes and cleanups related to used shell coding style
  +     o made Jim happy by replacing `Written by' with `Initially written by' ;-)
  +     o trimmed output of --help to fit into 80 columns
  +     [Ralf S. Engelschall]
  +
  +  *) Added two new core API functions, ap_single_module_configure() and
  +     ap_single_module_init(), which are now used by mod_so to configure a module
  +     after loading. [Ralf S. Engelschall]
  +
  +  *) PORT: Add defines for USE_FLOCK_SERIALIZED_ACCEPT and
  +     SINGLE_LISTEN_UNSERIALIZED_ACCEPT to NetBSD/OpenBSD section
  +     of ap_config.h to allow serialized accept for multiport listens.
  +     [Roy Fielding, Curt Sampson] PR#3120
  +
  +  *) PORT: Fixed a misplaced #endif for NetBSD/OpenBSD section
  +     of ap_config.h that would skip several defines if DEFAULT_GROUP
  +     was overridden. [Roy Fielding]
  +
  +  *) PORT: The I86 version of DGUX has support for strncasecmp and 
  +     strcasecmp, so allow it in ap_config.h. [Amiel Lee Yee] PR#3247
  +
  +  *) Fix ordering of definitions in ap_config.h so that ap_inline is
  +     defined before it might be used. [Victor Khimenko]
  +
  +  *) PORT: Add Dynamic Shared Object (DSO) support for BSDI (v4.0).
  +     [Tom Serkowski <tk...@bsdi.com>] PR#3453
  +
  +  *) Make generation of src/Configuration.apaci more robust: It failed to
  +     differenciate between modules when one module name was a postfix of
  +     another (e.g. cgi vs. fastcgi). We now check for mod_XXX, libXXX and even
  +     just XXX (think about totally non-standard names like "apache_ssl", too).
  +     [Ralf S. Engelschall] PR#3380
  +
  +  *) In src/Configure remove the SERVER_SUBVERSION support (already deprecated
  +     since 1.3b7) and make whitespace handling more robust (it failed horrible
  +     when whitespaces were present in the arguments of -D options).
  +     [Ralf S. Engelschall] PR#3240
  +
  +  *) Add APACI --shadow=DIR variant (in addition to --shadow). This now first
  +     creates an external package shadow tree in DIR before the local build
  +     shadow tree is generated under DIR. This way one can have the extracted
  +     Apache distribution tree read-only on NFS or CDROM and still build Apache
  +     from these sources. An automatically triggered VPATH-like mechanism is
  +     provided through the TOP variable, too.
  +     [Ralf S. Engelschall, Wilfredo Sanchez <ws...@apple.com>]
  +
  +  *) Fix negotiation so that a Vary response header is correctly 
  +     generated when, for a particular dimension, variants only vary
  +     in having or not having a value for that dimension. [Paul Sutton]
  +
  +  *) Fix negotiation so that we prefer an encoded variant over an
  +     unencoded variant if the user-agent explicitly says it can
  +     accept that encoding. Previously we always preferred the unencoded
  +     variant.
  +     [Paul Ausbeck <pa...@alumni.cse.ucsc.edu>, Paul Sutton] PR#3447
  + 
  +  *) Fix APXS tool: query variables LIBS_SHLIB and TARGET were not recognized
  +     and the usage page was inconsistent with the functionality and manpage.
  +     [Ralf S. Engelschall]
  +
  +  *) Allow special options -Wc,xxx and -Wl,xxx on APXS compile/link command.
  +     They can occur multiple times and their arguments (`xxx') are passed AS
  +     IS to the compiler/linker command.  [Ralf S. Engelschall]
  +
  +  *) Fixed possible (but harmless in practice) bug in the DBM lookup
  +     procedure of mod_rewrite: very long keys were truncated.
  +     [Ralf S. Engelschall]
  +
  +  *) Added a generic --with-layout=[FILE:]ID option. ID here is a layout
  +     identifier, currently "Apache" and "GNU" are pre-defined in the file
  +     config.layout.  Custom layouts are possible by using FILE:ID as the
  +     argument where the layout ID is taken from FILE.
  +
  +     The config.layout file consists of <Layout ID>..</Layout> sections
  +     where inside those sections "path_variable: path_value" pairs can be
  +     specified. These lines are converted to path_variable='path_value'.
  +
  +  *) Add a DefaultLanguage directive so that files missing a language
  +     extension (e.g., .fr, .de) can be labelled as being some other
  +     default language. DefaultLanguage can appear in <Directory> and 
  +     <Files> containers as well as .htaccess files.  [Paul Sutton]
  +     PR#1180
  +
  +  *) Fix TARGET configuration when configuring and installing using
  +     APACI configure. TARGET now defines the basename of the configuration
  +     file, startup script, manual page, etc. log_error_core() now reports
  +     the server binary name given by argv[0]. TARGET can now also be defined
  +     with --target=TARGET parameter passed to APACI configure.
  +     [Ralf Engelschall, Randy Terbush]
  +
  +  *) mod_include.c:handle_perl() now properly tests for OPT_INCNOEXEC
  +     rather than OPT_INCLUDES [Rainer Schoepf <sc...@uni-mainz.de>]
  +
  +  *) ap_md5_binary() was using sprintf() rather than a table lookup
  +     to convert binary bytes to hex digits.
  +     [Ronald Tschal�r <ro...@innovation.ch>] PR#3409
  +
  +  *) Fix SEGV in TCN negotiation if no variants are acceptable.
  +     [Martin Plechsmid <pl...@karlin.mff.cuni.cz>] PR#1987
  +
  +  *) API: ap_exists_config_define() function is now "public" [Doug MacEachern]
  +
  +  *) Fix documentation of `Action' directive: It can activate a CGI script
  +     when either a handler or a MIME content type is triggered by the request.
  +     [Andrew Pimlott <pi...@math.harvard.edu>] PR#3340
  +
  +  *) Document the `add' command of `dbmmanage' in `dbmmanage.1' manpage.
  +     [David MacKenzie <dj...@uu.net>] PR#3394
  +
  +  *) Ignore a "ErrorDocument 401" directive with a full URL and write a
  +     notice to the error log. It is not possible to send a 401 response
  +     and a redirect at the same time.  [Lars Eilebrecht]
  +
  +  *) Fallback to native compilers for IRIX-32 platform. It seems that
  +     a gcc 2.8.1 compiled apache is logging client addresses with all
  +     bits set (255.255.255.255). This is the second such problem caused
  +     by gcc 2.8.1 compiler. The first being broken semaphore locking.
  +     [Randy Terbush]
  +
  +  *) Updated mime.types to reflect current Internet media types
  +     and include a URL to the registry.
  +     [Manoj Kasichainula, Roy Fielding] PR#2380, 2286, 2246
  +
  +  *) SECURITY: Do a more complete check in mod_include to avoid 
  +     an infinite loop of recursive SSI includes.  [Marc Slemko] PR#3323
  +
  +  *) Add APACI --suexec-docroot and --suexec-logfile options which can be
  +     used to set the document root directory (DOC_ROOT) and the suexec
  +     logfile (LOG_EXEC), respectively. Additionally the --layout option
  +     was changed to show more information about the suEXEC setup.
  +     [Lars Eilebrecht] PR#3316, 3357, 3361
  +
  +  *) Added the last two WebDAV status codes of 424 (Failed Dependency)
  +     and 507 (Insufficient Storage) for use by third-party modules.
  +     [Roy Fielding]
  +
  +  *) Enabled all of the WebDAV method names for use by third-party
  +     modules, Limit, and Script directives.  That includes PATCH,
  +     PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, and UNLOCK.
  +     Improved mod_actions.c so that it can use any of the methods
  +     defined in httpd.h.  Added ap_method_number_of(method) for
  +     getting the internal method number.  [Roy Fielding]
   
     *) PORT: Add a port to the TPF OS. [Joe Moenich <mo...@us.ibm.com> and
        others at IBM]
  
  
  
  1.2       +5 -0      apache-apr/pthreads/src/Configuration.tmpl
  
  Index: Configuration.tmpl
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/Configuration.tmpl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- Configuration.tmpl	1999/01/21 23:08:31	1.1
  +++ Configuration.tmpl	1999/02/07 06:29:09	1.2
  @@ -63,6 +63,11 @@
   #RANLIB=
   
   ################################################################
  +# Name of the installed Apache HTTP webserver.
  +#
  +#TARGET=
  +
  +################################################################
   # Dynamic Shared Object (DSO) support
   #
   # There is experimental support for compiling the Apache core and
  
  
  
  1.3       +466 -433  apache-apr/pthreads/src/Configure
  
  Index: Configure
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/Configure,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- Configure	1999/02/04 00:25:56	1.2
  +++ Configure	1999/02/07 06:29:09	1.3
  @@ -1,6 +1,6 @@
   #!/bin/sh
   ## ====================================================================
  -## Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  +## Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
   ##
   ## Redistribution and use in source and binary forms, with or without
   ## modification, are permitted provided that the following conditions
  @@ -54,21 +54,6 @@
   ## For more information on the Apache Group and the Apache HTTP server
   ## project, please see <http://www.apache.org/>.
   
  -# HISTORY:
  -#
  -# Apache configuration script, first cut --- rst.
  -# Don't like it?  Inspired to do something better?  Go for it.
  -#
  -# second cut --- jmj
  -# At this point we change what Configuration contains. It maintain
  -# contains comments, specific compiler flags, a list of included
  -# modules and "rules". These rules are used to allow Configure to
  -# be totally configured from Configuration.
  -#
  -# third cut --- rse
  -# Big cleanup of the generated Makefiles and remove of
  -# some old kludges
  -
   # Uses 6 supplemental scripts located in ./helpers:
   #	CutRule: Determines the value for a specified Rule
   #	GuessOS: Uses uname to determine OS/platform
  @@ -187,7 +172,7 @@
   ## that the user was using the old default root directory
   ## and issue a notice about it.
   ##
  -if [ $file != "Configuration.apaci" ]
  +if [ "x$file" != "xConfiguration.apaci" ]
   then
     if [ -d /usr/local/etc/httpd/ ]
     then
  @@ -254,7 +239,6 @@
   DBM_LIB="-ldbm"
   DB_LIB="-ldb"
   SHELL="/bin/sh"
  -TARGET="httpd"
   SUBTARGET="target_static"
   SHLIB_SUFFIX_NAME=""
   SHLIB_SUFFIX_LIST=""
  @@ -280,13 +264,13 @@
   
   case "$PLAT" in
       *mint)
  -        OS="MiNT"
  -        CFLAGS="-DMINT"
  -        LIBS="$LIBS -lportlib -lsocket"
  -        DEF_WANTHSREGEX=yes
  -        ;;
  +	OS="MiNT"
  +	CFLAGS="-DMINT"
  +	LIBS="$LIBS -lportlib -lsocket"
  +	DEF_WANTHSREGEX=yes
  +	;;
       *MPE/iX*)
  -        OS='MPE/iX'
  +	OS='MPE/iX'
   	CFLAGS="$CFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE"
   	LIBS="$LIBS -lsocket -lsvipc"
   	LDFLAGS="$LDFLAGS -Xlinker \"-WL,cap=ia,ba,ph,pm;nmstack=1024000\""
  @@ -368,9 +352,9 @@
    	case "$PLAT" in
    	  *-hp-hpux10.01)
   	       # We know this is a problem in 10.01.
  -               # Not a problem in 10.20.  Otherwise, who knows?
  -               CFLAGS="$CFLAGS -DSELECT_NEEDS_CAST"
  -               ;;	     
  +	       # Not a problem in 10.20.  Otherwise, who knows?
  +	       CFLAGS="$CFLAGS -DSELECT_NEEDS_CAST"
  +	       ;;	     
    	esac
   	DEF_WANTHSREGEX=yes
   	;;
  @@ -382,7 +366,7 @@
   	LIBS="$LIBS -lm"
   	;;
       *-sgi-irix64)
  -        # Note: We'd like to see patches to compile 64-bit, but for now...
  +	# Note: We'd like to see patches to compile 64-bit, but for now...
   	echo "You are running 64-bit Irix. For now, we will compile 32-bit"
   	echo "but if you would care to port to 64-bit, send us the patches."
   	DEF_WANTHSREGEX=yes
  @@ -412,6 +396,7 @@
   		OS='SGI IRIX'
   	    fi
   	fi
  +	CC='cc'
   	CFLAGS="$CFLAGS -DIRIX"
   	;;
       *-sgi-irix)
  @@ -512,6 +497,7 @@
   	DEF_WANTHSREGEX=yes
   	;;
       *-qnx32)
  +        CC='cc -F'
   	OS='QNX32'
   	CFLAGS="$CFLAGS -DQNX -mf -3"
   	LIBS="$LIBS -N128k -lsocket -lunix"
  @@ -599,22 +585,14 @@
   	LIBS="$LIBS -lsocket -lnsl -lc -lgen"
   	;;
       *-*-powermax*)
  -        OS='SVR4'
  -        CFLAGS="$CFLAGS -DSVR4"
  -        DEF_WANTHSREGEX=yes
  -        LIBS="$LIBS -lsocket -lnsl -lgen"
  -        LD_SHLIB='cc'
  -        LDFLAGS_SHLIB="-Zlink=so"
  -        LDFLAGS_SHLIB_EXPORT="-Zlink=dynamic -Wl,-Bexport"
  -        CFLAGS_SHLIB='-Zpic'
  -        ;;
  -    BS2000*-sni-sysv4*)
  -	OS='BS2000'
  -	OSDIR='os/bs2000'
  -	CC='c89 -XLLML -XLLMK'
  -	CFLAGS="$CFLAGS -DCHARSET_EBCDIC -DSVR4 -D_XPG_IV"
  +	OS='SVR4'
  +	CFLAGS="$CFLAGS -DSVR4"
   	DEF_WANTHSREGEX=yes
  -	LIBS="$LIBS -lsocket -lnsl -lc"
  +	LIBS="$LIBS -lsocket -lnsl -lgen"
  +	LD_SHLIB='cc'
  +	LDFLAGS_SHLIB="-Zlink=so"
  +	LDFLAGS_SHLIB_EXPORT="-Zlink=dynamic -Wl,-Bexport"
  +	CFLAGS_SHLIB='-Zpic'
   	;;
       TPF)
          OS='TPF'
  @@ -623,12 +601,23 @@
          CFLAGS="$CFLAGS -DTPF -DCHARSET_EBCDIC -D_POSIX_SOURCE"
          DEF_WANTHSREGEX=yes
          LIBS="$LIBS"
  +       SUBTARGET="target_compile_only"
          ;;
  -    *-sni-sysv4*)
  +    BS2000*-siemens-sysv4*)
  +	OS='BS2000'
  +	OSDIR='os/bs2000'
  +	CC='c89 -XLLML -XLLMK'
  +	CFLAGS="$CFLAGS -DCHARSET_EBCDIC -DSVR4 -D_XPG_IV"
  +	DEF_WANTHSREGEX=yes
  +	LIBS="$LIBS -lsocket -lnsl -lc"
  +	DBM_LIB=""
  +	;;
  +    *-siemens-sysv4*)
   	OS='SVR4'
   	CFLAGS="$CFLAGS -DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN"
   	DEF_WANTHSREGEX=yes
   	LIBS="$LIBS -lsocket -lnsl -lc"
  +	DBM_LIB=""
   	;;
       pyramid-pyramid-svr4)
   	OS='SVR4'
  @@ -721,19 +710,26 @@
   	DEF_WANTHSREGEX=yes
   	;;
       4850-*.*)
  -        OS='NCR MP/RAS'
  -        CFLAGS="$CFLAGS -DSVR4 -DMPRAS"
  -        DEF_WANTHSREGEX=yes
  -        LIBS="$LIBS -lsocket -lnsl -lc -L/usr/ucblib -lucb"
  -        ;;
  +	OS='NCR MP/RAS'
  +	CFLAGS="$CFLAGS -DSVR4 -DMPRAS"
  +	DEF_WANTHSREGEX=yes
  +	LIBS="$LIBS -lsocket -lnsl -lc -L/usr/ucblib -lucb"
  +	;;
       drs6000*)
  -        OS='DRS6000'
  -        CFLAGS="$CFLAGS -DSVR4"
  -        DEF_WANTHSREGEX=yes
  -        LIBS="$LIBS -lsocket -lnsl -lc -L/usr/ucblib -lucb"
  -        ;;
  +	OS='DRS6000'
  +	CFLAGS="$CFLAGS -DSVR4"
  +	DEF_WANTHSREGEX=yes
  +	LIBS="$LIBS -lsocket -lnsl -lc -L/usr/ucblib -lucb"
  +	;;
  +    m88k-*-CX/SX|CYBER)
  +	OS='Cyberguard CX/SX'
  +	CFLAGS="$CFLAGS -D_CX_SX -Xa"
  +	DEF_WANTHSREGEX=yes
  +	CC='cc'
  +	RANLIB='true'
  +	;;
       *) # default: Catch systems we don't know about
  -        OS='Unknown and unsupported OS'
  +	OS='Unknown and unsupported OS'
       	echo Sorry, but we cannot grok \"$PLAT\"
   	echo uname -m
   	uname -m
  @@ -748,8 +744,8 @@
   	echo Ideally, read the file PORTING, do what it says, and send the
   	echo resulting patches to The Apache Group by filling out a report
   	echo form at http://www.apache.org/bug_report.html. If you don\'t 
  -        echo wish to do the port yourself, please submit this output rather 
  -        echo than the patches. Thank you.
  +	echo wish to do the port yourself, please submit this output rather 
  +	echo than the patches. Thank you.
   	echo
   	echo Pressing on with the build process, but all bets are off.
   	echo Do not be surprised if it fails. If it works, and even
  @@ -759,12 +755,28 @@
   esac
   
   ####################################################################
  +## set this if we haven't
  +##
  +if [ "x${MAKE}" = "x" ]; then
  +    MAKE='make'; export MAKE
  +fi
  +
  +####################################################################
   ## Show user what OS we came up with
   ##
   echo " + configured for $OS platform"
   SUBDIRS="$OSDIR $SUBDIRS"
   
   ####################################################################
  +# Continue building the stub file
  +# Set variables as soon as possible so that TestCompile can use them
  +##
  +echo >>Makefile.config "OSDIR=\$(SRCDIR)/$OSDIR"
  +echo >>Makefile.config "INCDIR=\$(SRCDIR)/include"
  +echo >>Makefile.config "INCLUDES0=-I\$(OSDIR) -I\$(INCDIR)"
  +echo >>Makefile.config "SHELL=$SHELL"
  +
  +####################################################################
   ## And adjust/override WANTHSREGEX as needed
   ##
   if [ "$RULE_WANTHSREGEX" = "default" ]; then
  @@ -791,8 +803,8 @@
   TCC=`egrep '^CC=' Makefile.config | tail -1 | awk -F= '{print $2}'`
   if [ "x$TCC" = "x" ]; then
       if [ "x$CC" = "x" ]; then
  -        # At this point, CC is not set in Configuration or above, so we
  -        # try to find one
  +	# At this point, CC is not set in Configuration or above, so we
  +	# try to find one
   	for compilers in "gcc" "cc" "acc" "c89"
   	do
   	    lookedfor="$lookedfor $compilers"
  @@ -860,13 +872,13 @@
       name="`echo $header | sed -e 's:/:_:g' -e 's:\.:_:g' | tr '[a-z]' '[A-Z]'`"
       CPP=$CPP ./helpers/checkheader.sh $header
       if [ $? -eq 0 ]; then
  -        echo "#ifndef HAVE_${name}" >>$AP_CONFIG_AUTO_H
  -        echo "#define HAVE_${name} 1" >>$AP_CONFIG_AUTO_H
  -        echo "#endif" >>$AP_CONFIG_AUTO_H
  +	echo "#ifndef HAVE_${name}" >>$AP_CONFIG_AUTO_H
  +	echo "#define HAVE_${name} 1" >>$AP_CONFIG_AUTO_H
  +	echo "#endif" >>$AP_CONFIG_AUTO_H
       else
  -        echo "#ifdef HAVE_${name}" >>$AP_CONFIG_AUTO_H
  -        echo "#undef HAVE_${name}" >>$AP_CONFIG_AUTO_H
  -        echo "#endif" >>$AP_CONFIG_AUTO_H
  +	echo "#ifdef HAVE_${name}" >>$AP_CONFIG_AUTO_H
  +	echo "#undef HAVE_${name}" >>$AP_CONFIG_AUTO_H
  +	echo "#endif" >>$AP_CONFIG_AUTO_H
       fi
   done
   
  @@ -875,11 +887,11 @@
   # to decide whether the Processor Binding can be used or not
   case "$PLAT" in
       *-ibm-aix*)
  -        CPP=$CPP ./helpers/checkheader.sh sys/processor.h
  -        if [ $? -eq 0 ]; then
  -            CFLAGS="$CFLAGS -DAIX_BIND_PROCESSOR"
  -        fi
  -        ;;
  +	CPP=$CPP ./helpers/checkheader.sh sys/processor.h
  +	if [ $? -eq 0 ]; then
  +	    CFLAGS="$CFLAGS -DAIX_BIND_PROCESSOR"
  +	fi
  +	;;
   esac
   
   ####################################################################
  @@ -887,6 +899,7 @@
   ##
   TOPTIM=`egrep '^OPTIM=' Makefile.config | tail -1 | awk -F= '{print $2}'`
   TRANLIB=`egrep '^RANLIB=' Makefile.config | tail -1 | awk -F= '{print $2}'`
  +TTARGET=`egrep '^TARGET=' Makefile.config | tail -1 | awk -F= '{print $2}'`
   
   ####################################################################
   ## Check for user provided flags for shared object support
  @@ -897,6 +910,20 @@
   TCFLAGS_SHLIB=`egrep '^CFLAGS_SHLIB=' Makefile.config | tail -1 | awk -F= '{print $2}'`
   
   ####################################################################
  +## Handle TARGET name
  +##
  +if [ "x$TTARGET" = "x" ]; then
  +    TARGET=httpd
  +    echo "TARGET=$TARGET" >> Makefile.config
  +else
  +    TARGET=$TTARGET
  +fi
  +if [ "x$TARGET" != "xhttpd" ]; then
  +    echo " + using custom target name: $TARGET"
  +    CFLAGS="$CFLAGS -DTARGET=\\\"$TARGET\\\""
  +fi
  +
  +####################################################################
   ## We adjust now CFLAGS_SHLIB, LDFLAGS_SHLIB and LDFLAGS_SHLIB_EXPORT as
   ## required.  For more platforms just add the required lines below.
   ##
  @@ -908,262 +935,267 @@
       SHLIB_SUFFIX_DEPTH=all
       SHLIB_EXPORT_FILES=no
       case "$PLAT" in
  -        *-linux1)
  -            CFLAGS_SHLIB="-fpic"
  -            LDFLAGS_SHLIB="-Bshareable"
  -            LDFLAGS_SHLIB_EXPORT="-rdynamic"
  -            ;;
  -        *-linux2)
  -            CFLAGS_SHLIB="-fpic"
  -            LDFLAGS_SHLIB="-Bshareable"
  -            LDFLAGS_SHLIB_EXPORT="-rdynamic"
  -            SHLIB_SUFFIX_DEPTH=0
  -            ;;
  -        *-freebsd2*)
  -            CFLAGS_SHLIB="-fpic"
  -            LDFLAGS_SHLIB="-Bshareable"
  -            LDFLAGS_SHLIB_EXPORT=""
  -            SHLIB_SUFFIX_DEPTH=2
  -            ;;
  -        *-freebsd3*)
  -            CFLAGS_SHLIB="-fpic"
  -            LDFLAGS_SHLIB="-Bshareable"
  -            OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` 
  -            if [ ".$OBJFORMAT" = .elf ]; then
  -                LDFLAGS_SHLIB_EXPORT="-Wl,-E"
  -                SHLIB_SUFFIX_DEPTH=0
  -            else
  -                LDFLAGS_SHLIB_EXPORT=""
  -                SHLIB_SUFFIX_DEPTH=2
  -            fi  
  -            ;;
  -        *-openbsd*)
  -            CFLAGS_SHLIB="-fPIC"
  -            LDFLAGS_SHLIB="-Bforcearchive -Bshareable"
  -            LDFLAGS_SHLIB_EXPORT=""
  -            SHLIB_SUFFIX_DEPTH=2
  -            ;;
  -        alpha-*-netbsd*|mips-*-netbsd*|powerpc-*-netbsd*)
  -            CFLAGS_SHLIB="-fpic -DPIC"
  -            LDFLAGS_SHLIB="-shared"
  -            LDFLAGS_SHLIB_EXPORT=""
  -            SHLIB_SUFFIX_DEPTH=2
  -            ;;
  -        *-netbsd*)
  -            CFLAGS_SHLIB="-fpic -DPIC"
  -            LDFLAGS_SHLIB="-Bshareable"
  -            LDFLAGS_SHLIB_EXPORT=""
  -            SHLIB_SUFFIX_DEPTH=2
  -            ;;
  -        *-apple-rhapsody*)
  -            LD_SHLIB="cc"
  -            CFLAGS_SHLIB=""
  -            LDFLAGS_SHLIB='$(EXTRA_LDFLAGS) -bundle -undefined suppress'
  -            LDFLAGS_SHLIB_EXPORT=""
  -            SHLIB_SUFFIX_DEPTH=0
  -            ;;
  -        *-solaris2*)
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  -            esac
  -            LDFLAGS_SHLIB="-G"
  -            LDFLAGS_SHLIB_EXPORT=""
  -            SHLIB_SUFFIX_DEPTH=1
  -            ;;
  -        *-sunos4*)
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */acc|acc ) CFLAGS_SHLIB="-pic" ;;
  -            esac
  -            LDFLAGS_SHLIB="-assert pure-text"
  -            LDFLAGS_SHLIB_EXPORT=""
  -            ;;
  -        *-sgi-irix32)
  -            case $CC in
  -                */gcc|gcc )
  +	*-linux1)
  +	    CFLAGS_SHLIB="-fpic"
  +	    LDFLAGS_SHLIB="-Bshareable"
  +	    LDFLAGS_SHLIB_EXPORT="-rdynamic"
  +	    ;;
  +	*-linux2)
  +	    CFLAGS_SHLIB="-fpic"
  +	    LDFLAGS_SHLIB="-Bshareable"
  +	    LDFLAGS_SHLIB_EXPORT="-rdynamic"
  +	    SHLIB_SUFFIX_DEPTH=0
  +	    ;;
  +	*-freebsd2*)
  +	    CFLAGS_SHLIB="-fpic"
  +	    LDFLAGS_SHLIB="-Bshareable"
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    SHLIB_SUFFIX_DEPTH=2
  +	    ;;
  +	*-freebsd3*)
  +	    CFLAGS_SHLIB="-fpic"
  +	    LDFLAGS_SHLIB="-Bshareable"
  +	    OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` 
  +	    if [ "x$OBJFORMAT" = "xelf" ]; then
  +		LDFLAGS_SHLIB_EXPORT="-Wl,-E"
  +		SHLIB_SUFFIX_DEPTH=0
  +	    else
  +		LDFLAGS_SHLIB_EXPORT=""
  +		SHLIB_SUFFIX_DEPTH=2
  +	    fi  
  +	    ;;
  +	*-openbsd*)
  +	    CFLAGS_SHLIB="-fPIC"
  +	    LDFLAGS_SHLIB="-Bforcearchive -Bshareable"
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    SHLIB_SUFFIX_DEPTH=2
  +	    ;;
  +	alpha-*-netbsd*|mips-*-netbsd*|powerpc-*-netbsd*)
  +	    CFLAGS_SHLIB="-fpic -DPIC"
  +	    LDFLAGS_SHLIB="-shared"
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    SHLIB_SUFFIX_DEPTH=2
  +	    ;;
  +	*-netbsd*)
  +	    CFLAGS_SHLIB="-fpic -DPIC"
  +	    LDFLAGS_SHLIB="-Bshareable"
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    SHLIB_SUFFIX_DEPTH=2
  +	    ;;
  +	*-bsdi)
  +	    CFLAGS_SHLIB="-fPIC"
  +	    LDFLAGS_SHLIB="-shared"
  +	    LDFLAGS_SHLIB_EXPORT="-rdynamic"
  +	    ;;
  +	*-apple-rhapsody*)
  +	    LD_SHLIB="cc"
  +	    CFLAGS_SHLIB=""
  +	    LDFLAGS_SHLIB='$(EXTRA_LDFLAGS) -bundle -undefined suppress'
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    SHLIB_SUFFIX_DEPTH=0
  +	    ;;
  +	*-solaris2*)
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  +	    esac
  +	    LDFLAGS_SHLIB="-G"
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    SHLIB_SUFFIX_DEPTH=1
  +	    ;;
  +	*-sunos4*)
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/acc|acc ) CFLAGS_SHLIB="-pic" ;;
  +	    esac
  +	    LDFLAGS_SHLIB="-assert pure-text"
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    ;;
  +	*-sgi-irix32)
  +	    case $CC in
  +		*/gcc|gcc )
   		    CFLAGS_SHLIB="-fpic"
   		    N32FLAG=""
   		    ;;
  -                */cc|cc )
  +		*/cc|cc )
   		    CFLAGS_SHLIB="-KPIC"
   		    N32FLAG="-n32"
   		    ;;
  -            esac
  -            if [ "$RULE_IRIXN32" = "yes" ]; then
  -                LDFLAGS_SHLIB="$N32FLAG -shared"
  -            else
  -                LDFLAGS_SHLIB="-shared"
  -            fi
  -            LDFLAGS_SHLIB_EXPORT=""
  -            ;;
  -        *-sgi-irix64)
  -            case $CC in
  -                */gcc|gcc )
  +	    esac
  +	    if [ "$RULE_IRIXN32" = "yes" ]; then
  +		LDFLAGS_SHLIB="$N32FLAG -shared"
  +	    else
  +		LDFLAGS_SHLIB="-shared"
  +	    fi
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    ;;
  +	*-sgi-irix64)
  +	    case $CC in
  +		*/gcc|gcc )
   		    CFLAGS_SHLIB="-fpic"
   		    N32FLAG=""
   		    ;;
  -                */cc|cc )
  +		*/cc|cc )
   		    CFLAGS_SHLIB="-KPIC"
   		    N32FLAG="-n32"
  +		    ;;
  +	    esac
  +	    if [ "$RULE_IRIXN32" = "yes" ]; then
  +		LDFLAGS_SHLIB="$N32FLAG -shared"
  +	    else
  +		LDFLAGS_SHLIB="-shared"
  +	    fi
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    ;;
  +	*-sgi-irix)
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  +	    esac
  +	    LDFLAGS_SHLIB="-shared"
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    ;;
  +	*-dec-osf*)
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/cc|cc   ) CFLAGS_SHLIB="" ;;
  +	    esac
  +	    LDFLAGS_SHLIB="-shared -expect_unresolved '*' -s"
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    ;;
  +	*-unixware*)
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  +	    esac
  +	    LDFLAGS_SHLIB="-Bdynamic -G"
  +	    LDFLAGS_SHLIB_EXPORT="-Wl,-Bexport"
  +	    ;;
  +	 *-sco5*)
  +	     case $CC in
  +		 */gcc*|gcc* ) CFLAGS_SHLIB="-fpic" ;;
  +		 */cc*|cc*   ) CFLAGS_SHLIB="-KPIC" ;;
  +	     esac
  +	     LDFLAGS_SHLIB="-G"
  +	     LDFLAGS_SHLIB_EXPORT="-Wl,-Bexport"
  +	     SHLIB_SUFFIX_DEPTH=1
  +	     ;;
  +	RM*-siemens-sysv4*)
  +	    # MIPS hosts can take advantage of the LDFLAGS_SHLIB_EXPORT switch
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  +	    esac
  +	    LDFLAGS_SHLIB="-G"
  +	    LDFLAGS_SHLIB_EXPORT="-Wl,-Blargedynsym"
  +	    ;;
  +	*-siemens-sysv4*)
  +	    # Older SINIX machines must be linked as "shared core"-Apache
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  +	    esac
  +	    LDFLAGS_SHLIB="-G"
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    SHLIB_SUFFIX_DEPTH=0
  +	    DEF_SHARED_CORE=yes
  +	    ;;
  +	*-sysv4*)
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  +	    esac
  +	    LDFLAGS_SHLIB="-G"
  +	    LDFLAGS_SHLIB_EXPORT=""
  +	    DEF_SHARED_CORE=yes
  +	    ;;
  +	*-hp-hpux9.*)
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/cc|cc   ) CFLAGS_SHLIB="+z" ;;
  +	    esac
  +	    LDFLAGS_SHLIB="-b"
  +	    LDFLAGS_SHLIB_EXPORT="-Wl,-E -Wl,-B,deferred"
  +	    SHLIB_SUFFIX_NAME=sl
  +	    ;;
  +	*-hp-hpux10.*|*-hp-hpux11.*)
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/cc|cc   ) CFLAGS_SHLIB="+z" ;;
  +	    esac
  +	    LDFLAGS_SHLIB="-b"
  +	    LDFLAGS_SHLIB_EXPORT="-Wl,-E -Wl,-B,deferred -Wl,+s"
  +	    SHLIB_SUFFIX_NAME=sl
  +	    ;;
  +	*-ibm-aix*)
  +	    case $CC in
  +		*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  +		*/cc|cc   ) CFLAGS_SHLIB="" ;;
  +	    esac
  +	    case $PLAT in
  +		*-ibm-aix4*)
  +		    LDFLAGS_SHLIB="-H512 -T512 -bhalt:4 -bM:SRE -bnoentry"
   		    ;;
  -            esac
  -            if [ "$RULE_IRIXN32" = "yes" ]; then
  -                LDFLAGS_SHLIB="$N32FLAG -shared"
  -            else
  -                LDFLAGS_SHLIB="-shared"
  -            fi
  -            LDFLAGS_SHLIB_EXPORT=""
  -            ;;
  -        *-sgi-irix)
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  -            esac
  -            LDFLAGS_SHLIB="-shared"
  -            LDFLAGS_SHLIB_EXPORT=""
  -            ;;
  -        *-dec-osf*)
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */cc|cc   ) CFLAGS_SHLIB="" ;;
  -            esac
  -            LDFLAGS_SHLIB="-shared -expect_unresolved '*' -s"
  -            LDFLAGS_SHLIB_EXPORT=""
  -            ;;
  -        *-unixware*)
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  -            esac
  -            LDFLAGS_SHLIB="-Bdynamic -G"
  -            LDFLAGS_SHLIB_EXPORT="-Wl,-Bexport"
  -            ;;
  -         *-sco5*)
  -             case $CC in
  -                 */gcc*|gcc* ) CFLAGS_SHLIB="-fpic" ;;
  -                 */cc*|cc*   ) CFLAGS_SHLIB="-KPIC" ;;
  -             esac
  -             LDFLAGS_SHLIB="-G"
  -             LDFLAGS_SHLIB_EXPORT="-Wl,-Bexport"
  -             SHLIB_SUFFIX_DEPTH=1
  -             ;;
  -        RM*-sni-sysv4*)
  -            # MIPS hosts can take advantage of the LDFLAGS_SHLIB_EXPORT switch
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  -            esac
  -            LDFLAGS_SHLIB="-G"
  -            LDFLAGS_SHLIB_EXPORT="-Wl,-Blargedynsym"
  -            ;;
  -        *-sni-sysv4*)
  -            # Older SINIX machines must be linked as "shared core"-Apache
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  -            esac
  -            LDFLAGS_SHLIB="-G"
  -            LDFLAGS_SHLIB_EXPORT=""
  -            SHLIB_SUFFIX_DEPTH=0
  -            DEF_SHARED_CORE=yes
  -            ;;
  -        *-sysv4*)
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */cc|cc   ) CFLAGS_SHLIB="-KPIC" ;;
  -            esac
  -            LDFLAGS_SHLIB="-G"
  -            LDFLAGS_SHLIB_EXPORT=""
  -            DEF_SHARED_CORE=yes
  -            ;;
  -        *-hp-hpux9.*)
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */cc|cc   ) CFLAGS_SHLIB="+z" ;;
  -            esac
  -            LDFLAGS_SHLIB="-b"
  -            LDFLAGS_SHLIB_EXPORT="-Wl,-E -Wl,-B,deferred"
  -            SHLIB_SUFFIX_NAME=sl
  -            ;;
  -        *-hp-hpux10.*|*-hp-hpux11.*)
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */cc|cc   ) CFLAGS_SHLIB="+z" ;;
  -            esac
  -            LDFLAGS_SHLIB="-b"
  -            LDFLAGS_SHLIB_EXPORT="-Wl,-E -Wl,-B,deferred -Wl,+s"
  -            SHLIB_SUFFIX_NAME=sl
  -            ;;
  -        *-ibm-aix*)
  -            case $CC in
  -                */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  -                */cc|cc   ) CFLAGS_SHLIB="" ;;
  -            esac
  -            case $PLAT in
  -                *-ibm-aix4*)
  -                    LDFLAGS_SHLIB="-H512 -T512 -bhalt:4 -bM:SRE -bnoentry"
  -                    ;;
  -                *-ibm-aix*)
  -                    LDFLAGS_SHLIB="-H512 -T512 -bhalt:4 -bM:SRE -e _nostart"
  -                    ;;
  -            esac
  -            LDFLAGS_SHLIB="$LDFLAGS_SHLIB -bI:\$(SRCDIR)/support/httpd.exp "
  -            LDFLAGS_SHLIB="$LDFLAGS_SHLIB -bE:\`echo \$@|sed -e 's:\.so\$\$:.exp:'\`"
  -            LDFLAGS_SHLIB="$LDFLAGS_SHLIB -lc"
  -            LDFLAGS_SHLIB_EXPORT="-Wl,-bE:\$(SRCDIR)/support/httpd.exp"
  -            SHLIB_EXPORT_FILES=yes
  -            ;;
  -        *-*-powermax*)
  -            LD_SHLIB='cc'
  -            LDFLAGS_SHLIB="-Zlink=so"
  -            LDFLAGS_SHLIB_EXPORT="-Zlink=dynamic -Wl,-Bexport"
  -            CFLAGS_SHLIB='-Zpic'
  -            ;;
  -        *)
  -            ##  ok, no known explict support for shared objects
  -            ##  on this platform, but we give not up immediately.
  -            ##  We take a second chance by guessing the compiler
  -            ##  and linker flags from the Perl installation
  -            ##  if it exists.
  -            PERL=
  -            for dir in `echo $PATH | sed -e 's/:/ /g'`
  -            do
  -                if [ -f "$dir/perl5" ]; then
  -                    PERL="$dir/perl5"
  -                    break
  -                fi
  -                if [ -f "$dir/perl" ]; then
  -                    PERL="$dir/perl"
  -                    break
  -                fi
  -            done
  -            if [ "x$PERL" != "x" ]; then
  -                #   cool, Perl is installed on this platform...
  -                if [ "x`$PERL -V:dlsrc 2>/dev/null | grep dlopen`" != "x" ]; then
  -                    #   ...and actually uses the dlopen-style interface,
  -                    #   so we can guess the flags from its knowledge
  -                    CFLAGS_SHLIB="`$PERL -V:cccdlflags | cut -d\' -f2`"
  -                    LDFLAGS_SHLIB="`$PERL -V:lddlflags | cut -d\' -f2`"
  -                    LDFLAGS_SHLIB_EXPORT="`$PERL -V:ccdlflags | cut -d\' -f2`"
  -                    #   but additionally we have to inform the
  -                    #   user that we are just guessing the flags
  -                    echo ""
  -                    echo "** WARNING: We have no explicit knowledge about shared object"
  -                    echo "** support for your particular platform. But perhaps you have"
  -                    echo "** luck: We were able to guess the compiler and linker flags"
  -                    echo "** for creating shared objects from your Perl installation."
  -                    echo "** If they actually work, please send the following information"
  -                    echo "** for inclusion into later releases to new-httpd@apache.org or make"
  -                    echo "** a suggestion report at http://www.apache.org/bug_report.html:"
  -                    echo "**     PLATFORM=$PLAT"
  -                    echo "**     CFLAGS_SHLIB=$CFLAGS_SHLIB"
  -                    echo "**     LDFLAGS_SHLIB=$LDFLAGS_SHLIB"
  -                    echo "**     LDFLAGS_SHLIB_EXPORT=$LDFLAGS_SHLIB_EXPORT"
  -                    echo ""
  -                fi
  -            fi
  -            ;;
  +		*-ibm-aix*)
  +		    LDFLAGS_SHLIB="-H512 -T512 -bhalt:4 -bM:SRE -e _nostart"
  +		    ;;
  +	    esac
  +	    LDFLAGS_SHLIB="$LDFLAGS_SHLIB -bI:\$(SRCDIR)/support/httpd.exp "
  +	    LDFLAGS_SHLIB="$LDFLAGS_SHLIB -bE:\`echo \$@|sed -e 's:\.so\$\$:.exp:'\`"
  +	    LDFLAGS_SHLIB="$LDFLAGS_SHLIB -lc"
  +	    LDFLAGS_SHLIB_EXPORT="-Wl,-bE:\$(SRCDIR)/support/httpd.exp"
  +	    SHLIB_EXPORT_FILES=yes
  +	    ;;
  +	*-*-powermax*)
  +	    LD_SHLIB='cc'
  +	    LDFLAGS_SHLIB="-Zlink=so"
  +	    LDFLAGS_SHLIB_EXPORT="-Zlink=dynamic -Wl,-Bexport"
  +	    CFLAGS_SHLIB='-Zpic'
  +	    ;;
  +	*)
  +	    ##  ok, no known explict support for shared objects
  +	    ##  on this platform, but we give not up immediately.
  +	    ##  We take a second chance by guessing the compiler
  +	    ##  and linker flags from the Perl installation
  +	    ##  if it exists.
  +	    PERL=
  +	    for dir in `echo $PATH | sed -e 's/:/ /g'`
  +	    do
  +		if [ -f "$dir/perl5" ]; then
  +		    PERL="$dir/perl5"
  +		    break
  +		fi
  +		if [ -f "$dir/perl" ]; then
  +		    PERL="$dir/perl"
  +		    break
  +		fi
  +	    done
  +	    if [ "x$PERL" != "x" ]; then
  +		#   cool, Perl is installed on this platform...
  +		if [ "x`$PERL -V:dlsrc 2>/dev/null | grep dlopen`" != "x" ]; then
  +		    #   ...and actually uses the dlopen-style interface,
  +		    #   so we can guess the flags from its knowledge
  +		    CFLAGS_SHLIB="`$PERL -V:cccdlflags | cut -d\' -f2`"
  +		    LDFLAGS_SHLIB="`$PERL -V:lddlflags | cut -d\' -f2`"
  +		    LDFLAGS_SHLIB_EXPORT="`$PERL -V:ccdlflags | cut -d\' -f2`"
  +		    #   but additionally we have to inform the
  +		    #   user that we are just guessing the flags
  +		    echo ""
  +		    echo "** WARNING: We have no explicit knowledge about shared object"
  +		    echo "** support for your particular platform. But perhaps you have"
  +		    echo "** luck: We were able to guess the compiler and linker flags"
  +		    echo "** for creating shared objects from your Perl installation."
  +		    echo "** If they actually work, please send the following information"
  +		    echo "** for inclusion into later releases to new-httpd@apache.org or make"
  +		    echo "** a suggestion report at http://www.apache.org/bug_report.html:"
  +		    echo "**     PLATFORM=$PLAT"
  +		    echo "**     CFLAGS_SHLIB=$CFLAGS_SHLIB"
  +		    echo "**     LDFLAGS_SHLIB=$LDFLAGS_SHLIB"
  +		    echo "**     LDFLAGS_SHLIB_EXPORT=$LDFLAGS_SHLIB_EXPORT"
  +		    echo ""
  +		fi
  +	    fi
  +	    ;;
       esac
   fi
   
  @@ -1173,16 +1205,16 @@
   ##
   if [ "x$using_shlib" = "x1" ] ; then
       if [ "x$TCFLAGS_SHLIB"  = "x" -a "x$CFLAGS_SHLIB"  = "x"  -a \
  -         "x$TLDFLAGS_SHLIB" = "x" -a "x$LDFLAGS_SHLIB" = "x" ]; then
  -        echo ""
  -        echo "** FAILURE: Sorry, no shared object support available."
  -        echo "** Either compile all modules statically (use AddModule instead"
  -        echo "** of SharedModule in the Configuration file) or at least provide"
  -        echo "** us with the appropriate compiler and linker flags via the"
  -        echo "** CFLAGS_SHLIB, LDFLAGS_SHLIB and LDFLAGS_SHLIB_EXPORT entries"
  -        echo "** in the Configuration file."
  -        echo ""
  -        exit 1
  +	 "x$TLDFLAGS_SHLIB" = "x" -a "x$LDFLAGS_SHLIB" = "x" ]; then
  +	echo ""
  +	echo "** FAILURE: Sorry, no shared object support available."
  +	echo "** Either compile all modules statically (use AddModule instead"
  +	echo "** of SharedModule in the Configuration file) or at least provide"
  +	echo "** us with the appropriate compiler and linker flags via the"
  +	echo "** CFLAGS_SHLIB, LDFLAGS_SHLIB and LDFLAGS_SHLIB_EXPORT entries"
  +	echo "** in the Configuration file."
  +	echo ""
  +	exit 1
       fi
   fi
   
  @@ -1262,13 +1294,13 @@
   ##
   if [ "x$RANLIB" = "x" ]; then
       if [ "x$TRANLIB" != "x" ]; then
  -        RANLIB=$TRANLIB
  +	RANLIB=$TRANLIB
       else
  -        if ./helpers/PrintPath -s ranlib; then
  -            RANLIB="ranlib"
  -        else
  -            RANLIB="true"
  -        fi
  +	if ./helpers/PrintPath -s ranlib; then
  +	    RANLIB="ranlib"
  +	else
  +	    RANLIB="true"
  +	fi
       fi
   fi
   
  @@ -1306,13 +1338,13 @@
       CFLAGS="$CFLAGS -DSOCKS -DSOCKS4"
       CFLAGS="$CFLAGS -Dconnect=Rconnect -Dselect=Rselect"
       CFLAGS="$CFLAGS -Dgethostbyname=Rgethostbyname"
  -    if [ "x`grep EXTRA_ Makefile | grep lsocks`" = "x" ]; then
  +    if [ "x`egrep '^EXTRA_L' Makefile.config | grep lsocks`" = "x" ]; then
   	LIBS="$LIBS -L/usr/local/lib -lsocks"
       fi
       case $PLAT in
  -        *-solaris2* )
  -            LIBS="$LIBS -lresolv"
  -            ;;
  +	*-solaris2* )
  +	    LIBS="$LIBS -lresolv"
  +	    ;;
       esac
   fi
   
  @@ -1325,13 +1357,13 @@
       CFLAGS="$CFLAGS -DSOCKS -DSOCKS5"
       CFLAGS="$CFLAGS -Dconnect=SOCKSconnect -Dselect=SOCKSselect"
       CFLAGS="$CFLAGS -Dgethostbyname=SOCKSgethostbyname -Dclose=SOCKSclose"
  -    if [ "x`grep EXTRA_ Makefile | grep lsocks5`" = "x" ]; then
  -        LIBS="$LIBS -L/usr/local/lib -lsocks5"
  +    if [ "x`egrep '^EXTRA_L' Makefile.config | grep lsocks5`" = "x" ]; then
  +	LIBS="$LIBS -L/usr/local/lib -lsocks5"
       fi
       case $PLAT in
  -        *-solaris2* )
  -            LIBS="$LIBS -lresolv"
  -            ;;
  +	*-solaris2* )
  +	    LIBS="$LIBS -lresolv"
  +	    ;;
       esac
   fi
   
  @@ -1355,7 +1387,7 @@
   ## the module) is like this:
   ##
   ##  1 If extension is not given or is .c, assume .o was given and goto 3
  -##  2 If extension if .module, go to D1
  +##  2 If extension is .module, go to D1
   ##  3 If extension is .o, look for a corresponding .c file and if
   ##      found, go to C1
   ##  4 If no .c file was found, look for a .module file (Apache module
  @@ -1442,7 +1474,7 @@
   		$CAT $modbase.module > $tmpfile2
   	else
   	    if [ -f $modbase.c ] ; then
  -		# Guess module structure name in case there is not
  +		# Guess module structure name in case there is no
   		# module definition in this file
   		modname=`egrep '^module .*;' $modbase.c | head -1 |\
   			sed 's/^module.*[ 	][ 	]*//' | \
  @@ -1503,16 +1535,16 @@
   LIBS_SHLIB=''
   if [ "x$using_shlib" = "x1" ] ; then
       if [ "$RULE_SHARED_CHAIN" = "default" ] ; then
  -        RULE_SHARED_CHAIN=$DEF_SHARED_CHAIN
  +	RULE_SHARED_CHAIN=$DEF_SHARED_CHAIN
       fi
       if [ "$RULE_SHARED_CHAIN" = "yes" ]; then
  -        echo " + enabling DSO files to be linked against others"
  -        #   determine libraries which can be safely linked
  -        #   to our DSO files, i.e. PIC libraries and shared libraries
  -        extra_ldflags="`grep EXTRA_LDFLAGS= Makefile.config`"
  -        extra_libs="`grep EXTRA_LIBS= Makefile.config`"
  -        eval "`./helpers/slo.sh $LDFLAGS $LIBS $extra_ldflags $extra_libs`"
  -        LIBS_SHLIB="$SLO_DIRS_PIC $SLO_LIBS_PIC $SLO_DIRS_DSO $SLO_LIBS_DSO"
  +	echo " + enabling DSO files to be linked against others"
  +	#   determine libraries which can be safely linked
  +	#   to our DSO files, i.e. PIC libraries and shared libraries
  +	extra_ldflags="`grep EXTRA_LDFLAGS= Makefile.config`"
  +	extra_libs="`grep EXTRA_LIBS= Makefile.config`"
  +	eval "`./helpers/slo.sh $LDFLAGS $LIBS $extra_ldflags $extra_libs`"
  +	LIBS_SHLIB="$SLO_DIRS_PIC $SLO_LIBS_PIC $SLO_DIRS_DSO $SLO_LIBS_DSO"
       fi
   fi
   
  @@ -1521,34 +1553,34 @@
   ##
   if [ "x$using_shlib" = "x1" ] ; then
       if [ "$RULE_SHARED_CORE" = "default" ] ; then
  -        RULE_SHARED_CORE=$DEF_SHARED_CORE
  +	RULE_SHARED_CORE=$DEF_SHARED_CORE
       fi
       if [ "$RULE_SHARED_CORE" = "yes" ]; then
  -        echo " + enabling generation of Apache core as DSO"
  -        #    shuffle compiler flags from shlib variant to standard
  -        CFLAGS="$CFLAGS $CFLAGS_SHLIB"
  -        CFLAGS_SHLIB=""
  -        #    indicate that Rule SHARED_CORE is active
  -        CFLAGS="$CFLAGS -DSHARED_CORE"
  -        #    select the special subtarget for shared core generation
  -        SUBTARGET=target_shared
  -        #    determine additional suffixes for libhttpd.so
  -	V=1 R=3 P=4
  -        if [ "$SHLIB_SUFFIX_DEPTH" = "0" ]; then
  -            SHLIB_SUFFIX_LIST=""
  -        fi
  -        if [ "$SHLIB_SUFFIX_DEPTH" = "1" ]; then
  -            SHLIB_SUFFIX_LIST="$V"
  -        fi
  -        if [ "$SHLIB_SUFFIX_DEPTH" = "2" ]; then
  -            SHLIB_SUFFIX_LIST="$V.$R"
  -        fi
  -        if [ "$SHLIB_SUFFIX_DEPTH" = "3" ]; then
  -            SHLIB_SUFFIX_LIST="$V.$R.$P"
  -        fi
  -        if [ "$SHLIB_SUFFIX_DEPTH" = "all" ]; then
  -            SHLIB_SUFFIX_LIST="$V $V.$R $V.$R.$P"
  -        fi
  +	echo " + enabling generation of Apache core as DSO"
  +	#    shuffle compiler flags from shlib variant to standard
  +	CFLAGS="$CFLAGS $CFLAGS_SHLIB"
  +	CFLAGS_SHLIB=""
  +	#    indicate that Rule SHARED_CORE is active
  +	CFLAGS="$CFLAGS -DSHARED_CORE"
  +	#    select the special subtarget for shared core generation
  +	SUBTARGET=target_shared
  +	#    determine additional suffixes for libhttpd.so
  +	V=1 R=3 P=5
  +	if [ "$SHLIB_SUFFIX_DEPTH" = "0" ]; then
  +	    SHLIB_SUFFIX_LIST=""
  +	fi
  +	if [ "$SHLIB_SUFFIX_DEPTH" = "1" ]; then
  +	    SHLIB_SUFFIX_LIST="$V"
  +	fi
  +	if [ "$SHLIB_SUFFIX_DEPTH" = "2" ]; then
  +	    SHLIB_SUFFIX_LIST="$V.$R"
  +	fi
  +	if [ "$SHLIB_SUFFIX_DEPTH" = "3" ]; then
  +	    SHLIB_SUFFIX_LIST="$V.$R.$P"
  +	fi
  +	if [ "$SHLIB_SUFFIX_DEPTH" = "all" ]; then
  +	    SHLIB_SUFFIX_LIST="$V $V.$R $V.$R.$P"
  +	fi
       fi
   fi
   
  @@ -1558,16 +1590,16 @@
   ##
   if [ "x$using_shlib" = "x1" ] ; then
       if [ "x$TCFLAGS_SHLIB" = "x" ]; then
  -        echo "CFLAGS_SHLIB=$CFLAGS_SHLIB -DSHARED_MODULE" >> Makefile.config
  +	echo "CFLAGS_SHLIB=$CFLAGS_SHLIB -DSHARED_MODULE" >> Makefile.config
       fi
       if [ "x$TLD_SHLIB" = "x" ]; then
  -        echo "LD_SHLIB=$LD_SHLIB" >> Makefile.config
  +	echo "LD_SHLIB=$LD_SHLIB" >> Makefile.config
       fi
       if [ "x$TLDFLAGS_SHLIB" = "x" ]; then
  -        echo "LDFLAGS_SHLIB=$LDFLAGS_SHLIB" >> Makefile.config
  +	echo "LDFLAGS_SHLIB=$LDFLAGS_SHLIB" >> Makefile.config
       fi
       if [ "x$TLDFLAGS_SHLIB_EXPORT" = "x" ]; then
  -        echo "LDFLAGS_SHLIB_EXPORT=$LDFLAGS_SHLIB_EXPORT" >> Makefile.config
  +	echo "LDFLAGS_SHLIB_EXPORT=$LDFLAGS_SHLIB_EXPORT" >> Makefile.config
       fi
   fi
   
  @@ -1672,7 +1704,7 @@
   	    dir = pp[1] "/" pp[2] 
   	    inthere = 0
   	    for ( tdir in autodirs ) {
  -	        if (tdir == dir) 
  +		if (tdir == dir) 
   		    inthere = 1
   	    }
   	    if (inthere == 1)
  @@ -1709,7 +1741,6 @@
   ####################################################################
   ## Now add the target for the main Makefile
   ##
  -echo "TARGET=$TARGET" >> Makefile
   echo "SUBDIRS=$SUBDIRS" >> Makefile
   echo "SUBTARGET=$SUBTARGET" >> Makefile
   echo "SHLIB_SUFFIX_NAME=$SHLIB_SUFFIX_NAME" >> Makefile
  @@ -1717,19 +1748,11 @@
   echo "" >> Makefile
   
   ####################################################################
  -## Now add -DSERVER_SUBVERSION if $SUBVERSION is set
  -##
  -if [ "x$SUBVERSION" != "x" ] ; then
  -        SUBVERSION=`echo $SUBVERSION | sed 's/^ +//'`
  -	CFLAGS="$CFLAGS -DSERVER_SUBVERSION=\\\"$SUBVERSION\\\""
  -fi
  -
  -####################################################################
   ## Determine GNU Make variant because
   ## it uses ugly looking built-in directory walk messages
   ## while we are already using our own messages
   ##
  -if [ "x`make -v 2>/dev/null | grep 'GNU Make'`" = "x" ]; then
  +if [ "x`${MAKE} -v 2>/dev/null | grep 'GNU Make'`" = "x" ]; then
   	MFLAGS_STATIC=
   else
   	MFLAGS_STATIC=--no-print-directory
  @@ -1740,17 +1763,13 @@
   ## for $LIBS at this point. This implies that anything below
   ## can only alter $LIBS
   ##
  -echo "CFLAGS1=$CFLAGS">> Makefile.config
  -echo "OSDIR=\$(SRCDIR)/$OSDIR">> Makefile.config
  -echo "INCDIR=\$(SRCDIR)/include" >>Makefile.config
  -echo "INCLUDES0=-I\$(OSDIR) -I\$(INCDIR)">> Makefile.config
  -echo "INCLUDES1=$INCLUDES">> Makefile.config
  -echo "LIBS_SHLIB=$LIBS_SHLIB">> Makefile.config
  -echo "LDFLAGS1=$LDFLAGS">> Makefile.config
  -echo "MFLAGS_STATIC=$MFLAGS_STATIC">> Makefile.config
  -echo "REGLIB=$REGLIB">> Makefile.config
  -echo "RANLIB=$RANLIB">> Makefile.config
  -echo "SHELL=$SHELL">> Makefile.config
  +echo "CFLAGS1=$CFLAGS" >>Makefile.config
  +echo "INCLUDES1=$INCLUDES" >>Makefile.config
  +echo "LIBS_SHLIB=$LIBS_SHLIB" >>Makefile.config
  +echo "LDFLAGS1=$LDFLAGS" >>Makefile.config
  +echo "MFLAGS_STATIC=$MFLAGS_STATIC" >>Makefile.config
  +echo "REGLIB=$REGLIB" >>Makefile.config
  +echo "RANLIB=$RANLIB" >>Makefile.config
   
   ####################################################################
   ## Some OS-related stuff for the DSO mechanism:
  @@ -1759,31 +1778,31 @@
   if [ "x$using_shlib" = "x1" ] ; then
       DL_LIB=""
       case $PLAT in
  -        *-ibm-aix* )
  -            DL_LIB="-lld"
  -            ;;
  -        *-hp-hpux*)
  -            if ./helpers/TestCompile func shl_load; then
  -                :
  -            else
  -                if ./helpers/TestCompile lib dld; then
  -                    DL_LIB="-ldld"
  -                fi
  -            fi
  -            ;;
  -        * )
  -            if ./helpers/TestCompile func dlopen; then
  -                :
  -            else
  -                if ./helpers/TestCompile lib dl; then
  -                    DL_LIB="-ldl"
  -                fi
  -            fi
  -            ;;
  +	*-ibm-aix* )
  +	    DL_LIB="-lld"
  +	    ;;
  +	*-hp-hpux*)
  +	    if ./helpers/TestCompile func shl_load; then
  +		:
  +	    else
  +		if ./helpers/TestCompile lib dld; then
  +		    DL_LIB="-ldld"
  +		fi
  +	    fi
  +	    ;;
  +	* )
  +	    if ./helpers/TestCompile func dlopen; then
  +		:
  +	    else
  +		if ./helpers/TestCompile lib dl; then
  +		    DL_LIB="-ldl"
  +		fi
  +	    fi
  +	    ;;
       esac
       if [ "x$DL_LIB" != "x" ]; then
  -        LIBS="$LIBS $DL_LIB"
  -        echo " + using $DL_LIB for vendor DSO support"
  +	LIBS="$LIBS $DL_LIB"
  +	echo " + using $DL_LIB for vendor DSO support"
       fi
   fi
   
  @@ -1794,16 +1813,30 @@
   ## ap_config_auto.h so they are available to external modules needing to
   ## include Apache header files.
   ##
  -for cflag in $CFLAGS; do
  -	echo $cflag | sed 's/\\\"/\"/g' >>$tmpconfig ;
  +TEXTRA_CFLAGS=`egrep '^EXTRA_CFLAGS=' Makefile.config | tail -1 |\
  +	       sed -e 's;^EXTRA_CFLAGS=;;' -e 's;\`.*\`;;'`
  +tmpstr=`echo $CFLAGS $TEXTRA_CFLAGS |\
  +	sed -e 's;[ 	]\([+-]\);!\1;g' -e 's/\\\"/\"/g' -e 's/\([^\\]\)"/\1/g'`
  +OIFS="$IFS"
  +IFS='!'
  +for cflag in $tmpstr; do
  +    echo "$cflag" >>$tmpconfig
   done
  +IFS="$OIFS"
   awk >>$AP_CONFIG_AUTO_H <$tmpconfig '
  -	/^-D.*/ {
  -		define = substr($1, 3, length($1)-2)
  -		split(define, parts, "=")
  -		printf ("\n/* build flag: %s */\n", $0)
  -		printf ("#ifndef %s\n#define %s %s\n#endif\n", parts[1],parts[1],parts[2])
  +    /^-D.*/ {
  +	i = index($0, "=")
  +	if (i > 0) {
  +	    define = substr($0, 3, i-3)
  +	    value  = substr($0, i+1, length($0)-i)
  +	}
  +	else {
  +	    define = substr($0, 3, length($0)-2)
  +	    value  = "1";
   	}
  +	printf ("\n/* build flag: %s */\n", $0)
  +	printf ("#ifndef %s\n#define %s %s\n#endif\n", define, define, value)
  +    }
   '
   
   # finish header file
  @@ -1939,7 +1972,7 @@
   	    END { 
   		printf "SHLIBS=%s\n", shlibs;
   		printf "OBJS_PIC=%s\n", objspic;
  -            }'
  +	    }'
   
   	    $CAT << 'EOF' >> $moddir/Makefile
   
  @@ -1975,7 +2008,7 @@
   	    && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \
   	    && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \
   	    && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \
  -	           -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \
  +		   -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \
   		> Makefile.tmpl \
   	    && rm Makefile.new
   
  
  
  
  1.2       +3 -0      apache-apr/pthreads/src/Makefile.nt
  
  Index: Makefile.nt
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/Makefile.nt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- Makefile.nt	1999/01/21 23:08:31	1.1
  +++ Makefile.nt	1999/02/07 06:29:09	1.2
  @@ -55,6 +55,9 @@
   	cd ap
   	 nmake /nologo CFG="ap - Win32 %LONG%" -f ap.mak
   	cd ..
  +	cd support
  +	 nmake /nologo CFG="htpasswd - Win32 %LONG%" -f htpasswd.mak
  +	cd ..
   	cd main
   	 nmake /nologo CFG="gen_uri_delims - Win32 %LONG%" -f gen_uri_delims.mak
   	 nmake /nologo CFG="gen_test_char - Win32 %LONG%" -f gen_test_char.mak
  
  
  
  1.2       +14 -11    apache-apr/pthreads/src/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/Makefile.tmpl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- Makefile.tmpl	1999/01/21 23:08:31	1.1
  +++ Makefile.tmpl	1999/02/07 06:29:09	1.2
  @@ -30,24 +30,27 @@
   	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
   	      -o $(TARGET) buildmark.o $(OBJS) $(REGLIB) $(LIBS)
   
  -target_shared: libhttpd.ep
  +target_compile_only: subdirs modules.o
  +	$(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c
  +
  +target_shared: lib$(TARGET).ep
   	$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
   	      -o $(TARGET) -DSHARED_CORE_BOOTSTRAP main/http_main.c
   
  -libhttpd.ep: libhttpd.$(SHLIB_SUFFIX_NAME)
  +lib$(TARGET).ep: lib$(TARGET).$(SHLIB_SUFFIX_NAME)
   	$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
  -	      -o libhttpd.ep -DSHARED_CORE_TIESTATIC main/http_main.c \
  -		  -L. -lhttpd $(LIBS)
  +	      -o lib$(TARGET).ep -DSHARED_CORE_TIESTATIC main/http_main.c \
  +		  -L. -l$(TARGET) $(LIBS)
   
  -libhttpd.$(SHLIB_SUFFIX_NAME): subdirs modules.o
  +lib$(TARGET).$(SHLIB_SUFFIX_NAME): subdirs modules.o
   	$(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c
  -	$(LD_SHLIB) $(LDFLAGS_SHLIB) -o libhttpd.$(SHLIB_SUFFIX_NAME) buildmark.o $(OBJS) $(REGLIB)
  +	$(LD_SHLIB) $(LDFLAGS_SHLIB) -o lib$(TARGET).$(SHLIB_SUFFIX_NAME) buildmark.o $(OBJS) $(REGLIB)
   	@if [ ".$(SHLIB_SUFFIX_LIST)" != . ]; then \
  -		rm -f libhttpd.$(SHLIB_SUFFIX_NAME).*; \
  +		rm -f lib$(TARGET).$(SHLIB_SUFFIX_NAME).*; \
   		for suffix in $(SHLIB_SUFFIX_LIST) ""; do \
   			[ ".$$suffix" = . ] && continue; \
  -		    echo "ln libhttpd.$(SHLIB_SUFFIX_NAME) libhttpd.$(SHLIB_SUFFIX_NAME).$$suffix"; \
  -		    ln libhttpd.$(SHLIB_SUFFIX_NAME) libhttpd.$(SHLIB_SUFFIX_NAME).$$suffix; \
  +		    echo "ln lib$(TARGET).$(SHLIB_SUFFIX_NAME) lib$(TARGET).$(SHLIB_SUFFIX_NAME).$$suffix"; \
  +		    ln lib$(TARGET).$(SHLIB_SUFFIX_NAME) lib$(TARGET).$(SHLIB_SUFFIX_NAME).$$suffix; \
   		done; \
   	fi
   
  @@ -66,7 +69,7 @@
   	echo "<=== $(SDP)support"
   
   clean:
  -	-rm -f $(TARGET) libhttpd.* *.o
  +	-rm -f $(TARGET) lib$(TARGET).* *.o
   	@for i in $(SUBDIRS); do \
   		echo "===> $(SDP)$$i"; \
   		( cd $$i && $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' $@ ) || exit 1; \
  @@ -74,7 +77,7 @@
   	done
   
   distclean:
  -	-rm -f $(TARGET) libhttpd.* *.o
  +	-rm -f $(TARGET) lib$(TARGET).* *.o
   	@for i in $(SUBDIRS); do \
   		echo "===> $(SDP)$$i"; \
   		( cd $$i && $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' $@ ) || exit 1; \
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/buildmark.c
  
  Index: buildmark.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/buildmark.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- buildmark.c	1999/01/21 23:08:31	1.1
  +++ buildmark.c	1999/02/07 06:29:10	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.1                  apache-apr/pthreads/src/Makefile_win32.txt
  
  Index: Makefile_win32.txt
  ===================================================================
  # Makefile for Windows NT and Windows 95
  
  # Targets are:
  #   _apache    - build Apache in Release mode
  #   install    - build and install a Release build
  #   clean      - remove (most) files generated by a Release build
  #
  # The default installation directory is \Apache. This can be changed
  # with the INSTDIR macro, for example:
  #
  #   nmake /f Makefile_win32.txt INSTDIR="d:\Program Files\Apache" install
  #
  # Note: this does *NOT* change the compiled in default "server root"
  
  !IF "$(INSTDIR)" == ""
  INSTDIR=\Apache
  !MESSAGE Using default install directory \Apache
  !ENDIF 
  
  default:	_apache
  
  _apache: _build
  
  install: _build _install
  
  _build:
  	cd os\win32
  	 nmake /nologo CFG="ApacheOS - Win32 Release" -f ApacheOS.mak
  	cd ..\..
  	cd regex
  	 nmake /nologo CFG="regex - Win32 Release" -f regex.mak
  	cd ..
  	cd ap
  	 nmake /nologo CFG="ap - Win32 Release" -f ap.mak
  	cd ..
  	cd main
  	 nmake /nologo CFG="gen_uri_delims - Win32 Release" -f gen_uri_delims.mak
  	 nmake /nologo CFG="gen_test_char - Win32 Release" -f gen_test_char.mak
  	cd ..
  	 -del CoreR\buildmark.obj
  	 nmake /nologo CFG="ApacheCore - Win32 Release" -f ApacheCore.mak
  	 nmake /nologo CFG="Apache - Win32 Release" -f Apache.mak
  	cd os\win32
  	 set CFG=ApacheModuleStatus - Win32 Release
  	 nmake /nologo CFG="ApacheModuleStatus - Win32 Release" -f ApacheModuleStatus.mak
  #	 nmake /nologo CFG ""/nologo -f ApacheModuleStatus.mak"=ApacheModuleInfo - Win32 Release" -f ApacheModuleInfo.mak
  	 nmake /nologo CFG="ApacheModuleAuthAnon - Win32 Release" -f ApacheModuleAuthAnon.mak
  	 nmake /nologo CFG="ApacheModuleDigest - Win32 Release" -f ApacheModuleDigest.mak
  	 nmake /nologo CFG="ApacheModuleCERNMeta - Win32 Release" -f ApacheModuleCERNMeta.mak
  	 nmake /nologo CFG="ApacheModuleExpires - Win32 Release" -f ApacheModuleExpires.mak
  	 nmake /nologo CFG="ApacheModuleHeaders - Win32 Release" -f ApacheModuleHeaders.mak
  	 nmake /nologo CFG="ApacheModuleSpeling - Win32 Release" -f ApacheModuleSpeling.mak
  	 nmake /nologo CFG="ApacheModuleUserTrack - Win32 Release" -f ApacheModuleUserTrack.mak
  	 nmake /nologo CFG="ApacheModuleRewrite - Win32 Release" -f ApacheModuleRewrite.mak
  	cd ..\..
  	cd modules\proxy
  	 nmake /nologo CFG="ApacheModuleProxy - Win32 Release" -f ApacheModuleProxy.mak
  	cd ..\..
  
  _install:
  	-mkdir $(INSTDIR)
  	-mkdir $(INSTDIR)\modules
  	-mkdir $(INSTDIR)\logs
  	-mkdir $(INSTDIR)\conf
  	copy ApacheR\Apache.exe $(INSTDIR)
  	copy CoreR\ApacheCore.dll $(INSTDIR)
  	copy os\win32\ApacheModuleStatusR\ApacheModuleStatus.dll $(INSTDIR)\modules
  #       copy os\win32\ApacheModuleInfoR\ApacheModuleInfo.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleAuthAnonR\ApacheModuleAuthAnon.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleDigestR\ApacheModuleDigest.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleCERNMetaR\ApacheModuleCERNMeta.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleExpiresR\ApacheModuleExpires.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleHeadersR\ApacheModuleHeaders.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleRewriteR\ApacheModuleRewrite.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleSpelingR\ApacheModuleSpeling.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleUserTrackR\ApacheModuleUserTrack.dll $(INSTDIR)\modules
  	copy modules\proxy\Release\ApacheModuleProxy.dll $(INSTDIR)\modules
  
  clean:
  	cd os\win32
  	 nmake /nologo CFG="ApacheOS - Win32 Release" -f ApacheOS.mak clean
  	cd ..\..
  	cd regex
  	 nmake /nologo CFG="regex - Win32 Release" -f regex.mak clean
  	cd ..
  	cd ap
  	 nmake /nologo CFG="ap - Win32 Release" -f ap.mak clean
  	cd ..
  	cd main
  	 nmake /nologo CFG="gen_uri_delims - Win32 Release" -f gen_uri_delims.mak clean
  	 del uri_delims.h
  	 nmake /nologo CFG="gen_test_char - Win32 Release" -f gen_test_char.mak clean
  	 del test_char.h
  	cd ..
  	 nmake /nologo CFG="ApacheCore - Win32 Release" -f ApacheCore.mak clean
  	 nmake /nologo CFG="Apache - Win32 Release" -f Apache.mak clean
  	cd os\win32
  	 nmake /nologo CFG="ApacheModuleStatus - Win32 Release" -f ApacheModuleStatus.mak clean
  #	 nmake /nologo CFG="ApacheModuleInfo - Win32 Release" -f ApacheModuleInfo.mak clean
  	 nmake /nologo CFG="ApacheModuleAuthAnon - Win32 Release" -f ApacheModuleAuthAnon.mak clean
  	 nmake /nologo CFG="ApacheModuleDigest - Win32 Release" -f ApacheModuleDigest.mak clean
  	 nmake /nologo CFG="ApacheModuleCERNMeta - Win32 Release" -f ApacheModuleCERNMeta.mak clean
  	 nmake /nologo CFG="ApacheModuleExpires - Win32 Release" -f ApacheModuleExpires.mak clean
  	 nmake /nologo CFG="ApacheModuleHeaders - Win32 Release" -f ApacheModuleHeaders.mak clean
  	 nmake /nologo CFG="ApacheModuleSpeling - Win32 Release" -f ApacheModuleSpeling.mak clean
  	 nmake /nologo CFG="ApacheModuleUserTrack - Win32 Release" -f ApacheModuleUserTrack.mak clean
  	 nmake /nologo CFG="ApacheModuleRewrite - Win32 Release" -f ApacheModuleRewrite.mak clean
  	cd ..\..
  	cd modules\proxy
  	 nmake /nologo CFG="ApacheModuleProxy - Win32 Release" -f ApacheModuleProxy.mak clean
  	cd ..\..
   	cd os\win32\installer\installdll
  	 nmake /nologo CFG="install - Win32 Release" -f install.mak clean
  	cd ..\..\..
  
  installdll:
   	cd os\win32\installer\installdll
  	 nmake /nologo CFG="install - Win32 Release" -f install.mak
  	cd ..\..\..
  
  
  
  1.1                  apache-apr/pthreads/src/Makefile_win32_debug.txt
  
  Index: Makefile_win32_debug.txt
  ===================================================================
  # Makefile for Windows NT and Windows 95
  
  # Targets are:
  #   _apache    - build Apache in Debug mode
  #   install    - build and install a Debug build
  #   clean      - remove (most) files generated by a Debug build
  #
  # The default installation directory is \Apache. This can be changed
  # with the INSTDIR macro, for example:
  #
  #   nmake /f Makefile_win32_debug.txt INSTDIR="d:\Program Files\Apache" install
  #
  # Note: this does *NOT* change the compiled in default "server root"
  
  !IF "$(INSTDIR)" == ""
  INSTDIR=\Apache
  !MESSAGE Using default install directory \Apache
  !ENDIF 
  
  default:	_apache
  
  _apache: _build
  
  install: _build _install
  
  _build:
  	cd os\win32
  	 nmake /nologo CFG="ApacheOS - Win32 Debug" -f ApacheOS.mak
  	cd ..\..
  	cd regex
  	 nmake /nologo CFG="regex - Win32 Debug" -f regex.mak
  	cd ..
  	cd ap
  	 nmake /nologo CFG="ap - Win32 Debug" -f ap.mak
  	cd ..
  	cd main
  	 nmake /nologo CFG="gen_uri_delims - Win32 Debug" -f gen_uri_delims.mak
  	 nmake /nologo CFG="gen_test_char - Win32 Debug" -f gen_test_char.mak
  	cd ..
  	 -del CoreD\buildmark.obj
  	 nmake /nologo CFG="ApacheCore - Win32 Debug" -f ApacheCore.mak
  	 nmake /nologo CFG="Apache - Win32 Debug" -f Apache.mak
  	cd os\win32
  	 set CFG=ApacheModuleStatus - Win32 Debug
  	 nmake /nologo CFG="ApacheModuleStatus - Win32 Debug" -f ApacheModuleStatus.mak
  #	 nmake /nologo CFG ""/nologo -f ApacheModuleStatus.mak"=ApacheModuleInfo - Win32 Debug" -f ApacheModuleInfo.mak
  	 nmake /nologo CFG="ApacheModuleAuthAnon - Win32 Debug" -f ApacheModuleAuthAnon.mak
  	 nmake /nologo CFG="ApacheModuleDigest - Win32 Debug" -f ApacheModuleDigest.mak
  	 nmake /nologo CFG="ApacheModuleCERNMeta - Win32 Debug" -f ApacheModuleCERNMeta.mak
  	 nmake /nologo CFG="ApacheModuleExpires - Win32 Debug" -f ApacheModuleExpires.mak
  	 nmake /nologo CFG="ApacheModuleHeaders - Win32 Debug" -f ApacheModuleHeaders.mak
  	 nmake /nologo CFG="ApacheModuleSpeling - Win32 Debug" -f ApacheModuleSpeling.mak
  	 nmake /nologo CFG="ApacheModuleUserTrack - Win32 Debug" -f ApacheModuleUserTrack.mak
  	 nmake /nologo CFG="ApacheModuleRewrite - Win32 Debug" -f ApacheModuleRewrite.mak
  	cd ..\..
  	cd modules\proxy
  	 nmake /nologo CFG="ApacheModuleProxy - Win32 Debug" -f ApacheModuleProxy.mak
  	cd ..\..
  
  _install:
  	-mkdir $(INSTDIR)
  	-mkdir $(INSTDIR)\modules
  	-mkdir $(INSTDIR)\logs
  	-mkdir $(INSTDIR)\conf
  	copy ApacheD\Apache.exe $(INSTDIR)
  	copy CoreD\ApacheCore.dll $(INSTDIR)
  	copy os\win32\ApacheModuleStatusD\ApacheModuleStatus.dll $(INSTDIR)\modules
  #       copy os\win32\ApacheModuleInfoD\ApacheModuleInfo.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleAuthAnonD\ApacheModuleAuthAnon.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleDigestD\ApacheModuleDigest.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleCERNMetaD\ApacheModuleCERNMeta.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleExpiresD\ApacheModuleExpires.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleHeadersD\ApacheModuleHeaders.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleRewriteD\ApacheModuleRewrite.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleSpelingD\ApacheModuleSpeling.dll $(INSTDIR)\modules
  	copy os\win32\ApacheModuleUserTrackD\ApacheModuleUserTrack.dll $(INSTDIR)\modules
  	copy modules\proxy\Debug\ApacheModuleProxy.dll $(INSTDIR)\modules
  
  clean:
  	cd os\win32
  	 nmake /nologo CFG="ApacheOS - Win32 Debug" -f ApacheOS.mak clean
  	cd ..\..
  	cd regex
  	 nmake /nologo CFG="regex - Win32 Debug" -f regex.mak clean
  	cd ..
  	cd ap
  	 nmake /nologo CFG="ap - Win32 Debug" -f ap.mak clean
  	cd ..
  	cd main
  	 nmake /nologo CFG="gen_uri_delims - Win32 Debug" -f gen_uri_delims.mak clean
  	 del uri_delims.h
  	 nmake /nologo CFG="gen_test_char - Win32 Debug" -f gen_test_char.mak clean
  	 del test_char.h
  	cd ..
  	 nmake /nologo CFG="ApacheCore - Win32 Debug" -f ApacheCore.mak clean
  	 nmake /nologo CFG="Apache - Win32 Debug" -f Apache.mak clean
  	cd os\win32
  	 nmake /nologo CFG="ApacheModuleStatus - Win32 Debug" -f ApacheModuleStatus.mak clean
  #	 nmake /nologo CFG="ApacheModuleInfo - Win32 Debug" -f ApacheModuleInfo.mak clean
  	 nmake /nologo CFG="ApacheModuleAuthAnon - Win32 Debug" -f ApacheModuleAuthAnon.mak clean
  	 nmake /nologo CFG="ApacheModuleDigest - Win32 Debug" -f ApacheModuleDigest.mak clean
  	 nmake /nologo CFG="ApacheModuleCERNMeta - Win32 Debug" -f ApacheModuleCERNMeta.mak clean
  	 nmake /nologo CFG="ApacheModuleExpires - Win32 Debug" -f ApacheModuleExpires.mak clean
  	 nmake /nologo CFG="ApacheModuleHeaders - Win32 Debug" -f ApacheModuleHeaders.mak clean
  	 nmake /nologo CFG="ApacheModuleSpeling - Win32 Debug" -f ApacheModuleSpeling.mak clean
  	 nmake /nologo CFG="ApacheModuleUserTrack - Win32 Debug" -f ApacheModuleUserTrack.mak clean
  	 nmake /nologo CFG="ApacheModuleRewrite - Win32 Debug" -f ApacheModuleRewrite.mak clean
  	cd ..\..
  	cd modules\proxy
  	 nmake /nologo CFG="ApacheModuleProxy - Win32 Debug" -f ApacheModuleProxy.mak clean
  	cd ..\..
   	cd os\win32\installer\installdll
  	 nmake /nologo CFG="install - Win32 Debug" -f install.mak clean
  	cd ..\..\..
  
  installdll:
   	cd os\win32\installer\installdll
  	 nmake /nologo CFG="install - Win32 Debug" -f install.mak
  	cd ..\..\..
  
  
  
  1.2       +22 -14    apache-apr/pthreads/src/ap/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/ap/Makefile.tmpl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- Makefile.tmpl	1999/01/21 23:08:31	1.1
  +++ Makefile.tmpl	1999/02/07 06:29:13	1.2
  @@ -6,7 +6,7 @@
   LIB=libap.a
   
   OBJS=ap_execve.o ap_cpystrn.o ap_signal.o \
  -     ap_slack.o ap_snprintf.o ap_fnmatch.o
  +     ap_slack.o ap_snprintf.o ap_fnmatch.o ap_md5c.o
   
   .c.o:
   	$(CC) -c $(INCLUDES) $(CFLAGS) $<
  @@ -41,25 +41,33 @@
   # DO NOT REMOVE
   ap_cpystrn.o: ap_cpystrn.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \
    $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
  - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/alloc.h \
  - $(INCDIR)/buff.h $(INCDIR)/ap.h $(INCDIR)/util_uri.h
  + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \
  + $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap.h \
  + $(INCDIR)/util_uri.h
   ap_execve.o: ap_execve.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \
    $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
  - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/alloc.h \
  - $(INCDIR)/buff.h $(INCDIR)/ap.h $(INCDIR)/util_uri.h
  + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \
  + $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap.h \
  + $(INCDIR)/util_uri.h
   ap_fnmatch.o: ap_fnmatch.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \
  - $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(INCDIR)/ap_ctype.h \
  - $(INCDIR)/hsregex.h $(INCDIR)/fnmatch.h
  + $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \
  + $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/fnmatch.h
  +ap_md5c.o: ap_md5c.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \
  + $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \
  + $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/ap_md5.h \
  + $(INCDIR)/ap.h
   ap_signal.o: ap_signal.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \
    $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
  - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/alloc.h \
  - $(INCDIR)/buff.h $(INCDIR)/ap.h $(INCDIR)/util_uri.h
  + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \
  + $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap.h \
  + $(INCDIR)/util_uri.h
   ap_slack.o: ap_slack.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \
    $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
  - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/alloc.h \
  - $(INCDIR)/buff.h $(INCDIR)/ap.h $(INCDIR)/util_uri.h \
  - $(INCDIR)/http_log.h
  + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \
  + $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap.h \
  + $(INCDIR)/util_uri.h $(INCDIR)/http_log.h
   ap_snprintf.o: ap_snprintf.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \
    $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
  - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/alloc.h \
  - $(INCDIR)/buff.h $(INCDIR)/ap.h $(INCDIR)/util_uri.h
  + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \
  + $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap.h \
  + $(INCDIR)/util_uri.h
  
  
  
  1.2       +4 -0      apache-apr/pthreads/src/ap/ap.dsp
  
  Index: ap.dsp
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/ap/ap.dsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap.dsp	1999/01/21 23:08:31	1.1
  +++ ap.dsp	1999/02/07 06:29:13	1.2
  @@ -102,5 +102,9 @@
   
   # PROP Default_Filter ""
   # End Group
  +# Begin Source File
  +
  +SOURCE=.\ap_md5c.c
  +# End Source File
   # End Target
   # End Project
  
  
  
  1.2       +170 -45   apache-apr/pthreads/src/ap/ap.mak
  
  Index: ap.mak
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/ap/ap.mak,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap.mak	1999/01/21 23:08:31	1.1
  +++ ap.mak	1999/02/07 06:29:13	1.2
  @@ -25,8 +25,6 @@
   NULL=nul
   !ENDIF 
   
  -CPP=cl.exe
  -
   !IF  "$(CFG)" == "ap - Win32 Release"
   
   OUTDIR=.\Release
  @@ -48,6 +46,7 @@
   CLEAN :
   	-@erase "$(INTDIR)\ap_cpystrn.obj"
   	-@erase "$(INTDIR)\ap_fnmatch.obj"
  +	-@erase "$(INTDIR)\ap_md5c.obj"
   	-@erase "$(INTDIR)\ap_signal.obj"
   	-@erase "$(INTDIR)\ap_slack.obj"
   	-@erase "$(INTDIR)\ap_snprintf.obj"
  @@ -57,10 +56,42 @@
   "$(OUTDIR)" :
       if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
   
  +CPP=cl.exe
   CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D\
    "_WINDOWS" /Fp"$(INTDIR)\ap.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
   CPP_OBJS=.\Release/
   CPP_SBRS=.
  +
  +.c{$(CPP_OBJS)}.obj::
  +   $(CPP) @<<
  +   $(CPP_PROJ) $< 
  +<<
  +
  +.cpp{$(CPP_OBJS)}.obj::
  +   $(CPP) @<<
  +   $(CPP_PROJ) $< 
  +<<
  +
  +.cxx{$(CPP_OBJS)}.obj::
  +   $(CPP) @<<
  +   $(CPP_PROJ) $< 
  +<<
  +
  +.c{$(CPP_SBRS)}.sbr::
  +   $(CPP) @<<
  +   $(CPP_PROJ) $< 
  +<<
  +
  +.cpp{$(CPP_SBRS)}.sbr::
  +   $(CPP) @<<
  +   $(CPP_PROJ) $< 
  +<<
  +
  +.cxx{$(CPP_SBRS)}.sbr::
  +   $(CPP) @<<
  +   $(CPP_PROJ) $< 
  +<<
  +
   BSC32=bscmake.exe
   BSC32_FLAGS=/nologo /o"$(OUTDIR)\ap.bsc" 
   BSC32_SBRS= \
  @@ -70,6 +101,7 @@
   LIB32_OBJS= \
   	"$(INTDIR)\ap_cpystrn.obj" \
   	"$(INTDIR)\ap_fnmatch.obj" \
  +	"$(INTDIR)\ap_md5c.obj" \
   	"$(INTDIR)\ap_signal.obj" \
   	"$(INTDIR)\ap_slack.obj" \
   	"$(INTDIR)\ap_snprintf.obj"
  @@ -100,6 +132,7 @@
   CLEAN :
   	-@erase "$(INTDIR)\ap_cpystrn.obj"
   	-@erase "$(INTDIR)\ap_fnmatch.obj"
  +	-@erase "$(INTDIR)\ap_md5c.obj"
   	-@erase "$(INTDIR)\ap_signal.obj"
   	-@erase "$(INTDIR)\ap_slack.obj"
   	-@erase "$(INTDIR)\ap_snprintf.obj"
  @@ -109,30 +142,12 @@
   "$(OUTDIR)" :
       if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
   
  +CPP=cl.exe
   CPP_PROJ=/nologo /MDd /W3 /GX /Z7 /Od /I "../include" /D "WIN32" /D "_DEBUG" /D\
    "_WINDOWS" /Fp"$(INTDIR)\ap.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
   CPP_OBJS=.\Debug/
   CPP_SBRS=.
  -BSC32=bscmake.exe
  -BSC32_FLAGS=/nologo /o"$(OUTDIR)\ap.bsc" 
  -BSC32_SBRS= \
  -	
  -LIB32=link.exe -lib
  -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\ap.lib" 
  -LIB32_OBJS= \
  -	"$(INTDIR)\ap_cpystrn.obj" \
  -	"$(INTDIR)\ap_fnmatch.obj" \
  -	"$(INTDIR)\ap_signal.obj" \
  -	"$(INTDIR)\ap_slack.obj" \
  -	"$(INTDIR)\ap_snprintf.obj"
   
  -"$(OUTDIR)\ap.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
  -    $(LIB32) @<<
  -  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
  -<<
  -
  -!ENDIF 
  -
   .c{$(CPP_OBJS)}.obj::
      $(CPP) @<<
      $(CPP_PROJ) $< 
  @@ -163,7 +178,28 @@
      $(CPP_PROJ) $< 
   <<
   
  +BSC32=bscmake.exe
  +BSC32_FLAGS=/nologo /o"$(OUTDIR)\ap.bsc" 
  +BSC32_SBRS= \
  +	
  +LIB32=link.exe -lib
  +LIB32_FLAGS=/nologo /out:"$(OUTDIR)\ap.lib" 
  +LIB32_OBJS= \
  +	"$(INTDIR)\ap_cpystrn.obj" \
  +	"$(INTDIR)\ap_fnmatch.obj" \
  +	"$(INTDIR)\ap_md5c.obj" \
  +	"$(INTDIR)\ap_signal.obj" \
  +	"$(INTDIR)\ap_slack.obj" \
  +	"$(INTDIR)\ap_snprintf.obj"
  +
  +"$(OUTDIR)\ap.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
  +    $(LIB32) @<<
  +  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
  +<<
  +
  +!ENDIF 
   
  +
   !IF "$(CFG)" == "ap - Win32 Release" || "$(CFG)" == "ap - Win32 Debug"
   SOURCE=.\ap_cpystrn.c
   
  @@ -172,16 +208,23 @@
   DEP_CPP_AP_CP=\
   	"..\include\alloc.h"\
   	"..\include\ap.h"\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_mmn.h"\
   	"..\include\buff.h"\
  -	"..\include\conf.h"\
   	"..\include\hsregex.h"\
   	"..\include\httpd.h"\
   	"..\include\util_uri.h"\
   	"..\os\win32\os.h"\
   	"..\os\win32\readdir.h"\
  +	{$(INCLUDE)}"sys\stat.h"\
  +	{$(INCLUDE)}"sys\types.h"\
   	
   NODEP_CPP_AP_CP=\
  -	"..\include\apctype.h"\
  +	"..\include\ap_config_auto.h"\
  +	"..\include\ebcdic.h"\
  +	"..\include\os.h"\
  +	"..\include\sfio.h"\
   	
   
   "$(INTDIR)\ap_cpystrn.obj" : $(SOURCE) $(DEP_CPP_AP_CP) "$(INTDIR)"
  @@ -192,17 +235,16 @@
   DEP_CPP_AP_CP=\
   	"..\include\alloc.h"\
   	"..\include\ap.h"\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_mmn.h"\
   	"..\include\buff.h"\
  -	"..\include\conf.h"\
   	"..\include\hsregex.h"\
   	"..\include\httpd.h"\
   	"..\include\util_uri.h"\
   	"..\os\win32\os.h"\
   	"..\os\win32\readdir.h"\
   	
  -NODEP_CPP_AP_CP=\
  -	"..\include\hide.h"\
  -	
   
   "$(INTDIR)\ap_cpystrn.obj" : $(SOURCE) $(DEP_CPP_AP_CP) "$(INTDIR)"
   
  @@ -210,9 +252,13 @@
   !ENDIF 
   
   SOURCE=.\ap_fnmatch.c
  +
  +!IF  "$(CFG)" == "ap - Win32 Release"
  +
   DEP_CPP_AP_FN=\
   	"..\include\ap_config.h"\
   	"..\include\ap_ctype.h"\
  +	"..\include\ap_mmn.h"\
   	"..\include\fnmatch.h"\
   	"..\include\hsregex.h"\
   	"..\os\win32\os.h"\
  @@ -227,6 +273,22 @@
   "$(INTDIR)\ap_fnmatch.obj" : $(SOURCE) $(DEP_CPP_AP_FN) "$(INTDIR)"
   
   
  +!ELSEIF  "$(CFG)" == "ap - Win32 Debug"
  +
  +DEP_CPP_AP_FN=\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_mmn.h"\
  +	"..\include\fnmatch.h"\
  +	"..\include\hsregex.h"\
  +	"..\os\win32\os.h"\
  +	
  +
  +"$(INTDIR)\ap_fnmatch.obj" : $(SOURCE) $(DEP_CPP_AP_FN) "$(INTDIR)"
  +
  +
  +!ENDIF 
  +
   SOURCE=.\ap_signal.c
   
   !IF  "$(CFG)" == "ap - Win32 Release"
  @@ -234,16 +296,23 @@
   DEP_CPP_AP_SI=\
   	"..\include\alloc.h"\
   	"..\include\ap.h"\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_mmn.h"\
   	"..\include\buff.h"\
  -	"..\include\conf.h"\
   	"..\include\hsregex.h"\
   	"..\include\httpd.h"\
   	"..\include\util_uri.h"\
   	"..\os\win32\os.h"\
   	"..\os\win32\readdir.h"\
  +	{$(INCLUDE)}"sys\stat.h"\
  +	{$(INCLUDE)}"sys\types.h"\
   	
   NODEP_CPP_AP_SI=\
  -	"..\include\apctype.h"\
  +	"..\include\ap_config_auto.h"\
  +	"..\include\ebcdic.h"\
  +	"..\include\os.h"\
  +	"..\include\sfio.h"\
   	
   
   "$(INTDIR)\ap_signal.obj" : $(SOURCE) $(DEP_CPP_AP_SI) "$(INTDIR)"
  @@ -254,17 +323,16 @@
   DEP_CPP_AP_SI=\
   	"..\include\alloc.h"\
   	"..\include\ap.h"\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_mmn.h"\
   	"..\include\buff.h"\
  -	"..\include\conf.h"\
   	"..\include\hsregex.h"\
   	"..\include\httpd.h"\
   	"..\include\util_uri.h"\
   	"..\os\win32\os.h"\
   	"..\os\win32\readdir.h"\
   	
  -NODEP_CPP_AP_SI=\
  -	"..\include\hide.h"\
  -	
   
   "$(INTDIR)\ap_signal.obj" : $(SOURCE) $(DEP_CPP_AP_SI) "$(INTDIR)"
   
  @@ -278,17 +346,24 @@
   DEP_CPP_AP_SL=\
   	"..\include\alloc.h"\
   	"..\include\ap.h"\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_mmn.h"\
   	"..\include\buff.h"\
  -	"..\include\conf.h"\
   	"..\include\hsregex.h"\
   	"..\include\http_log.h"\
   	"..\include\httpd.h"\
   	"..\include\util_uri.h"\
   	"..\os\win32\os.h"\
   	"..\os\win32\readdir.h"\
  +	{$(INCLUDE)}"sys\stat.h"\
  +	{$(INCLUDE)}"sys\types.h"\
   	
   NODEP_CPP_AP_SL=\
  -	"..\include\apctype.h"\
  +	"..\include\ap_config_auto.h"\
  +	"..\include\ebcdic.h"\
  +	"..\include\os.h"\
  +	"..\include\sfio.h"\
   	
   
   "$(INTDIR)\ap_slack.obj" : $(SOURCE) $(DEP_CPP_AP_SL) "$(INTDIR)"
  @@ -299,8 +374,10 @@
   DEP_CPP_AP_SL=\
   	"..\include\alloc.h"\
   	"..\include\ap.h"\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_mmn.h"\
   	"..\include\buff.h"\
  -	"..\include\conf.h"\
   	"..\include\hsregex.h"\
   	"..\include\http_log.h"\
   	"..\include\httpd.h"\
  @@ -308,9 +385,6 @@
   	"..\os\win32\os.h"\
   	"..\os\win32\readdir.h"\
   	
  -NODEP_CPP_AP_SL=\
  -	"..\include\hide.h"\
  -	
   
   "$(INTDIR)\ap_slack.obj" : $(SOURCE) $(DEP_CPP_AP_SL) "$(INTDIR)"
   
  @@ -324,16 +398,23 @@
   DEP_CPP_AP_SN=\
   	"..\include\alloc.h"\
   	"..\include\ap.h"\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_mmn.h"\
   	"..\include\buff.h"\
  -	"..\include\conf.h"\
   	"..\include\hsregex.h"\
   	"..\include\httpd.h"\
   	"..\include\util_uri.h"\
   	"..\os\win32\os.h"\
   	"..\os\win32\readdir.h"\
  +	{$(INCLUDE)}"sys\stat.h"\
  +	{$(INCLUDE)}"sys\types.h"\
   	
   NODEP_CPP_AP_SN=\
  -	"..\include\apctype.h"\
  +	"..\include\ap_config_auto.h"\
  +	"..\include\ebcdic.h"\
  +	"..\include\os.h"\
  +	"..\include\sfio.h"\
   	
   
   "$(INTDIR)\ap_snprintf.obj" : $(SOURCE) $(DEP_CPP_AP_SN) "$(INTDIR)"
  @@ -342,15 +423,59 @@
   !ELSEIF  "$(CFG)" == "ap - Win32 Debug"
   
   DEP_CPP_AP_SN=\
  -	"..\include\conf.h"\
  +	"..\include\alloc.h"\
  +	"..\include\ap.h"\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_mmn.h"\
  +	"..\include\buff.h"\
   	"..\include\hsregex.h"\
  +	"..\include\httpd.h"\
  +	"..\include\util_uri.h"\
   	"..\os\win32\os.h"\
  -	
  -NODEP_CPP_AP_SN=\
  -	"..\include\hide.h"\
  +	"..\os\win32\readdir.h"\
   	
   
   "$(INTDIR)\ap_snprintf.obj" : $(SOURCE) $(DEP_CPP_AP_SN) "$(INTDIR)"
  +
  +
  +!ENDIF 
  +
  +SOURCE=.\ap_md5c.c
  +
  +!IF  "$(CFG)" == "ap - Win32 Release"
  +
  +DEP_CPP_AP_MD=\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_md5.h"\
  +	"..\include\ap_mmn.h"\
  +	"..\include\hsregex.h"\
  +	"..\os\win32\os.h"\
  +	{$(INCLUDE)}"sys\stat.h"\
  +	{$(INCLUDE)}"sys\types.h"\
  +	
  +NODEP_CPP_AP_MD=\
  +	"..\include\ap_config_auto.h"\
  +	"..\include\os.h"\
  +	".\ebcdic.h"\
  +	
  +
  +"$(INTDIR)\ap_md5c.obj" : $(SOURCE) $(DEP_CPP_AP_MD) "$(INTDIR)"
  +
  +
  +!ELSEIF  "$(CFG)" == "ap - Win32 Debug"
  +
  +DEP_CPP_AP_MD=\
  +	"..\include\ap_config.h"\
  +	"..\include\ap_ctype.h"\
  +	"..\include\ap_md5.h"\
  +	"..\include\ap_mmn.h"\
  +	"..\include\hsregex.h"\
  +	"..\os\win32\os.h"\
  +	
  +
  +"$(INTDIR)\ap_md5c.obj" : $(SOURCE) $(DEP_CPP_AP_MD) "$(INTDIR)"
   
   
   !ENDIF 
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/ap/ap_cpystrn.c
  
  Index: ap_cpystrn.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/ap/ap_cpystrn.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap_cpystrn.c	1999/01/21 23:08:31	1.1
  +++ ap_cpystrn.c	1999/02/07 06:29:13	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +60 -18    apache-apr/pthreads/src/ap/ap_execve.c
  
  Index: ap_execve.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/ap/ap_execve.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap_execve.c	1999/01/21 23:08:31	1.1
  +++ ap_execve.c	1999/02/07 06:29:13	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -126,7 +126,8 @@
       }
       va_end(adummy);
   
  -    argv = (char **) malloc((argc + 2) * sizeof(*argv));
  +    if ((argv = (char **) malloc((argc + 2) * sizeof(*argv))) == NULL)
  +	return -1;
   
       /* Pass two --- copy the argument strings into the result space */
       va_start(adummy, argv0);
  @@ -143,10 +144,27 @@
       return ret;
   }
   
  +/* Count number of entries in vector "args", including the trailing NULL entry
  + */
  +static int
  +count_args(const char **args)
  +{
  +    int i;
  +    for (i = 0; args[i] != NULL; ++i) {
  +	continue;
  +    }
  +    return i+1;
  +}
  +
  +/* Emulate the execve call, respecting a #!/interpreter line if present.
  + * On "real" unixes, the kernel does this.
  + * We have to fiddle with the argv array to make it work on platforms
  + * which don't support the "hashbang" interpreter line by default.
  + */
   int ap_execve(const char *filename, const char *argv[],
   	      const char *envp[])
   {
  -    const char *argv0 = argv[0];
  +    const char **script_argv;
       extern char **environ;
   
       if (envp == NULL) {
  @@ -174,26 +192,50 @@
        * ELOOP  filename contains a circular reference (i.e., via a symbolic link)
        */
   
  -    if (errno == ENOEXEC
  -    /* Probably a script.
  -     * Have a look; if there's a "#!" header then try to emulate
  -     * the feature found in all modern OS's:
  -     * Interpret the line following the #! as a command line
  -     * in shell style.
  -     */
  -	&& (argv = hashbang(filename, argv)) != NULL) {
  +    if (errno == ENOEXEC) {
  +	/* Probably a script.
  +	 * Have a look; if there's a "#!" header then try to emulate
  +	 * the feature found in all modern OS's:
  +	 * Interpret the line following the #! as a command line
  +	 * in shell style.
  +	 */
  +	if ((script_argv = hashbang(filename, argv)) != NULL) {
  +
  +	    /* new filename is the interpreter to call */
  +	    filename = script_argv[0];
  +
  +	    /* Restore argv[0] as on entry */
  +	    if (argv[0] != NULL) {
  +		script_argv[0] = argv[0];
  +	    }
   
  -	/* new filename is the interpreter to call */
  -	filename = argv[0];
  +	    execve(filename, script_argv, envp);
   
  -	/* Restore argv[0] as on entry */
  -	if (argv0 != NULL) {
  -	    argv[0] = argv0;
  +	    free(script_argv);
   	}
  +	/*
  +	 * Script doesn't start with a hashbang line!
  +	 * So, try to have the default shell execute it.
  +	 * For this, the size of argv must be increased by one
  +	 * entry: the shell's name. The remaining args are appended.
  +	 */
  +	else {
  +	    int i = count_args(argv) + 1;   /* +1 for leading SHELL_PATH */
  +
  +	    if ((script_argv = malloc(sizeof(*script_argv) * i)) == NULL)
  +		return -1;
  +
  +	    script_argv[0] = SHELL_PATH;
  +
  +	    while (i > 0) {
  +		script_argv[i] = argv[i-1];
  +		--i;
  +	    }
   
  -	execve(filename, argv, envp);
  +	    execve(SHELL_PATH, script_argv, envp);
   
  -	free(argv);
  +	    free(script_argv);
  +	}
       }
       return -1;
   }
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/ap/ap_signal.c
  
  Index: ap_signal.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/ap/ap_signal.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap_signal.c	1999/01/21 23:08:31	1.1
  +++ ap_signal.c	1999/02/07 06:29:14	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/ap/ap_slack.c
  
  Index: ap_slack.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/ap/ap_slack.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap_slack.c	1999/01/21 23:08:31	1.1
  +++ ap_slack.c	1999/02/07 06:29:14	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/ap/ap_snprintf.c
  
  Index: ap_snprintf.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/ap/ap_snprintf.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap_snprintf.c	1999/01/21 23:08:31	1.1
  +++ ap_snprintf.c	1999/02/07 06:29:14	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.1                  apache-apr/pthreads/src/ap/ap_md5c.c
  
  Index: ap_md5c.c
  ===================================================================
  /*
   * This is work is derived from material Copyright RSA Data Security, Inc.
   *
   * The RSA copyright statement and Licence for that original material is
   * included below. This is followed by the Apache copyright statement and
   * licence for the modifications made to that material.
   */
  
  /* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
   */
  
  /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
     rights reserved.
  
     License to copy and use this software is granted provided that it
     is identified as the "RSA Data Security, Inc. MD5 Message-Digest
     Algorithm" in all material mentioning or referencing this software
     or this function.
  
     License is also granted to make and use derivative works provided
     that such works are identified as "derived from the RSA Data
     Security, Inc. MD5 Message-Digest Algorithm" in all material
     mentioning or referencing the derived work.
  
     RSA Data Security, Inc. makes no representations concerning either
     the merchantability of this software or the suitability of this
     software for any particular purpose. It is provided "as is"
     without express or implied warranty of any kind.
  
     These notices must be retained in any copies of any part of this
     documentation and/or software.
   */
  
  /* ====================================================================
   * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. All advertising materials mentioning features or use of this
   *    software must display the following acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * 4. The names "Apache Server" and "Apache Group" must not be used to
   *    endorse or promote products derived from this software without
   *    prior written permission. For written permission, please contact
   *    apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 6. Redistributions of any form whatsoever must retain the following
   *    acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
   * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   * OF THE POSSIBILITY OF SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Group and was originally based
   * on public domain software written at the National Center for
   * Supercomputing Applications, University of Illinois, Urbana-Champaign.
   * For more information on the Apache Group and the Apache HTTP server
   * project, please see <http://www.apache.org/>.
   *
   */
  
  /*
   * The ap_MD5Encode() routine uses much code obtained from the FreeBSD 3.0
   * MD5 crypt() function, which is licenced as follows:
   * ----------------------------------------------------------------------------
   * "THE BEER-WARE LICENSE" (Revision 42):
   * <ph...@login.dknet.dk> wrote this file.  As long as you retain this notice you
   * can do whatever you want with this stuff. If we meet some day, and you think
   * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
   * ----------------------------------------------------------------------------
   */
  
  #include <string.h>
  
  #include "ap_config.h"
  #include "ap_md5.h"
  #include "ap.h"
  #ifdef CHARSET_EBCDIC
  #include "ebcdic.h"
  #endif /*CHARSET_EBCDIC*/
  #if HAVE_CRYPT_H
  #include <crypt.h>
  #endif
  
  /* Constants for MD5Transform routine.
   */
  
  #define S11 7
  #define S12 12
  #define S13 17
  #define S14 22
  #define S21 5
  #define S22 9
  #define S23 14
  #define S24 20
  #define S31 4
  #define S32 11
  #define S33 16
  #define S34 23
  #define S41 6
  #define S42 10
  #define S43 15
  #define S44 21
  
  static void MD5Transform(UINT4 state[4], const unsigned char block[64]);
  static void Encode(unsigned char *output, const UINT4 *input,
  		   unsigned int len);
  static void Decode(UINT4 *output, const unsigned char *input,
  		   unsigned int len);
  
  static unsigned char PADDING[64] =
  {
      0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  };
  
  /* F, G, H and I are basic MD5 functions.
   */
  #define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
  #define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
  #define H(x, y, z) ((x) ^ (y) ^ (z))
  #define I(x, y, z) ((y) ^ ((x) | (~z)))
  
  /* ROTATE_LEFT rotates x left n bits.
   */
  #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
  
  /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
     Rotation is separate from addition to prevent recomputation.
   */
  #define FF(a, b, c, d, x, s, ac) { \
   (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
   (a) = ROTATE_LEFT ((a), (s)); \
   (a) += (b); \
    }
  #define GG(a, b, c, d, x, s, ac) { \
   (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
   (a) = ROTATE_LEFT ((a), (s)); \
   (a) += (b); \
    }
  #define HH(a, b, c, d, x, s, ac) { \
   (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
   (a) = ROTATE_LEFT ((a), (s)); \
   (a) += (b); \
    }
  #define II(a, b, c, d, x, s, ac) { \
   (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
   (a) = ROTATE_LEFT ((a), (s)); \
   (a) += (b); \
    }
  
  /* MD5 initialization. Begins an MD5 operation, writing a new context.
   */
  API_EXPORT(void) ap_MD5Init(AP_MD5_CTX * context)
  {
      context->count[0] = context->count[1] = 0;
      /* Load magic initialization constants. */
      context->state[0] = 0x67452301;
      context->state[1] = 0xefcdab89;
      context->state[2] = 0x98badcfe;
      context->state[3] = 0x10325476;
  }
  
  /* MD5 block update operation. Continues an MD5 message-digest
     operation, processing another message block, and updating the
     context.
   */
  API_EXPORT(void) ap_MD5Update(AP_MD5_CTX * context, const unsigned char *input,
  			   unsigned int inputLen)
  {
      unsigned int i, idx, partLen;
  
      /* Compute number of bytes mod 64 */
      idx = (unsigned int) ((context->count[0] >> 3) & 0x3F);
  
      /* Update number of bits */
      if ((context->count[0] += ((UINT4) inputLen << 3)) < ((UINT4) inputLen << 3))
  	context->count[1]++;
      context->count[1] += (UINT4) inputLen >> 29;
  
      partLen = 64 - idx;
  
      /* Transform as many times as possible. */
  #ifndef CHARSET_EBCDIC
      if (inputLen >= partLen) {
  	memcpy(&context->buffer[idx], input, partLen);
  	MD5Transform(context->state, context->buffer);
  
  	for (i = partLen; i + 63 < inputLen; i += 64)
  	    MD5Transform(context->state, &input[i]);
  
  	idx = 0;
      }
      else
  	i = 0;
  
      /* Buffer remaining input */
      memcpy(&context->buffer[idx], &input[i], inputLen - i);
  #else /*CHARSET_EBCDIC*/
      if (inputLen >= partLen) {
  	ebcdic2ascii_strictly(&context->buffer[idx], input, partLen);
  	MD5Transform(context->state, context->buffer);
  
  	for (i = partLen; i + 63 < inputLen; i += 64) {
  	    unsigned char inp_tmp[64];
  	    ebcdic2ascii_strictly(inp_tmp, &input[i], 64);
  	    MD5Transform(context->state, inp_tmp);
  	}
  
  	idx = 0;
      }
      else
  	i = 0;
  
      /* Buffer remaining input */
      ebcdic2ascii_strictly(&context->buffer[idx], &input[i], inputLen - i);
  #endif /*CHARSET_EBCDIC*/
  }
  
  /* MD5 finalization. Ends an MD5 message-digest operation, writing the
     the message digest and zeroizing the context.
   */
  API_EXPORT(void) ap_MD5Final(unsigned char digest[16], AP_MD5_CTX * context)
  {
      unsigned char bits[8];
      unsigned int idx, padLen;
  
  
      /* Save number of bits */
      Encode(bits, context->count, 8);
  
  #ifdef CHARSET_EBCDIC
      /* XXX: @@@: In order to make this no more complex than necessary,
       * this kludge converts the bits[] array using the ascii-to-ebcdic
       * table, because the following ap_MD5Update() re-translates
       * its input (ebcdic-to-ascii).
       * Otherwise, we would have to pass a "conversion" flag to ap_MD5Update()
       */
      ascii2ebcdic(bits,bits,8);
  
      /* Since everything is converted to ascii within ap_MD5Update(), 
       * the initial 0x80 (PADDING[0]) must be stored as 0x20 
       */
      PADDING[0] = os_toebcdic[0x80];
  #endif /*CHARSET_EBCDIC*/
  
      /* Pad out to 56 mod 64. */
      idx = (unsigned int) ((context->count[0] >> 3) & 0x3f);
      padLen = (idx < 56) ? (56 - idx) : (120 - idx);
      ap_MD5Update(context, PADDING, padLen);
  
      /* Append length (before padding) */
      ap_MD5Update(context, bits, 8);
  
      /* Store state in digest */
      Encode(digest, context->state, 16);
  
      /* Zeroize sensitive information. */
      memset(context, 0, sizeof(*context));
  }
  
  /* MD5 basic transformation. Transforms state based on block. */
  static void MD5Transform(UINT4 state[4], const unsigned char block[64])
  {
      UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
  
      Decode(x, block, 64);
  
      /* Round 1 */
      FF(a, b, c, d, x[0], S11, 0xd76aa478);	/* 1 */
      FF(d, a, b, c, x[1], S12, 0xe8c7b756);	/* 2 */
      FF(c, d, a, b, x[2], S13, 0x242070db);	/* 3 */
      FF(b, c, d, a, x[3], S14, 0xc1bdceee);	/* 4 */
      FF(a, b, c, d, x[4], S11, 0xf57c0faf);	/* 5 */
      FF(d, a, b, c, x[5], S12, 0x4787c62a);	/* 6 */
      FF(c, d, a, b, x[6], S13, 0xa8304613);	/* 7 */
      FF(b, c, d, a, x[7], S14, 0xfd469501);	/* 8 */
      FF(a, b, c, d, x[8], S11, 0x698098d8);	/* 9 */
      FF(d, a, b, c, x[9], S12, 0x8b44f7af);	/* 10 */
      FF(c, d, a, b, x[10], S13, 0xffff5bb1);	/* 11 */
      FF(b, c, d, a, x[11], S14, 0x895cd7be);	/* 12 */
      FF(a, b, c, d, x[12], S11, 0x6b901122);	/* 13 */
      FF(d, a, b, c, x[13], S12, 0xfd987193);	/* 14 */
      FF(c, d, a, b, x[14], S13, 0xa679438e);	/* 15 */
      FF(b, c, d, a, x[15], S14, 0x49b40821);	/* 16 */
  
      /* Round 2 */
      GG(a, b, c, d, x[1], S21, 0xf61e2562);	/* 17 */
      GG(d, a, b, c, x[6], S22, 0xc040b340);	/* 18 */
      GG(c, d, a, b, x[11], S23, 0x265e5a51);	/* 19 */
      GG(b, c, d, a, x[0], S24, 0xe9b6c7aa);	/* 20 */
      GG(a, b, c, d, x[5], S21, 0xd62f105d);	/* 21 */
      GG(d, a, b, c, x[10], S22, 0x2441453);	/* 22 */
      GG(c, d, a, b, x[15], S23, 0xd8a1e681);	/* 23 */
      GG(b, c, d, a, x[4], S24, 0xe7d3fbc8);	/* 24 */
      GG(a, b, c, d, x[9], S21, 0x21e1cde6);	/* 25 */
      GG(d, a, b, c, x[14], S22, 0xc33707d6);	/* 26 */
      GG(c, d, a, b, x[3], S23, 0xf4d50d87);	/* 27 */
      GG(b, c, d, a, x[8], S24, 0x455a14ed);	/* 28 */
      GG(a, b, c, d, x[13], S21, 0xa9e3e905);	/* 29 */
      GG(d, a, b, c, x[2], S22, 0xfcefa3f8);	/* 30 */
      GG(c, d, a, b, x[7], S23, 0x676f02d9);	/* 31 */
      GG(b, c, d, a, x[12], S24, 0x8d2a4c8a);	/* 32 */
  
      /* Round 3 */
      HH(a, b, c, d, x[5], S31, 0xfffa3942);	/* 33 */
      HH(d, a, b, c, x[8], S32, 0x8771f681);	/* 34 */
      HH(c, d, a, b, x[11], S33, 0x6d9d6122);	/* 35 */
      HH(b, c, d, a, x[14], S34, 0xfde5380c);	/* 36 */
      HH(a, b, c, d, x[1], S31, 0xa4beea44);	/* 37 */
      HH(d, a, b, c, x[4], S32, 0x4bdecfa9);	/* 38 */
      HH(c, d, a, b, x[7], S33, 0xf6bb4b60);	/* 39 */
      HH(b, c, d, a, x[10], S34, 0xbebfbc70);	/* 40 */
      HH(a, b, c, d, x[13], S31, 0x289b7ec6);	/* 41 */
      HH(d, a, b, c, x[0], S32, 0xeaa127fa);	/* 42 */
      HH(c, d, a, b, x[3], S33, 0xd4ef3085);	/* 43 */
      HH(b, c, d, a, x[6], S34, 0x4881d05);	/* 44 */
      HH(a, b, c, d, x[9], S31, 0xd9d4d039);	/* 45 */
      HH(d, a, b, c, x[12], S32, 0xe6db99e5);	/* 46 */
      HH(c, d, a, b, x[15], S33, 0x1fa27cf8);	/* 47 */
      HH(b, c, d, a, x[2], S34, 0xc4ac5665);	/* 48 */
  
      /* Round 4 */
      II(a, b, c, d, x[0], S41, 0xf4292244);	/* 49 */
      II(d, a, b, c, x[7], S42, 0x432aff97);	/* 50 */
      II(c, d, a, b, x[14], S43, 0xab9423a7);	/* 51 */
      II(b, c, d, a, x[5], S44, 0xfc93a039);	/* 52 */
      II(a, b, c, d, x[12], S41, 0x655b59c3);	/* 53 */
      II(d, a, b, c, x[3], S42, 0x8f0ccc92);	/* 54 */
      II(c, d, a, b, x[10], S43, 0xffeff47d);	/* 55 */
      II(b, c, d, a, x[1], S44, 0x85845dd1);	/* 56 */
      II(a, b, c, d, x[8], S41, 0x6fa87e4f);	/* 57 */
      II(d, a, b, c, x[15], S42, 0xfe2ce6e0);	/* 58 */
      II(c, d, a, b, x[6], S43, 0xa3014314);	/* 59 */
      II(b, c, d, a, x[13], S44, 0x4e0811a1);	/* 60 */
      II(a, b, c, d, x[4], S41, 0xf7537e82);	/* 61 */
      II(d, a, b, c, x[11], S42, 0xbd3af235);	/* 62 */
      II(c, d, a, b, x[2], S43, 0x2ad7d2bb);	/* 63 */
      II(b, c, d, a, x[9], S44, 0xeb86d391);	/* 64 */
  
      state[0] += a;
      state[1] += b;
      state[2] += c;
      state[3] += d;
  
      /* Zeroize sensitive information. */
      memset(x, 0, sizeof(x));
  }
  
  /* Encodes input (UINT4) into output (unsigned char). Assumes len is
     a multiple of 4.
   */
  static void Encode(unsigned char *output, const UINT4 *input, unsigned int len)
  {
      unsigned int i, j;
      UINT4 k;
  
      for (i = 0, j = 0; j < len; i++, j += 4) {
  	k = input[i];
  	output[j] = (unsigned char) (k & 0xff);
  	output[j + 1] = (unsigned char) ((k >> 8) & 0xff);
  	output[j + 2] = (unsigned char) ((k >> 16) & 0xff);
  	output[j + 3] = (unsigned char) ((k >> 24) & 0xff);
      }
  }
  
  /* Decodes input (unsigned char) into output (UINT4). Assumes len is
   * a multiple of 4.
   */
  static void Decode(UINT4 *output, const unsigned char *input, unsigned int len)
  {
      unsigned int i, j;
  
      for (i = 0, j = 0; j < len; i++, j += 4)
  	output[i] = ((UINT4) input[j]) | (((UINT4) input[j + 1]) << 8) |
  	    (((UINT4) input[j + 2]) << 16) | (((UINT4) input[j + 3]) << 24);
  }
  
  /*
   * Define the Magic String prefix that identifies a password as being
   * hashed using our algorithm.
   */
  static const char *apr1_id = "$apr1$";
  
  /*
   * The following MD5 password encryption code was largely borrowed from
   * the FreeBSD 3.0 /usr/src/lib/libcrypt/crypt.c file, which is
   * licenced as stated at the top of this file.
   */
  
  static void to64(char *s, unsigned long v, int n)
  {
      static unsigned char itoa64[] =         /* 0 ... 63 => ASCII - 64 */
  	"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  
      while (--n >= 0) {
  	*s++ = itoa64[v&0x3f];
  	v >>= 6;
      }
  }
  
  API_EXPORT(void) ap_MD5Encode(const char *pw, const char *salt,
  			      char *result, size_t nbytes)
  {
      /*
       * Minimum size is 8 bytes for salt, plus 1 for the trailing NUL,
       * plus 4 for the '$' separators, plus the password hash itself.
       * Let's leave a goodly amount of leeway.
       */
  
      char passwd[120], *p;
      const char *sp, *ep;
      unsigned char final[16];
      int sl, pl, i;
      AP_MD5_CTX ctx, ctx1;
      unsigned long l;
  
      /* 
       * Refine the salt first.  It's possible we were given an already-hashed
       * string as the salt argument, so extract the actual salt value from it
       * if so.  Otherwise just use the string up to the first '$' as the salt.
       */
      sp = salt;
  
      /*
       * If it starts with the magic string, then skip that.
       */
      if (!strncmp(sp, apr1_id, strlen(apr1_id))) {
  	sp += strlen(apr1_id);
      }
  
      /*
       * It stops at the first '$' or 8 chars, whichever comes first
       */
      for (ep = sp; (*ep != '\0') && (*ep != '$') && (ep < (sp + 8)); ep++) {
  	continue;
      }
  
      /*
       * Get the length of the true salt
       */
      sl = ep - sp;
  
      /*
       * 'Time to make the doughnuts..'
       */
      ap_MD5Init(&ctx);
  
      /*
       * The password first, since that is what is most unknown
       */
      ap_MD5Update(&ctx, pw, strlen(pw));
  
      /*
       * Then our magic string
       */
      ap_MD5Update(&ctx, apr1_id, strlen(apr1_id));
  
      /*
       * Then the raw salt
       */
      ap_MD5Update(&ctx, sp, sl);
  
      /*
       * Then just as many characters of the MD5(pw, salt, pw)
       */
      ap_MD5Init(&ctx1);
      ap_MD5Update(&ctx1, pw, strlen(pw));
      ap_MD5Update(&ctx1, sp, sl);
      ap_MD5Update(&ctx1, pw, strlen(pw));
      ap_MD5Final(final, &ctx1);
      for(pl = strlen(pw); pl > 0; pl -= 16) {
  	ap_MD5Update(&ctx, final, (pl > 16) ? 16 : pl);
      }
  
      /*
       * Don't leave anything around in vm they could use.
       */
      memset(final, 0, sizeof(final));
  
      /*
       * Then something really weird...
       */
      for (i = strlen(pw); i != 0; i >>= 1) {
  	if (i & 1) {
  	    ap_MD5Update(&ctx, final, 1);
  	}
  	else {
  	    ap_MD5Update(&ctx, pw, 1);
  	}
      }
  
      /*
       * Now make the output string.  We know our limitations, so we
       * can use the string routines without bounds checking.
       */
      strcpy(passwd, apr1_id);
      strncat(passwd, sp, sl);
      strcat(passwd, "$");
  
      ap_MD5Final(final, &ctx);
  
      /*
       * And now, just to make sure things don't run too fast..
       * On a 60 Mhz Pentium this takes 34 msec, so you would
       * need 30 seconds to build a 1000 entry dictionary...
       */
      for (i = 0; i < 1000; i++) {
  	ap_MD5Init(&ctx1);
  	if (i & 1) {
  	    ap_MD5Update(&ctx1, pw, strlen(pw));
  	}
  	else {
  	    ap_MD5Update(&ctx1, final, 16);
  	}
  	if (i % 3) {
  	    ap_MD5Update(&ctx1, sp, sl);
  	}
  
  	if (i % 7) {
  	    ap_MD5Update(&ctx1, pw, strlen(pw));
  	}
  
  	if (i & 1) {
  	    ap_MD5Update(&ctx1, final, 16);
  	}
  	else {
  	    ap_MD5Update(&ctx1, pw, strlen(pw));
  	}
  	ap_MD5Final(final,&ctx1);
      }
  
      p = passwd + strlen(passwd);
  
      l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p, l, 4); p += 4;
      l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p, l, 4); p += 4;
      l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p, l, 4); p += 4;
      l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p, l, 4); p += 4;
      l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p, l, 4); p += 4;
      l =                    final[11]                ; to64(p, l, 2); p += 2;
      *p = '\0';
  
      /*
       * Don't leave anything around in vm they could use.
       */
      memset(final, 0, sizeof(final));
  
      ap_cpystrn(result, passwd, nbytes - 1);
  }
  
  /*
   * Validate a plaintext password against a smashed one.  Use either
   * crypt() (if available) or ap_MD5Encode(), depending upon the format
   * of the smashed input password.  Return NULL if they match, or
   * an explanatory text string if they don't.
   */
  
  API_EXPORT(char *) ap_validate_password(const char *passwd, const char *hash)
  {
      char sample[120];
      char *crypt_pw;
  
      if (!strncmp(hash, apr1_id, strlen(apr1_id))) {
  	/*
  	 * The hash was created using our custom algorithm.
  	 */
  	ap_MD5Encode(passwd, hash, sample, sizeof(sample));
      }
      else {
  	/*
  	 * It's not our algorithm, so feed it to crypt() if possible.
  	 */
  #ifdef WIN32
  	return "crypt() unavailable on Win32, cannot validate password";
      }
  #else
  	crypt_pw = crypt(passwd, hash);
  	ap_cpystrn(sample, crypt_pw, sizeof(sample) - 1);
      }
      return (strcmp(sample, hash) == 0) ? NULL : "password mismatch";
  #endif
  }
  
  
  
  1.2       +3 -6      apache-apr/pthreads/src/helpers/GuessOS
  
  Index: GuessOS
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/GuessOS,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- GuessOS	1999/01/21 23:08:31	1.1
  +++ GuessOS	1999/02/07 06:29:16	1.2
  @@ -5,11 +5,8 @@
   # Apache, it follows under Apache's regular licensing
   # (see http://www.apache.org/docs/LICENSE)  with one specific
   # addition: Any changes or additions to this script should be
  -# Emailed to the Apache group (apache@apache.org) in general
  -# and to Jim Jagielski (jim@apache.org) in specific.
  +# Emailed to the Apache group (apache@apache.org).
   #
  -# Blame Jim; he wrote it (plus a cast of dozens)
  -#
   # Be as similar to the output of config.guess/config.sub
   # as possible.
   
  @@ -204,11 +201,11 @@
   	;;
   
       SINIX-?:* | ReliantUNIX-?:*)
  -	echo "${MACHINE}-sni-sysv4"; exit 0
  +	echo "${MACHINE}-siemens-sysv4"; exit 0
   	;;
   
       POSIX*BS2000)
  -	echo "${MACHINE}-sni-sysv4"; exit 0
  +	echo "${MACHINE}-siemens-sysv4"; exit 0
   	;;
   
       machten:*)
  
  
  
  1.2       +0 -2      apache-apr/pthreads/src/helpers/PrintPath
  
  Index: PrintPath
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/PrintPath,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- PrintPath	1999/01/21 23:08:31	1.1
  +++ PrintPath	1999/02/07 06:29:16	1.2
  @@ -10,8 +10,6 @@
   # Usage:
   #  PrintPath [-s] [-pPATHNAME] program [program ...]
   #
  -# Blame Jim; he wrote it.
  -#
   # This script falls under the Apache License.
   # See http://www.apache.org/docs/LICENSE
   
  
  
  
  1.2       +1 -3      apache-apr/pthreads/src/helpers/TestCompile
  
  Index: TestCompile
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/TestCompile,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- TestCompile	1999/01/21 23:08:31	1.1
  +++ TestCompile	1999/02/07 06:29:16	1.2
  @@ -32,8 +32,6 @@
   # located) if you want to test it out. Configure must
   # also call it as './helpers/TestCompile'
   #
  -# Blame Jim; he wrote it (along with a cast of dozens).
  -#
   # This script falls under the Apache License.
   # See http://www.apache.org/docs/LICENSE
   
  @@ -145,7 +143,7 @@
   EOF
   
   # Now run that Makefile
  -eval "make $TARGET >/dev/null $ERRDIR"
  +eval "${MAKE} ${TARGET} >/dev/null $ERRDIR"
   
   # And see if dummy exists and is executable, if so, then we
   # assume the condition we are testing for is good
  
  
  
  1.2       +12 -12    apache-apr/pthreads/src/helpers/buildinfo.sh
  
  Index: buildinfo.sh
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/buildinfo.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- buildinfo.sh	1999/01/21 23:08:32	1.1
  +++ buildinfo.sh	1999/02/07 06:29:16	1.2
  @@ -16,10 +16,10 @@
   if [ $# -ne 1 -a $# -ne 2 ]; then
       error=yes
   fi
  -if [ $# -eq 2 -a ".$1" != ".-n" ]; then
  +if [ $# -eq 2 -a "x$1" != "x-n" ]; then
       error=yes
   fi
  -if [ $error = yes ]; then
  +if [ "$error" = "yes" ]; then
       echo "$0:Error: invalid argument line"
       echo "$0:Usage: $0 [-n] <format-string>"
       echo "Where <format-string> can contain:"
  @@ -55,15 +55,15 @@
   #   determine username
   #
   username="$LOGNAME"
  -if [ ".$username" = . ]; then
  +if [ "x$username" = "x" ]; then
       username="$USER"
  -    if [ ".$username" = . ]; then
  +    if [ "x$username" = "x" ]; then
           username="`whoami 2>/dev/null |\
                      awk '{ printf("%s", $1); }'`"
  -        if [ ".$username" = . ]; then
  +        if [ "x$username" = "x" ]; then
               username="`who am i 2>/dev/null |\
                          awk '{ printf("%s", $1); }'`"
  -            if [ ".$username" = . ]; then
  +            if [ "x$username" = "x" ]; then
                   username='unknown'
               fi
           fi
  @@ -75,10 +75,10 @@
   #
   hostname="`uname -n 2>/dev/null |\
              awk '{ printf("%s", $1); }'`"
  -if [ ".$hostname" = . ]; then
  +if [ "x$hostname" = "x" ]; then
       hostname="`hostname 2>/dev/null |\
                  awk '{ printf("%s", $1); }'`"
  -    if [ ".$hostname" = . ]; then
  +    if [ "x$hostname" = "x" ]; then
           hostname='unknown'
       fi
   fi
  @@ -88,14 +88,14 @@
           hostname="`echo $hostname | cut -d. -f1`"
           ;;
   esac
  -if [ ".$domainname" = . ]; then
  +if [ "x$domainname" = "x" ]; then
       if [ -f /etc/resolv.conf ]; then
           domainname="`egrep '^[ 	]*domain' /etc/resolv.conf | head -1 |\
                        sed -e 's/.*domain//' \
                            -e 's/^[ 	]*//' -e 's/^ *//' -e 's/^	*//' \
                            -e 's/^\.//' -e 's/^/./' |\
                        awk '{ printf("%s", $1); }'`"
  -        if [ ".$domainname" = . ]; then
  +        if [ "x$domainname" = "x" ]; then
               domainname="`egrep '^[ 	]*search' /etc/resolv.conf | head -1 |\
                            sed -e 's/.*search//' \
                                -e 's/^[ 	]*//' -e 's/^ *//' -e 's/^	*//' \
  @@ -112,7 +112,7 @@
   time_day="`date '+%d' | awk '{ printf("%s", $1); }'`"
   time_month="`date '+%m' | awk '{ printf("%s", $1); }'`"
   time_year="`date '+%Y' 2>/dev/null | awk '{ printf("%s", $1); }'`"
  -if test ".$time_year" = .; then
  +if [ "x$time_year" = "x" ]; then
       time_year="`date '+%y' | awk '{ printf("%s", $1); }'`"
       case $time_year in
           9[0-9]*) time_year="19$time_year" ;;
  @@ -137,7 +137,7 @@
   #
   #   create result string
   #
  -if [ ".$newline" = .yes ]; then
  +if [ "x$newline" = "xyes" ]; then
       echo $format_string |\
       sed -e "s;%u;$username;g" \
           -e "s;%h;$hostname;g" \
  
  
  
  1.2       +3 -3      apache-apr/pthreads/src/helpers/checkheader.sh
  
  Index: checkheader.sh
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/checkheader.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- checkheader.sh	1999/01/21 23:08:32	1.1
  +++ checkheader.sh	1999/02/07 06:29:16	1.2
  @@ -10,10 +10,10 @@
   
   header=$1
   rc=1
  -if [ ".$CPP" = . ]; then
  +if [ "x$CPP" = "x" ]; then
       CPP='NOT-AVAILABLE'
   fi
  -if [ ".$CPP" != ".NOT-AVAILABLE" ]; then
  +if [ "x$CPP" != "xNOT-AVAILABLE" ]; then
       #   create a test C source
       cat >conftest.c <<EOF
   #include <$header>
  @@ -21,7 +21,7 @@
   EOF
       (eval "$CPP conftest.c >/dev/null") 2>conftest.out
       my_error=`grep -v '^ *+' conftest.out`
  -    if [ ".$my_error" = . ]; then
  +    if [ "x$my_error" = "x" ]; then
           rc=0
       fi
   else
  
  
  
  1.2       +9 -9      apache-apr/pthreads/src/helpers/findcpp.sh
  
  Index: findcpp.sh
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/findcpp.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- findcpp.sh	1999/01/21 23:08:31	1.1
  +++ findcpp.sh	1999/02/07 06:29:17	1.2
  @@ -19,16 +19,16 @@
   EOF
   
   #   some braindead systems have a CPP define for a directory :-(
  -if [ ".$CPP" != . ]; then
  +if [ "x$CPP" != "x" ]; then
       if [ -d "$CPP" ]; then
           CPP=''
       fi
   fi
  -if [ ".$CPP" != . ]; then
  +if [ "x$CPP" != "x" ]; then
       #   case 1: user provided a default CPP variable (we only check)
       (eval "$CPP conftest.c >/dev/null") 2>conftest.out
       my_error=`grep -v '^ *+' conftest.out`
  -    if [ ".$my_error" != . ]; then
  +    if [ "x$my_error" != "x" ]; then
           CPP=''
       fi
   else
  @@ -37,21 +37,21 @@
       CPP="${CC-cc} -E"
       (eval "$CPP conftest.c >/dev/null") 2>conftest.out
       my_error=`grep -v '^ *+' conftest.out`
  -    if [ ".$my_error" != . ]; then
  +    if [ "x$my_error" != "x" ]; then
           #   2. try the -E option and GCC's -traditional-ccp option
           CPP="${CC-cc} -E -traditional-cpp"
           (eval "$CPP conftest.c >/dev/null") 2>conftest.out
           my_error=`grep -v '^ *+' conftest.out`
  -        if [ ".$my_error" != . ]; then
  +        if [ "x$my_error" != "x" ]; then
               #   3. try a standalone cpp command in $PATH and lib dirs
               CPP="`./helpers/PrintPath cpp`"
  -            if [ ".$CPP" = . ]; then
  +            if [ "x$CPP" = "x" ]; then
                   CPP="`./helpers/PrintPath -p/lib:/usr/lib:/usr/local/lib cpp`"
               fi
  -            if [ ".$CPP" != . ]; then
  +            if [ "x$CPP" != "x" ]; then
                   (eval "$CPP conftest.c >/dev/null") 2>conftest.out
                   my_error=`grep -v '^ *+' conftest.out`
  -                if [ ".$my_error" != . ]; then
  +                if [ "x$my_error" != "x" ]; then
                       #   ok, we gave up...
                       CPP=''
                   fi
  @@ -64,7 +64,7 @@
   rm -f conftest.*
   
   #   Ok, empty CPP variable now means it's not available
  -if [ ".$CPP" = . ]; then
  +if [ "x$CPP" = "x" ]; then
       CPP='NOT-AVAILABLE'
   fi
   
  
  
  
  1.2       +3 -3      apache-apr/pthreads/src/helpers/fmn.sh
  
  Index: fmn.sh
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/fmn.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- fmn.sh	1999/01/21 23:08:32	1.1
  +++ fmn.sh	1999/02/07 06:29:17	1.2
  @@ -20,9 +20,9 @@
   modname=''
   ext=`echo $modfile | sed 's/^.*\.//'`
   modbase=`echo $modfile | sed 's/\.[^.]*$//'`
  -if [ x$ext = x$modfile ]; then ext=o; modbase=$modfile; modfile=$modbase.o; fi
  -if [ x$ext = x ] ; then ext=o; modbase=$modfile; fi
  -if [ x$ext = xc ] ; then ext=o; fi
  +if [ "x$ext" = "x$modfile" ]; then ext=o; modbase=$modfile; modfile=$modbase.o; fi
  +if [ "x$ext" = "x" ] ; then ext=o; modbase=$modfile; fi
  +if [ "x$ext" = "xc" ] ; then ext=o; fi
   if [ -r $modbase.module ] ; then
       cat $modbase.module >$tmpfile
   else
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/helpers/fp2rp
  
  Index: fp2rp
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/fp2rp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- fp2rp	1999/01/21 23:08:32	1.1
  +++ fp2rp	1999/02/07 06:29:17	1.2
  @@ -2,7 +2,7 @@
   ##
   ## fp2rp -- convert a standard forward path to a reverse dotted path
   ##
  -if [ "x$1" = x. ]; then
  +if [ "x$1" = "x." ]; then
       rp="."
   else
       rp=""
  
  
  
  1.2       +8 -8      apache-apr/pthreads/src/helpers/install.sh
  
  Index: install.sh
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/install.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- install.sh	1999/01/21 23:08:32	1.1
  +++ install.sh	1999/02/07 06:29:17	1.2
  @@ -36,7 +36,7 @@
   mvcmd="$mvprog"
   src=""
   dst=""
  -while [ ".$1" != . ]; do
  +while [ "x$1" != "x" ]; do
       case $1 in
           -c) instcmd="$cpprog"
               shift; continue
  @@ -52,7 +52,7 @@
               ;;
           -s) stripcmd="$stripprog"
               shift; continue;;
  -        *)  if [ ".$src" = . ]; then
  +        *)  if [ "x$src" = "x" ]; then
                   src=$1
               else
                   dst=$1
  @@ -61,11 +61,11 @@
               ;;
       esac
   done
  -if [ ".$src" = . ]; then
  +if [ "x$src" = "x" ]; then
        echo "install.sh: no input file specified"
        exit 1
   fi
  -if [ ".$dst" = . ]; then
  +if [ "x$dst" = "x" ]; then
        echo "install.sh: no destination specified"
        exit 1
   fi
  @@ -87,10 +87,10 @@
   $instcmd $src $dsttmp
   
   #  And set any options; do chmod last to preserve setuid bits
  -if [ ".$chowncmd" != . ]; then $chowncmd $dsttmp; fi
  -if [ ".$chgrpcmd" != . ]; then $chgrpcmd $dsttmp; fi
  -if [ ".$stripcmd" != . ]; then $stripcmd $dsttmp; fi
  -if [ ".$chmodcmd" != . ]; then $chmodcmd $dsttmp; fi
  +if [ "x$chowncmd" != "x" ]; then $chowncmd $dsttmp; fi
  +if [ "x$chgrpcmd" != "x" ]; then $chgrpcmd $dsttmp; fi
  +if [ "x$stripcmd" != "x" ]; then $stripcmd $dsttmp; fi
  +if [ "x$chmodcmd" != "x" ]; then $chmodcmd $dsttmp; fi
   
   #  Now rename the file to the real destination.
   $rmcmd $dst
  
  
  
  1.2       +43 -20    apache-apr/pthreads/src/helpers/mkshadow.sh
  
  Index: mkshadow.sh
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/mkshadow.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mkshadow.sh	1999/01/21 23:08:32	1.1
  +++ mkshadow.sh	1999/02/07 06:29:17	1.2
  @@ -19,18 +19,35 @@
   src=`echo $1 | sed -e 's:/$::'`
   dst=`echo $2 | sed -e 's:/$::'`
   
  -#   determine if source is an absolute path
  +#   check whether source exists
  +if [ ! -d $src ]; then
  +    echo "mkshadow.sh:Error: source directory not found" 1>&2
  +    exit 1
  +fi
  +
  +#   determine if one of the paths is an absolute path,
  +#   because then we have to use an absolute symlink
  +oneisabs=0
   case $src in
  -    /* ) srcisabs=1 ;;
  -     * ) srcisabs=0 ;;
  +    /* ) oneisabs=1 ;;
   esac
  -
  -#   determine reverse directory to directory
   case $dst in
  -    /* ) dstrevdir='' ;;
  -     * ) dstrevdir="`$src/helpers/fp2rp $dst`/" ;;
  +    /* ) oneisabs=1 ;;
   esac
   
  +#   determine reverse directory for destination directory
  +dstrevdir=''
  +if [ "x$oneisabs" = "x0" ]; then
  +    #   (inlined fp2rp)
  +    OIFS2="$IFS"; IFS='/'
  +    for pe in $dst; do
  +        dstrevdir="../$dstrevdir"
  +    done
  +    IFS="$OIFS2"
  +else
  +    src="`cd $src; pwd`";
  +fi
  +
   #   create directory tree at destination
   if [ ! -d $dst ]; then
       mkdir $dst
  @@ -48,7 +65,7 @@
   
   #   fill directory tree with symlinks to files
   FILES="`cd $src
  -        find . -type f -depth -print |\
  +        find . -depth -print |\
           sed -e '/\.o$/d' \
               -e '/\.a$/d' \
               -e '/\.so$/d' \
  @@ -63,23 +80,29 @@
               -e 's/^\.\///'`"
   OIFS="$IFS" IFS="$DIFS"
   for file in $FILES; do
  +     #  don't use `-type f' above for find because of symlinks
  +     if [ -d $file ]; then
  +         continue
  +     fi
        basename=`echo $file | sed -e 's:^.*/::'`
        dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'`
        from="$src/$file"
        to="$dst/$dir$basename"
  -     if [ $srcisabs = 0 -a ".$dir" != . ]; then
  -         subdir=`echo $dir | sed -e 's:/$::'`
  -         #   (inlined fp2rp)
  -         revdir=''
  -         OIFS2="$IFS"; IFS='/'
  -         for pe in $subdir; do
  -             revdir="../$revdir"
  -         done
  -         IFS="$OIFS2"
  -         #   finalize from
  -         from="$revdir$from"
  +     if [ "x$oneisabs" = "x0" ]; then
  +         if [ "x$dir" != "x" ]; then
  +             subdir=`echo $dir | sed -e 's:/$::'`
  +             #   (inlined fp2rp)
  +             revdir=''
  +             OIFS2="$IFS"; IFS='/'
  +             for pe in $subdir; do
  +                 revdir="../$revdir"
  +             done
  +             IFS="$OIFS2"
  +             #   finalize from
  +             from="$revdir$from"
  +         fi
  +         from="$dstrevdir$from"
        fi
  -     from="$dstrevdir$from"
        echo "    $to"
        ln -s $from $to
   done
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/helpers/ppl.sh
  
  Index: ppl.sh
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/ppl.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ppl.sh	1999/01/21 23:08:32	1.1
  +++ ppl.sh	1999/02/07 06:29:17	1.2
  @@ -16,7 +16,7 @@
   list=`
   IFS=:
   for entry in $*; do
  -    if [ ".$entry" != . ]; then
  +    if [ "x$entry" != "x" ]; then
           echo $entry
       fi
   done |\
  
  
  
  1.2       +13 -13    apache-apr/pthreads/src/helpers/slo.sh
  
  Index: slo.sh
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/helpers/slo.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- slo.sh	1999/01/21 23:08:32	1.1
  +++ slo.sh	1999/02/07 06:29:17	1.2
  @@ -22,12 +22,12 @@
   for opt
   do
       #   concatenate with previous option if exists
  -    if [ ".$optprev" != . ]; then
  +    if [ "$optprev" != "" ]; then
           opt="${optprev}${opt}";
           optprev=''
       fi
       #   remember options for arg when used stand-alone
  -    if [ ".$opt" = ".-L" -o ".$opt" = ".-l" ]; then
  +    if [ "x$opt" = "x-L" -o "x$opt" = "x-l" ]; then
           optprev="$opt"
           continue;
       fi
  @@ -47,7 +47,7 @@
   #   set linker default directories
   #
   DIRS_DEFAULT='/lib:/usr/lib'
  -if [ ".$LD_LIBRARY_PATH" != . ]; then
  +if [ "x$LD_LIBRARY_PATH" != "x" ]; then
       DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH"
   fi
   
  @@ -64,7 +64,7 @@
   #    for each library...
   OIFS="$IFS" IFS=':'
   for lib in $LIBS; do
  -    [ ".$lib" = . ] && continue
  +    [ "x$lib" = "x" ] && continue
   
       found='no'
       found_indefdir='no'
  @@ -74,14 +74,14 @@
       #    for each directory...
       OIFS2="$IFS" IFS=":$DIFS"
       for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do
  -        [ ".$dir" = . ] && continue
  -        [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes
  +        [ "x$dir" = "x" ] && continue
  +        [ "x$dir" = "xswitch-to-defdirs" ] && found_indefdir=yes
           [ ! -d $dir ] && continue
   
           #    search the file
           OIFS3="$IFS" IFS="$DIFS"
           for file in '' `cd $dir && ls lib${lib}.* 2>/dev/null`; do
  -             [ ".$file" = . ] && continue
  +             [ "x$file" = "x" ] && continue
                case $file in
                    *.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* )
                         found=yes;
  @@ -93,7 +93,7 @@
                         found_type=PIC 
                         ;;
                    *.a )
  -                      if [ ".$found_type" = . ]; then
  +                      if [ "x$found_type" = "x" ]; then
                             found=yes
                             found_type=OBJ 
                         fi
  @@ -101,15 +101,15 @@
                esac
           done
           IFS="$OIFS3"
  -        if [ ".$found" = .yes ]; then
  +        if [ "x$found" = "xyes" ]; then
               found_dir="$dir"
               break
           fi
       done
       IFS="$OIFS2"
   
  -    if [ ".$found" = .yes ]; then
  -        if [ ".$found_indefdir" != .yes ]; then
  +    if [ "x$found" = "xyes" ]; then
  +        if [ "x$found_indefdir" != "xyes" ]; then
               eval "dirlist=\"\${DIRS_${found_type}}:\""
               if [ ".`echo \"$dirlist\" | fgrep :$found_dir:`" = . ]; then
                   eval "DIRS_${found_type}=\"\$DIRS_${found_type}:${found_dir}\""
  @@ -148,7 +148,7 @@
       eval "libs=\"\$LIBS_${type}\""
       opts=''
       for lib in $libs; do
  -        [ ".$lib" = . ] && continue
  +        [ "x$lib" = "x" ] && continue
           opts="$opts -l$lib"
       done
       eval "LIBS_${type}=\"$opts\""
  @@ -156,7 +156,7 @@
       eval "dirs=\"\$DIRS_${type}\""
       opts=''
       for dir in $dirs; do
  -        [ ".$dir" = . ] && continue
  +        [ "x$dir" = "x" ] && continue
           opts="$opts -L$dir"
       done
       eval "DIRS_${type}=\"$opts\""
  
  
  
  1.1                  apache-apr/pthreads/src/helpers/binbuild.sh
  
  Index: binbuild.sh
  ===================================================================
  #!/bin/sh
  #
  # binbuild.sh - Builds an Apache binary distribution.
  # Initially written by Lars Eilebrecht <la...@apache.org>.
  #
  # This script falls under the Apache License.
  # See http://www.apache.org/docs/LICENSE
  
  
  APDIR=`pwd`
  APDIR=`basename $APDIR`
  VER=`echo $APDIR |sed s/apache-//`
  OS=`src/helpers/GuessOS`
  USER="`src/helpers/buildinfo.sh -n %u@%h%d`"
  TAR="`src/helpers/PrintPath tar`"
  GTAR="`src/helpers/PrintPath gtar`"
  GZIP="`src/helpers/PrintPath gzip`"
  CONFIGPARAM="--with-layout=BinaryDistribution --enable-module=most --enable-shared=max"
  
  if [ ! -f ./ABOUT_APACHE ]
  then
    echo "ERROR: The current directory contains no valid Apache distribution."
    echo "Please change the directory to the top level directory of a freshly"
    echo "unpacked Apache 1.3 source distribution and re-execute the script"
    echo "'./src/helpers/bindbuild.sh'." 
    exit 1;
  fi
  
  if [ -d ./CVS ]
  then
    echo "ERROR: The current directory is a CVS checkout of Apache."
    echo "Only a standard Apache 1.3 source distribution should be used to"
    echo "create a binary distribution."
    exit 1;
  fi
  
  echo "Building Apache $VER binary distribution..."
  echo "Platform is \"$OS\"..."
  
  ( echo "Build log for Apache binary distribution" && \
    echo "----------------------------------------------------------------------" && \
    ./configure $CONFIGPARAM && \
    echo "----------------------------------------------------------------------" && \
    make clean && \
    rm -rf bindist install-bindist.sh *.bindist
    echo "----------------------------------------------------------------------" && \
    make && \
    echo "----------------------------------------------------------------------" && \
    make install-quiet root="bindist/" && \
    echo "----------------------------------------------------------------------" && \
    make clean && \
    echo "----------------------------------------------------------------------" && \
    echo "[EOF]" \
  ) > build.log 2>&1
  
  if [ ! -f ./bindist/bin/httpd ]
  then
    echo "ERROR: Failed to build Apache. See \"build.log\" for details."
    exit 1;
  fi
  
  echo "Binary images successfully created..."
  echo "Creating supplementary files..."
  
  ( echo " " && \
    echo "Apache $VER binary distribution" && \
    echo "================================" && \
    echo " " && \
    echo "This binary distribution is usable on a \"$OS\"" && \
    echo "system and was built by \"$USER\"." && \
    echo "" && \
    echo "The distribution contains all standard Apache modules as shared" && \
    echo "objects. This allows you to enable or disable particular modules" && \
    echo "with the LoadModule/AddModule directives in the configuration file" && \
    echo "without the need to re-compile Apache." && \
    echo "" && \
    echo "See \"INSTALL.bindist\" on how to install the distribution." && \
    echo " " && \
    echo "NOTE: Please do not send support-related mails to the address mentioned" && \
    echo "      above or to any member of the Apache Group! Support questions" && \
    echo "      should be directed to the \"comp.infosystems.www.servers.unix\"" && \
    echo "      or \"comp.infosystems.www.servers.ms-windows\" newsgroup" && \
    echo "      (as appropriate for the platform you use), where some of the" && \
    echo "      Apache team lurk, in the company of many other Apache gurus" && \
    echo "      who should be able to help." && \
    echo "      If you think you found a bug in Apache or have a suggestion please" && \
    echo "      visit the bug report page at http://www.apache.org/bug_report.html" && \
    echo " " && \
    echo "----------------------------------------------------------------------" && \
    ./bindist/bin/httpd -V && \
    echo "----------------------------------------------------------------------" \
  ) > README.bindist
  cp README.bindist ../apache-$VER-$OS.README
  
  ( echo " " && \
    echo "Apache $VER binary installation" && \
    echo "================================" && \
    echo " " && \
    echo "To install this binary distribution you have to execute the installation" && \
    echo "script \"install-bindist.sh\" in the top-level directory of the distribution." && \
    echo " " && \
    echo "The script takes the ServerRoot directory into which you want to install" && \
    echo "Apache as an option. If you ommit the option the default path" && \
    echo "\"/usr/local/apache\" is used." && \
    echo "Make sure you have write permissions in the target directory, e.g. switch" && \
    echo "to user \"root\" before you execute the script." && \
    echo " " && \
    echo "See \"README.bindist\" for further details about this distribution." && \
    echo " " && \
    echo "Please note that this distribution includes the complete Apache source code." && \
    echo "Therefore you may compile Apache yourself at any time if you have a compiler" && \
    echo "installation on your system." && \
    echo "See \"INSTALL\" for details on how to accomplish this." && \
    echo " " \
  ) > INSTALL.bindist
  
  ( echo "#!/bin/sh" && \
    echo "#" && \
    echo "# Usage: install-bindist.sh [ServerRoot]" && \
    echo "# This script installs the Apache binary distribution and" && \
    echo "# was automatically created by binbuild.sh." && \
    echo " " && \
    echo "if [ .\$1 = . ]" && \
    echo "then" && \
    echo "  SR=/usr/local/apache" && \
    echo "else" && \
    echo "  SR=\$1" && \
    echo "fi" && \
    echo "echo \"Installing binary distribution for platform $OS\"" && \
    echo "echo \"into directory \$SR ...\"" && \
    echo "./src/helpers/mkdir.sh \$SR" && \
    echo "cp -r bindist/proxy \$SR/proxy" && \
    echo "cp -r bindist/man \$SR/man" && \
    echo "cp -r bindist/logs \$SR/logs" && \
    echo "cp -r bindist/libexec \$SR/libexec" && \
    echo "cp -r bindist/include \$SR/include" && \
    echo "cp -r bindist/icons \$SR/icons" && \
    echo "cp -r bindist/cgi-bin \$SR/cgi-bin" && \
    echo "cp -r bindist/bin \$SR/bin" && \
    echo "if [ -d \$SR/conf ]" && \
    echo "then" && \
    echo "  echo \"[Preserving existing configuration files.]\"" && \
    echo "  cp -r bindist/conf/*.default \$SR/conf/" && \
    echo "else" && \
    echo "  cp -r bindist/conf \$SR/conf" && \
    echo "fi" && \
    echo "if [ -d \$SR/htdocs ]" && \
    echo "then" && \
    echo "  echo \"[Preserving existing htdocs directory.]\"" && \
    echo "else" && \
    echo "  cp -r bindist/htdocs \$SR/htdocs" && \
    echo "fi" && \
    echo "sed -e s%/usr/local/apache%\$SR/% \$SR/conf/httpd.conf.default > \$SR/conf/httpd.conf" && \
    echo "sed -e s%PIDFILE=%PIDFILE=\$SR/% -e s%HTTPD=%HTTPD=\\\"\$SR/% -e \"s%/httpd$%/httpd -d \$SR\\\"%\" bindist/bin/apachectl > \$SR/bin/apachectl" && \
    echo " " && \
    echo "echo \"Ready.\"" && \
    echo "echo \" +--------------------------------------------------------+\"" && \
    echo "echo \" | You now have successfully installed the Apache $VER   |\"" && \
    echo "echo \" | HTTP server. To verify that Apache actually works      |\"" && \
    echo "echo \" | correctly you now should first check the (initially    |\"" && \
    echo "echo \" | created or preserved) configuration files              |\"" && \
    echo "echo \" |                                                        |\"" && \
    echo "echo \" |   \$SR/conf/httpd.conf\"" && \
    echo "echo \" |                                                        |\"" && \
    echo "echo \" | and then you should be able to immediately fire up     |\"" && \
    echo "echo \" | Apache the first time by running:                      |\"" && \
    echo "echo \" |                                                        |\"" && \
    echo "echo \" |   \$SR/bin/apachectl start \"" &&\
    echo "echo \" |                                                        |\"" && \
    echo "echo \" | Thanks for using Apache.       The Apache Group        |\"" && \
    echo "echo \" |                                http://www.apache.org/  |\"" && \
    echo "echo \" +--------------------------------------------------------+\"" && \
    echo "echo \" \"" \
  ) > install-bindist.sh
  chmod 755 install-bindist.sh
  
  sed -e "s%\"/htdocs%\"/usr/local/apache/htdocs%" \
      -e "s%\"/icons%\"/usr/local/apache/icons%" \
      -e "s%\"/cgi-bin%\"/usr/local/apache/cgi-bin%" \
      -e "s%^ServerAdmin.*%ServerAdmin you@your.address%" \
      -e "s%#ServerName.*%#ServerName localhost%" \
      -e "s%Port 8080%Port 80%" \
      bindist/conf/httpd.conf.default > bindist/conf/httpd.conf
  cp bindist/conf/httpd.conf bindist/conf/httpd.conf.default
  
  echo "Creating distribution archive and readme file..."
   
  if [ ".`grep -i error build.log > /dev/null`" != . ]
  then
    echo "ERROR: Failed to build Apache. See \"build.log\" for details."
    exit 1;
  else
    if [ "x$GTAR" != "x" ]
    then
      $GTAR -zcf ../apache-$VER-$OS.tar.gz -C .. --owner=root --group=root apache-$VER
    else
      if [ "x$TAR" != "x" ]
      then
        $TAR -cf ../apache-$VER-$OS.tar -C .. apache-$VER
        if [ "x$GZIP" != "x" ]
        then
          $GZIP ../apache-$VER-$OS.tar
        fi
      else
        echo "ERROR: Could not find a 'tar' program!"
        echo "       Please execute the following commands manually:"
        echo "         tar -cf ../apache-$VER-$OS.tar ."
        echo "         gzip ../apache-$VER-$OS.tar"
      fi
    fi
  
    if [ -f ../apache-$VER-$OS.tar.gz ] && [ -f ../apache-$VER-$OS.README ]
    then
      echo "Ready."
      echo "You can find the binary archive (apache-$VER-$OS.tar.gz)"
      echo "and the readme file (apache-$VER-$OS.README) in the"
      echo "parent directory."
      exit 0;
    else
      exit 1;
    fi
  fi
  
  
  
  1.2       +10 -1     apache-apr/pthreads/src/include/alloc.h
  
  Index: alloc.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/alloc.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- alloc.h	1999/01/21 23:08:32	1.1
  +++ alloc.h	1999/02/07 06:29:20	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -148,6 +148,15 @@
   API_EXPORT(void) ap_array_cat(array_header *dst, const array_header *src);
   API_EXPORT(array_header *) ap_append_arrays(pool *, const array_header *,
   					 const array_header *);
  +
  +/* ap_array_pstrcat generates a new string from the pool containing
  + * the concatenated sequence of substrings referenced as elements within
  + * the array.  The string will be empty if all substrings are empty or null,
  + * or if there are no elements in the array.
  + * If sep is non-NUL, it will be inserted between elements as a separator.
  + */
  +API_EXPORT(char *) ap_array_pstrcat(pool *p, const array_header *arr,
  +                                    const char sep);
   
   /* copy_array copies the *entire* array.  copy_array_hdr just copies
    * the header, and arranges for the elements to be copied if (and only
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/ap.h
  
  Index: ap.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/ap.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap.h	1999/01/21 23:08:32	1.1
  +++ ap.h	1999/02/07 06:29:20	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +3 -0      apache-apr/pthreads/src/include/ap_compat.h
  
  Index: ap_compat.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/ap_compat.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap_compat.h	1999/01/21 23:08:32	1.1
  +++ ap_compat.h	1999/02/07 06:29:20	1.2
  @@ -118,6 +118,7 @@
   #define escape_html                    ap_escape_html
   #define escape_path_segment            ap_escape_path_segment
   #define escape_shell_cmd               ap_escape_shell_cmd
  +#define escape_uri                     ap_escape_uri
   #define excess_requests_per_child      ap_excess_requests_per_child
   #define exists_scoreboard_image        ap_exists_scoreboard_image
   #define finalize_request_protocol      ap_finalize_request_protocol
  @@ -321,6 +322,7 @@
   #define rvputs                         ap_rvputs
   #define rwrite                         ap_rwrite
   #define satisfies                      ap_satisfies
  +#define scan_script_header(a1,a2)      ap_scan_script_header_err(a1,a2,NULL)
   #define scan_script_header_err         ap_scan_script_header_err
   #define scan_script_header_err_buff    ap_scan_script_header_err_buff
   #define scoreboard_fname               ap_scoreboard_fname
  @@ -367,6 +369,7 @@
   #define standalone                     ap_standalone
   #define start_restart                  ap_start_restart
   #define start_shutdown                 ap_start_shutdown
  +#define status_drops_connection        ap_status_drops_connection
   #define str_tolower                    ap_str_tolower
   #define strcasecmp_match               ap_strcasecmp_match
   #define strcmp_match                   ap_strcmp_match
  
  
  
  1.2       +38 -24    apache-apr/pthreads/src/include/ap_config.h
  
  Index: ap_config.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/ap_config.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap_config.h	1999/01/21 23:08:32	1.1
  +++ ap_config.h	1999/02/07 06:29:20	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -84,6 +84,27 @@
   #include <sys/types.h>
   #include <sys/stat.h>
   
  +/* So that we can use inline on some critical functions, and use
  + * GNUC attributes (such as to get -Wall warnings for printf-like
  + * functions).  Only do this in gcc 2.7 or later ... it may work
  + * on earlier stuff, but why chance it.
  + *
  + * We've since discovered that the gcc shipped with NeXT systems
  + * as "cc" is completely broken.  It claims to be __GNUC__ and so
  + * on, but it doesn't implement half of the things that __GNUC__
  + * means.  In particular it's missing inline and the __attribute__
  + * stuff.  So we hack around it.  PR#1613. -djg
  + */
  +#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 7 || defined(NEXT)
  +#define ap_inline
  +#define __attribute__(__x)
  +#define ENUM_BITFIELD(e,n,w)  signed int n : w
  +#else
  +#define ap_inline __inline__
  +#define USE_GNU_INLINE
  +#define ENUM_BITFIELD(e,n,w)  e n : w
  +#endif
  +
   #ifdef WIN32
   /* include process.h first so we can override spawn[lv]e* properly */
   #include <process.h>
  @@ -548,8 +569,11 @@
   #endif /*_OSD_POSIX*/
   
   #elif defined(UW)
  +#if UW < 700
  +#define USE_FCNTL_SERIALIZED_ACCEPT
   #define NO_LINGCLOSE
   #define NO_KILLPG
  +#endif
   #undef  NO_SETSID
   #undef NEED_STRDUP
   #define NEED_STRCASECMP
  @@ -566,14 +590,18 @@
   #endif
   #define NET_SIZE_T size_t
   #define HAVE_SYSLOG 1
  -#define USE_FCNTL_SERIALIZED_ACCEPT
   
   #elif defined(DGUX)
   #define NO_KILLPG
   #undef  NO_SETSID
   #undef NEED_STRDUP
  +#ifdef _IX86_DG
  +#undef NEED_STRCASECMP
  +#undef NEED_STRNCASECMP
  +#else
   #define NEED_STRCASECMP
   #define NEED_STRNCASECMP
  +#endif
   #define bzero(a,b) memset(a,0,b)
   /* A lot of SVR4 systems need this */
   #define USE_FCNTL_SERIALIZED_ACCEPT
  @@ -590,11 +618,13 @@
   #endif
   #ifndef DEFAULT_GROUP
   #define DEFAULT_GROUP "nogroup"
  +#endif
   #define HAVE_SHMGET 1
   #define HAVE_MMAP 1
   #define USE_MMAP_SCOREBOARD
   #define USE_MMAP_FILES
  -#endif
  +#define USE_FLOCK_SERIALIZED_ACCEPT
  +#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
   
   #elif defined(UTS21)
   #undef HAVE_GMTOFF
  @@ -797,6 +827,11 @@
   #define NO_KILLPG
   #define NEED_INITGROUPS
   
  +#elif defined(_CX_SX)
  +#define JMP_BUF sigjmp_buf
  +#include <sys/types.h>
  +#include <sys/time.h>
  +
   #elif defined(WIN32)
   
   /* All windows stuff is now in os/win32/os.h */
  @@ -888,27 +923,6 @@
   #define ap_private_extern __private_extern__
   #else
   #define ap_private_extern
  -#endif
  -
  -/* So that we can use inline on some critical functions, and use
  - * GNUC attributes (such as to get -Wall warnings for printf-like
  - * functions).  Only do this in gcc 2.7 or later ... it may work
  - * on earlier stuff, but why chance it.
  - *
  - * We've since discovered that the gcc shipped with NeXT systems
  - * as "cc" is completely broken.  It claims to be __GNUC__ and so
  - * on, but it doesn't implement half of the things that __GNUC__
  - * means.  In particular it's missing inline and the __attribute__
  - * stuff.  So we hack around it.  PR#1613. -djg
  - */
  -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 7 || defined(NEXT)
  -#define ap_inline
  -#define __attribute__(__x)
  -#define ENUM_BITFIELD(e,n,w)  signed int n : w
  -#else
  -#define ap_inline __inline__
  -#define USE_GNU_INLINE
  -#define ENUM_BITFIELD(e,n,w)  e n : w
   #endif
   
   /*
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/ap_ctype.h
  
  Index: ap_ctype.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/ap_ctype.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap_ctype.h	1999/01/21 23:08:32	1.1
  +++ ap_ctype.h	1999/02/07 06:29:21	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +4 -1      apache-apr/pthreads/src/include/ap_md5.h
  
  Index: ap_md5.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/ap_md5.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap_md5.h	1999/01/21 23:08:32	1.1
  +++ ap_md5.h	1999/02/07 06:29:21	1.2
  @@ -29,7 +29,7 @@
    */
   
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -108,6 +108,9 @@
   API_EXPORT(void) ap_MD5Update(AP_MD5_CTX * context, const unsigned char *input,
   			   unsigned int inputLen);
   API_EXPORT(void) ap_MD5Final(unsigned char digest[16], AP_MD5_CTX * context);
  +API_EXPORT(void) ap_MD5Encode(const char *password, const char *salt,
  +			      char *result, size_t nbytes);
  +API_EXPORT(char *) ap_validate_password(const char *passwd, const char *hash);
   
   #ifdef __cplusplus
   }
  
  
  
  1.2       +34 -3     apache-apr/pthreads/src/include/ap_mmn.h
  
  Index: ap_mmn.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/ap_mmn.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ap_mmn.h	1999/01/21 23:08:32	1.1
  +++ ap_mmn.h	1999/02/07 06:29:21	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -181,12 +181,43 @@
    *                        (for implementing better error reporting).
    * 19980906 (1.3.2-dev) - added ap_md5_binary()
    * 19980917 (1.3.2-dev) - bs2000: changed os_set_authfile() to os_set_account()
  + * 19981108 (1.3.4-dev) - added ap_method_number_of()
  + *                      - changed value of M_INVALID and added WebDAV methods
  + * 19981108.1           - ap_exists_config_define() is now public (minor bump)
  + * 19981204             - scoreboard changes -- added generation, changed
  + *                        exit_generation to running_generation.  Somewhere
  + *                        earlier vhostrec was added, but it's only safe to use
  + *                        as of this rev.  See scoreboard.h for documentation.
  + * 19981211             - DSO changes -- added ap_single_module_configure()
  + *                                    -- added ap_single_module_init()
  + * 19981229             - mod_negotiation overhaul -- added ap_make_etag()
  + *                        and added vlist_validator to request_rec.
  + * 19990101             - renamed macro escape_uri() to ap_escape_uri()
  + *                      - added MODULE_MAGIC_COOKIE to identify module structs
  + * 19990103 (1.3.4-dev) - added ap_array_pstrcat()
  + * 19990105 (1.3.4-dev) - added ap_os_is_filename_valid()
  + * 19990106 (1.3.4-dev) - Move MODULE_MAGIC_COOKIE to the end of the
  + *                        STANDARD_MODULE_STUFF macro so the version
  + *                        numbers and file name remain at invariant offsets
  + * 19990108 (1.3.4-dev) - status_drops_connection -> ap_status_drops_connection
  + *                        scan_script_header -> ap_scan_script_header_err
  + *                      - reordered entries in request_rec that were waiting
  + *                        for a non-binary-compatible release.
  + * 19990108-1           - add ap_find_opaque_token() for things like ETags
  + *   (1.3.5-dev)          which can contain opaque quoted strings, and
  + *                        ap_MD5Encode() for MD5 password handling.
  + * 19990108-2           - add ap_validate_password() and change ap_MD5Encode()
  + *   (1.3.5-dev)          to use a stronger algorithm (which is incompatible
  + *                        with the one introduced [but not released] with
  + *                        19990108-1).
    */
   
  +#define MODULE_MAGIC_COOKIE 0x41503133UL /* "AP13" */
  +
   #ifndef MODULE_MAGIC_NUMBER_MAJOR
  -#define MODULE_MAGIC_NUMBER_MAJOR 19980917
  +#define MODULE_MAGIC_NUMBER_MAJOR 19990108
   #endif
  -#define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
  +#define MODULE_MAGIC_NUMBER_MINOR 2                     /* 0...n */
   #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR	/* backward compat */
   
   /* Useful for testing for features. */
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/buff.h
  
  Index: buff.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/buff.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- buff.h	1999/01/21 23:08:32	1.1
  +++ buff.h	1999/02/07 06:29:21	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.3       +1 -1      apache-apr/pthreads/src/include/http_conf_globals.h
  
  Index: http_conf_globals.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_conf_globals.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- http_conf_globals.h	1999/02/05 20:17:17	1.2
  +++ http_conf_globals.h	1999/02/07 06:29:21	1.3
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +13 -3     apache-apr/pthreads/src/include/http_config.h
  
  Index: http_config.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_config.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- http_config.h	1999/01/21 23:08:32	1.1
  +++ http_config.h	1999/02/07 06:29:21	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -198,11 +198,15 @@
   				 */
   
       const char *name;
  -
       void *dynamic_load_handle;
   
       struct module_struct *next;
   
  +    unsigned long magic;        /* Magic Cookie to identify a module structure;
  +                                 * It's mainly important for the DSO facility
  +                                 * (see also mod_so).
  +                                 */
  +
       /* init() occurs after config parsing, but before any children are
        * forked.
        * Modules should not rely on the order in which create_server_config
  @@ -285,8 +289,9 @@
   				MODULE_MAGIC_NUMBER_MINOR, \
   				-1, \
   				__FILE__, \
  +				NULL, \
   				NULL, \
  -				NULL
  +				MODULE_MAGIC_COOKIE
   
   /* Generic accessors for other modules to get at their own module-specific
    * data
  @@ -335,6 +340,11 @@
   extern module *ap_prelinked_modules[];
   extern module *ap_preloaded_modules[];
   extern API_VAR_EXPORT module **ap_loaded_modules;
  +
  +/* For mod_so.c... */
  +
  +void ap_single_module_configure(pool *p, server_rec *s, module *m);
  +void ap_single_module_init(pool *p, server_rec *s, module *m);
   
   /* For http_main.c... */
   
  
  
  
  1.2       +17 -1     apache-apr/pthreads/src/include/http_core.h
  
  Index: http_core.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_core.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- http_core.h	1999/01/21 23:08:32	1.1
  +++ http_core.h	1999/02/07 06:29:21	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -133,6 +133,7 @@
   API_EXPORT(unsigned) ap_get_server_port(const request_rec *r);
   API_EXPORT(unsigned long) ap_get_limit_req_body(const request_rec *r);
   API_EXPORT(void) ap_custom_response(request_rec *r, int status, char *string);
  +API_EXPORT(int) ap_exists_config_define(char *name);
   
   /* Authentication stuff.  This is one of the places where compatibility
    * with the old config files *really* hurts; they don't discriminate at
  @@ -151,6 +152,16 @@
   API_EXPORT(int) ap_satisfies (request_rec *r);
   API_EXPORT(const array_header *) ap_requires (request_rec *);    
   
  +#ifdef WIN32
  +/* 
  + * CGI Script stuff for Win32...
  + */
  +typedef enum { FileTypeUNKNOWN, FileTypeBIN, FileTypeEXE, FileTypeSCRIPT } file_type_e;
  +typedef enum { INTERPRETER_SOURCE_UNSET, INTERPRETER_SOURCE_REGISTRY, 
  +               INTERPRETER_SOURCE_SHEBANG } interpreter_source_e;
  +API_EXPORT(file_type_e) ap_get_win32_interpreter(const request_rec *, char*, char **);
  +#endif
  +
   #ifdef CORE_PRIVATE
   
   /*
  @@ -247,6 +258,11 @@
       array_header *sec;
       regex_t *r;
   
  +#ifdef WIN32
  +    /* Where to find interpreter to run scripts */
  +    interpreter_source_e script_interpreter_source;
  +#endif    
  +    
   } core_dir_config;
   
   /* Per-server core configuration */
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/http_log.h
  
  Index: http_log.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_log.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- http_log.h	1999/01/21 23:08:32	1.1
  +++ http_log.h	1999/02/07 06:29:22	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/http_main.h
  
  Index: http_main.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_main.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- http_main.h	1999/01/21 23:08:32	1.1
  +++ http_main.h	1999/02/07 06:29:22	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +7 -1      apache-apr/pthreads/src/include/http_protocol.h
  
  Index: http_protocol.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_protocol.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- http_protocol.h	1999/01/21 23:08:32	1.1
  +++ http_protocol.h	1999/02/07 06:29:22	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -115,6 +115,7 @@
   API_EXPORT(int) ap_set_content_length(request_rec *r, long length);
   API_EXPORT(int) ap_set_keepalive(request_rec *r);
   API_EXPORT(time_t) ap_rationalize_mtime(request_rec *r, time_t mtime);
  +API_EXPORT(char *) ap_make_etag(request_rec *r, int force_weak);
   API_EXPORT(void) ap_set_etag(request_rec *r);
   API_EXPORT(void) ap_set_last_modified(request_rec *r);
   API_EXPORT(int) ap_meets_conditions(request_rec *r);
  @@ -208,6 +209,11 @@
   /* This is also useful for putting sub_reqs and internal_redirects together */
   
   CORE_EXPORT(void) ap_parse_uri(request_rec *r, const char *uri);
  +
  +/* Get the method number associated with the given string, assumed to
  + * contain an HTTP method.  Returns M_INVALID if not recognized.
  + */
  +API_EXPORT(int) ap_method_number_of(const char *method);
   
   #ifdef __cplusplus
   }
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/http_request.h
  
  Index: http_request.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_request.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- http_request.h	1999/01/21 23:08:32	1.1
  +++ http_request.h	1999/02/07 06:29:22	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/http_vhost.h
  
  Index: http_vhost.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_vhost.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- http_vhost.h	1999/01/21 23:08:32	1.1
  +++ http_vhost.h	1999/02/07 06:29:22	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.4       +47 -23    apache-apr/pthreads/src/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/httpd.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -u -r1.3 -r1.4
  --- httpd.h	1999/02/05 20:17:17	1.3
  +++ httpd.h	1999/02/07 06:29:22	1.4
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -111,6 +111,11 @@
   /* Default administrator's address */
   #define DEFAULT_ADMIN "[no address given]"
   
  +/* The target name of the installed Apache */
  +#ifndef TARGET
  +#define TARGET "httpd"
  +#endif
  +
   /* 
    * --------- You shouldn't have to edit anything below this line ----------
    *
  @@ -147,8 +152,7 @@
   
   /* The name of the log files */
   #ifndef DEFAULT_XFERLOG
  -#ifdef OS2
  -/* Set default for OS/2 file system */
  +#if defined(OS2) || defined(WIN32)
   #define DEFAULT_XFERLOG "logs/access.log"
   #else
   #define DEFAULT_XFERLOG "logs/access_log"
  @@ -156,8 +160,7 @@
   #endif /* DEFAULT_XFERLOG */
   
   #ifndef DEFAULT_ERRORLOG
  -#ifdef OS2
  -/* Set default for OS/2 file system */
  +#if defined(OS2) || defined(WIN32)
   #define DEFAULT_ERRORLOG "logs/error.log"
   #else
   #define DEFAULT_ERRORLOG "logs/error_log"
  @@ -423,12 +426,11 @@
   API_EXPORT(void) ap_add_version_component(const char *component);
   API_EXPORT(const char *) ap_get_server_built(void);
   
  -/* Numeric release version identifier: major minor bugfix betaseq
  +/* Numeric release version identifier: MMNNFFRBB: major minor fix final beta
    * Always increases along the same track as the source branch.
  - * For a final release, 'betaseq' should be set to '99'.
  - * For example, Apache 1.4.2 should be '1040299'
  + * For example, Apache 1.4.2 would be '10402100', 2.5b7 would be '20500007'.
    */
  -#define APACHE_RELEASE 1030401
  +#define APACHE_RELEASE 10305000
   
   #define SERVER_PROTOCOL "HTTP/1.1"
   #ifndef SERVER_SUPPORT
  @@ -448,7 +450,7 @@
    * all of the potential response status-lines (a sparse table).
    * A future version should dynamically generate the table at startup.
    */
  -#define RESPONSE_CODES 54
  +#define RESPONSE_CODES 55
   
   #define HTTP_CONTINUE                      100
   #define HTTP_SWITCHING_PROTOCOLS           101
  @@ -488,6 +490,7 @@
   #define HTTP_EXPECTATION_FAILED            417
   #define HTTP_UNPROCESSABLE_ENTITY          422
   #define HTTP_LOCKED                        423
  +#define HTTP_FAILED_DEPENDENCY             424
   #define HTTP_INTERNAL_SERVER_ERROR         500
   #define HTTP_NOT_IMPLEMENTED               501
   #define HTTP_BAD_GATEWAY                   502
  @@ -495,6 +498,7 @@
   #define HTTP_GATEWAY_TIME_OUT              504
   #define HTTP_VERSION_NOT_SUPPORTED         505
   #define HTTP_VARIANT_ALSO_VARIES           506
  +#define HTTP_INSUFFICIENT_STORAGE          507
   #define HTTP_NOT_EXTENDED                  510
   
   #define DOCUMENT_FOLLOWS    HTTP_OK
  @@ -523,7 +527,8 @@
   #define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
   #define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
   
  -#define status_drops_connection(x) (((x) == HTTP_BAD_REQUEST)           || \
  +#define ap_status_drops_connection(x) \
  +                                   (((x) == HTTP_BAD_REQUEST)           || \
                                       ((x) == HTTP_REQUEST_TIME_OUT)      || \
                                       ((x) == HTTP_LENGTH_REQUIRED)       || \
                                       ((x) == HTTP_REQUEST_ENTITY_TOO_LARGE) || \
  @@ -532,16 +537,28 @@
                                       ((x) == HTTP_SERVICE_UNAVAILABLE) || \
   				    ((x) == HTTP_NOT_IMPLEMENTED))
   
  +/* Methods recognized (but not necessarily handled) by the server.
  + * These constants are used in bit shifting masks of size int, so it is
  + * unsafe to have more methods than bits in an int.  HEAD == M_GET.
  + */
  +#define M_GET        0
  +#define M_PUT        1
  +#define M_POST       2
  +#define M_DELETE     3
  +#define M_CONNECT    4
  +#define M_OPTIONS    5
  +#define M_TRACE      6
  +#define M_PATCH      7
  +#define M_PROPFIND   8
  +#define M_PROPPATCH  9
  +#define M_MKCOL     10
  +#define M_COPY      11
  +#define M_MOVE      12
  +#define M_LOCK      13
  +#define M_UNLOCK    14
   
  -#define METHODS 8
  -#define M_GET 0
  -#define M_PUT 1
  -#define M_POST 2
  -#define M_DELETE 3
  -#define M_CONNECT 4
  -#define M_OPTIONS 5
  -#define M_TRACE 6
  -#define M_INVALID 7
  +#define METHODS     15
  +#define M_INVALID   31
   
   #define CGI_MAGIC_TYPE "application/x-httpd-cgi"
   #define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"
  @@ -693,6 +710,7 @@
       long read_length;		/* bytes that have been read */
       int read_body;		/* how the request body should be read */
       int read_chunked;		/* reading chunked transfer-coding */
  +    unsigned expecting_100;	/* is client waiting for a 100 response? */
   
       /* MIME header environments, in and out.  Also, an array containing
        * environment variables to be passed to subprocesses, so people can
  @@ -723,6 +741,8 @@
       const char *content_language;	/* for back-compat. only -- do not use */
       array_header *content_languages;	/* array of (char*) */
   
  +    char *vlist_validator;      /* variant list validator (if negotiated) */
  +
       int no_cache;
       int no_local_copy;
   
  @@ -759,7 +779,6 @@
    * record to improve 64bit alignment the next time we need to break
    * binary compatibility for some other reason.
    */
  -    unsigned expecting_100;     /* is client waiting for a 100 response? */
   };
   
   
  @@ -917,6 +936,8 @@
   
   API_EXPORT(char *) ap_get_token(pool *p, const char **accept_line, int accept_white);
   API_EXPORT(int) ap_find_token(pool *p, const char *line, const char *tok);
  +API_EXPORT(int) ap_find_opaque_token(pool *p, const char *line,
  +				     const char *tok);
   API_EXPORT(int) ap_find_last_token(pool *p, const char *line, const char *tok);
   
   API_EXPORT(int) ap_is_url(const char *u);
  @@ -925,7 +946,7 @@
   API_EXPORT(void) ap_getparents(char *name);
   API_EXPORT(char *) ap_escape_path_segment(pool *p, const char *s);
   API_EXPORT(char *) ap_os_escape_path(pool *p, const char *path, int partial);
  -#define escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
  +#define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
   API_EXPORT(char *) ap_escape_html(pool *p, const char *s);
   API_EXPORT(char *) ap_construct_server(pool *p, const char *hostname,
   				    unsigned port, const request_rec *r);
  @@ -999,6 +1020,9 @@
   API_EXPORT(void) ap_chdir_file(const char *file);
   
   #ifndef HAVE_CANONICAL_FILENAME
  +/*
  + *  We can't define these in os.h because of dependence on pool pointer.
  + */
   #define ap_os_canonical_filename(p,f)  (f)
   #define ap_os_case_canonical_filename(p,f)  (f)
   #define ap_os_systemcase_filename(p,f)  (f)
  @@ -1062,7 +1086,7 @@
    */
   API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
   			    __attribute__((noreturn));
  -#define ap_assert(exp) (void)( (exp) || (ap_log_assert(#exp, __FILE__, __LINE__), 0) )
  +#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
   
   /* The optimized timeout code only works if we're not MULTITHREAD and we're
    * also not using a scoreboard file
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/rfc1413.h
  
  Index: rfc1413.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/rfc1413.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- rfc1413.h	1999/01/21 23:08:32	1.1
  +++ rfc1413.h	1999/02/07 06:29:22	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.3       +30 -3     apache-apr/pthreads/src/include/scoreboard.h
  
  Index: scoreboard.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/scoreboard.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- scoreboard.h	1999/01/22 16:10:54	1.2
  +++ scoreboard.h	1999/02/07 06:29:22	1.3
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -106,6 +106,29 @@
    */
   typedef unsigned vtime_t;
   
  +/* Type used for generation indicies.  Startup and every restart cause a
  + * new generation of children to be spawned.  Children within the same
  + * generation share the same configuration information -- pointers to stuff
  + * created at config time in the parent are valid across children.  For
  + * example, the vhostrec pointer in the scoreboard below is valid in all
  + * children of the same generation.
  + *
  + * The safe way to access the vhost pointer is like this:
  + *
  + * short_score *ss = pointer to whichver slot is interesting;
  + * parent_score *ps = pointer to whichver slot is interesting;
  + * server_rec *vh = ss->vhostrec;
  + *
  + * if (ps->generation != ap_my_generation) {
  + *     vh = NULL;
  + * }
  + *
  + * then if vh is not NULL it's valid in this child.
  + *
  + * This avoids various race conditions around restarts.
  + */
  +typedef int ap_generation_t;
  +
   /* stuff which the children generally write, and the parent mainly reads */
   typedef struct {
   #ifdef OPTIMIZE_TIMEOUTS
  @@ -135,11 +158,12 @@
       char client[32];		/* Keep 'em small... */
       char request[64];		/* We just want an idea... */
       server_rec *vhostrec;	/* What virtual host is being accessed? */
  +                                /* SEE ABOVE FOR SAFE USAGE! */
   } short_score;
   
   typedef struct {
  -    int exit_generation;	/* Set by the main process if a graceful
  -				   restart is required */
  +    ap_generation_t running_generation;	/* the generation of children which
  +                                         * should still be serving requests. */
   } global_score;
   
   /* stuff which the parent generally writes and the children rarely read */
  @@ -150,6 +174,7 @@
       time_t last_rtime;		/* time(0) of the last change */
       vtime_t last_vtime;		/* the last vtime the parent has seen */
   #endif
  +    ap_generation_t generation;	/* generation of this child */
   } parent_score;
   
   typedef struct {
  @@ -163,6 +188,8 @@
   API_EXPORT(int) ap_exists_scoreboard_image(void);
   
   API_VAR_EXPORT extern scoreboard *ap_scoreboard_image;
  +
  +API_VAR_EXPORT extern ap_generation_t volatile ap_my_generation;
   
   /* for time_process_request() in http_main.c */
   #define START_PREQUEST 1
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/util_date.h
  
  Index: util_date.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/util_date.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- util_date.h	1999/01/21 23:08:32	1.1
  +++ util_date.h	1999/02/07 06:29:23	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/util_md5.h
  
  Index: util_md5.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/util_md5.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- util_md5.h	1999/01/21 23:08:32	1.1
  +++ util_md5.h	1999/02/07 06:29:23	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -2      apache-apr/pthreads/src/include/util_script.h
  
  Index: util_script.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/util_script.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- util_script.h	1999/01/21 23:08:32	1.1
  +++ util_script.h	1999/02/07 06:29:23	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -74,7 +74,6 @@
   API_EXPORT(int) ap_find_path_info(const char *uri, const char *path_info);
   API_EXPORT(void) ap_add_cgi_vars(request_rec *r);
   API_EXPORT(void) ap_add_common_vars(request_rec *r);
  -#define scan_script_header(a1,a2) ap_scan_script_header_err(a1,a2,NULL)
   API_EXPORT(int) ap_scan_script_header_err(request_rec *r, FILE *f, char *buffer);
   API_EXPORT(int) ap_scan_script_header_err_buff(request_rec *r, BUFF *f,
                                                  char *buffer);
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/include/util_uri.h
  
  Index: util_uri.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/util_uri.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- util_uri.h	1999/01/21 23:08:32	1.1
  +++ util_uri.h	1999/02/07 06:29:23	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.3       +1 -4      apache-apr/pthreads/src/main/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/Makefile.tmpl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- Makefile.tmpl	1999/02/03 17:50:08	1.2
  +++ Makefile.tmpl	1999/02/07 06:29:29	1.3
  @@ -11,7 +11,7 @@
         http_config.o http_core.o http_log.o \
         http_main.o http_protocol.o http_request.o http_vhost.o \
         util.o util_date.o util_script.o util_uri.o util_md5.o \
  -      md5c.o rfc1413.o fdqueue.o
  +      rfc1413.o fdqueue.o
   
   .c.o:
   	$(CC) -c $(INCLUDES) $(CFLAGS) $<
  @@ -131,9 +131,6 @@
    $(INCDIR)/http_config.h $(INCDIR)/http_conf_globals.h \
    $(INCDIR)/http_log.h $(INCDIR)/http_vhost.h \
    $(INCDIR)/http_protocol.h
  -md5c.o: md5c.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \
  - $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(INCDIR)/ap_ctype.h \
  - $(INCDIR)/hsregex.h $(INCDIR)/ap_md5.h
   rfc1413.o: rfc1413.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \
    $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
    $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/alloc.h \
  
  
  
  1.3       +55 -1     apache-apr/pthreads/src/main/alloc.c
  
  Index: alloc.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/alloc.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- alloc.c	1999/02/03 17:50:09	1.2
  +++ alloc.c	1999/02/07 06:29:29	1.3
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -1060,6 +1060,60 @@
       array_header *res = ap_copy_array_hdr(p, first);
   
       ap_array_cat(res, second);
  +    return res;
  +}
  +
  +/* ap_array_pstrcat generates a new string from the pool containing
  + * the concatenated sequence of substrings referenced as elements within
  + * the array.  The string will be empty if all substrings are empty or null,
  + * or if there are no elements in the array.
  + * If sep is non-NUL, it will be inserted between elements as a separator.
  + */
  +API_EXPORT(char *) ap_array_pstrcat(pool *p, const array_header *arr,
  +                                    const char sep)
  +{
  +    char *cp, *res, **strpp;
  +    int i, len;
  +
  +    if (arr->nelts <= 0 || arr->elts == NULL)      /* Empty table? */
  +        return (char *) ap_pcalloc(p, 1);
  +
  +    /* Pass one --- find length of required string */
  +
  +    len = 0;
  +    for (i = 0, strpp = (char **) arr->elts; ; ++strpp) {
  +        if (strpp && *strpp != NULL) {
  +            len += strlen(*strpp);
  +        }
  +        if (++i >= arr->nelts)
  +            break;
  +        if (sep)
  +            ++len;
  +    }
  +
  +    /* Allocate the required string */
  +
  +    res = (char *) ap_palloc(p, len + 1);
  +    cp = res;
  +
  +    /* Pass two --- copy the argument strings into the result space */
  +
  +    for (i = 0, strpp = (char **) arr->elts; ; ++strpp) {
  +        if (strpp && *strpp != NULL) {
  +            len = strlen(*strpp);
  +            memcpy(cp, *strpp, len);
  +            cp += len;
  +        }
  +        if (++i >= arr->nelts)
  +            break;
  +        if (sep)
  +            *cp++ = sep;
  +    }
  +
  +    *cp = '\0';
  +
  +    /* Return the result string */
  +
       return res;
   }
   
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/main/buff.c
  
  Index: buff.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/buff.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- buff.c	1999/01/21 23:08:33	1.1
  +++ buff.c	1999/02/07 06:29:30	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +9 -1      apache-apr/pthreads/src/main/gen_test_char.c
  
  Index: gen_test_char.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/gen_test_char.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- gen_test_char.c	1999/01/21 23:08:33	1.1
  +++ gen_test_char.c	1999/02/07 06:29:30	1.2
  @@ -8,6 +8,7 @@
   #define T_ESCAPE_PATH_SEGMENT	(0x02)
   #define T_OS_ESCAPE_PATH	(0x04)
   #define T_HTTP_TOKEN_STOP	(0x08)
  +#define T_HTTP_OPAQUETOKEN_STOP	(0x10)
   
   int main(int argc, char *argv[])
   {
  @@ -20,13 +21,15 @@
   "#define T_ESCAPE_PATH_SEGMENT	(%u)\n"
   "#define T_OS_ESCAPE_PATH	(%u)\n"
   "#define T_HTTP_TOKEN_STOP	(%u)\n"
  +"#define T_HTTP_OPAQUETOKEN_STOP	(%u)\n"
   "\n"
   "static const unsigned char test_char_table[256] = {\n"
   "    0,",
   	T_ESCAPE_SHELL_CMD,
   	T_ESCAPE_PATH_SEGMENT,
   	T_OS_ESCAPE_PATH,
  -	T_HTTP_TOKEN_STOP);
  +	T_HTTP_TOKEN_STOP,
  +	T_HTTP_OPAQUETOKEN_STOP);
   
       /* we explicitly dealt with NUL above
        * in case some strchr() do bogosity with it */
  @@ -52,6 +55,11 @@
   	/* these are the "tspecials" from RFC2068 */
   	if (ap_iscntrl(c) || strchr(" \t()<>@,;:\\/[]?={}", c)) {
   	    flags |= T_HTTP_TOKEN_STOP;
  +	}
  +
  +	/* some tokens (like etags) are opaque strings; stop at the end */
  +	if (ap_iscntrl(c) || strchr(" ,", c)) {
  +	    flags |= T_HTTP_OPAQUETOKEN_STOP;
   	}
   	printf("%u%c", flags, (c < 255) ? ',' : ' ');
   
  
  
  
  1.5       +27 -10    apache-apr/pthreads/src/main/http_config.c
  
  Index: http_config.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_config.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -u -r1.4 -r1.5
  --- http_config.c	1999/02/05 20:17:18	1.4
  +++ http_config.c	1999/02/07 06:29:30	1.5
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -539,8 +539,8 @@
        */
   
       if (m->version != MODULE_MAGIC_NUMBER_MAJOR) {
  -	fprintf(stderr, "httpd: module \"%s\" is not compatible with this "
  -		"version of Apache.\n", m->name);
  +	fprintf(stderr, "%s: module \"%s\" is not compatible with this "
  +		"version of Apache.\n", ap_server_argv0, m->name);
   	fprintf(stderr, "Please contact the vendor for the correct version.\n");
   	exit(1);
       }
  @@ -554,8 +554,8 @@
   	dynamic_modules++;
   
   	if (dynamic_modules > DYNAMIC_MODULE_LIMIT) {
  -	    fprintf(stderr, "httpd: module \"%s\" could not be loaded, because"
  -		    " the dynamic\n", m->name);
  +	    fprintf(stderr, "%s: module \"%s\" could not be loaded, because"
  +		    " the dynamic\n", ap_server_argv0, m->name);
   	    fprintf(stderr, "module limit was reached. Please increase "
   		    "DYNAMIC_MODULE_LIMIT and recompile.\n");
   	    exit(1);
  @@ -1179,8 +1179,8 @@
   
       if (!(parms.config_file = ap_pcfg_openfile(p,fname))) {
   	perror("fopen");
  -	fprintf(stderr, "httpd: could not open document config file %s\n",
  -		fname);
  +	fprintf(stderr, "%s: could not open document config file %s\n",
  +		ap_server_argv0, fname);
   	exit(1);
       }
   
  @@ -1188,7 +1188,7 @@
   
       if (errmsg) {
   	fprintf(stderr, "Syntax error on line %d of %s:\n",
  -		parms.config_file->line_number, fname);
  +		parms.config_file->line_number, parms.config_file->name);
   	fprintf(stderr, "%s\n", errmsg);
   	exit(1);
       }
  @@ -1477,6 +1477,23 @@
       return s;
   }
   
  +void ap_single_module_configure(pool *p, server_rec *s, module *m)
  +{
  +    if (m->create_server_config)
  +        ap_set_module_config(s->module_config, m,
  +                             (*m->create_server_config)(p, s));
  +    if (m->create_dir_config)
  +        ap_set_module_config(s->lookup_defaults, m,
  +                             (*m->create_dir_config)(p, NULL));
  +}
  +
  +void ap_single_module_init(pool *p, server_rec *s, module *m)
  +{
  +    if (m->init)
  +        (*m->init)(s, p);
  +    build_method_shortcuts();
  +    init_handlers(p);
  +}
   
   void ap_init_modules(pool *p, server_rec *s)
   {
  @@ -1546,9 +1563,9 @@
   	 ((pc->req_override & (ACCESS_CONF | OR_AUTHCFG | OR_LIMIT)))))
   	printf("anywhere");
       else if (pc->req_override & RSRC_CONF)
  -	printf("only outside <Directory> or <Location>");
  +	printf("only outside <Directory>, <Files> or <Location>");
       else
  -	printf("only inside <Directory> or <Location>");
  +	printf("only inside <Directory>, <Files> or <Location>");
   
       /* Warn if the directive is allowed inside <Directory> or .htaccess
        * but module doesn't support per-dir configuration */
  
  
  
  1.3       +232 -36   apache-apr/pthreads/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_core.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- http_core.c	1999/02/05 20:17:19	1.2
  +++ http_core.c	1999/02/07 06:29:30	1.3
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -145,7 +145,9 @@
   
       conf->limit_req_body = 0;
       conf->sec = ap_make_array(a, 2, sizeof(void *));
  -
  +#ifdef WIN32
  +    conf->script_interpreter_source = INTERPRETER_SOURCE_UNSET;
  +#endif
       return (void *)conf;
   }
   
  @@ -262,6 +264,13 @@
       if (new->satisfy != SATISFY_NOSPEC) {
           conf->satisfy = new->satisfy;
       }
  +
  +#ifdef WIN32
  +    if (new->script_interpreter_source != INTERPRETER_SOURCE_UNSET) {
  +        conf->script_interpreter_source = new->script_interpreter_source;
  +    }
  +#endif
  +
       return (void*)conf;
   }
   
  @@ -418,6 +427,8 @@
       qsort(sortbin, nelts, sizeof(*sortbin), reorder_sorter);
   
       /* and now build a new array */
  +    /* XXX: uh I don't see why we can't reuse the old array, what
  +     * was I thinking? -djg */
       sec = ap_make_array(p, nelts, sizeof(void *));
       for (i = 0; i < nelts; ++i) {
   	*(void **)ap_push_array(sec) = sortbin[i].elt;
  @@ -728,6 +739,174 @@
       return d->limit_req_body;
   }
   
  +#ifdef WIN32
  +static char* get_interpreter_from_win32_registry(pool *p, const char* ext) 
  +{
  +    char extension_path[] = "SOFTWARE\\Classes\\";
  +    char executable_path[] = "\\SHELL\\OPEN\\COMMAND";
  +
  +    HKEY hkeyOpen;
  +    DWORD type;
  +    int size;
  +    int result;
  +    char *keyName;
  +    char *buffer;
  +    char *s;
  +
  +    if (!ext)
  +        return NULL;
  +    /* 
  +     * Future optimization:
  +     * When the registry is successfully searched, store the interpreter
  +     * string in a table to make subsequent look-ups faster
  +     */
  +
  +    /* Open the key associated with the script extension */
  +    keyName = ap_pstrcat(p, extension_path, ext, NULL);
  +
  +    result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, KEY_QUERY_VALUE, 
  +                          &hkeyOpen);
  +
  +    if (result != ERROR_SUCCESS) 
  +        return NULL;
  +
  +    /* Read to NULL buffer to find value size */
  +    size = 0;
  +    result = RegQueryValueEx(hkeyOpen, "", NULL, &type, NULL, &size);
  +
  +    if (result == ERROR_SUCCESS) {
  +        buffer = ap_palloc(p, size);
  +        result = RegQueryValueEx(hkeyOpen, "", NULL, &type, buffer, &size);
  +    }
  +
  +    RegCloseKey(hkeyOpen);
  +
  +    if (result != ERROR_SUCCESS)
  +        return NULL;
  +
  +    /* Open the key associated with the interpreter path */
  +    keyName = ap_pstrcat(p, extension_path, buffer, executable_path, NULL);
  +
  +    result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, KEY_QUERY_VALUE, 
  +                          &hkeyOpen);
  +
  +    if (result != ERROR_SUCCESS)
  +        return NULL;
  +
  +    /* Read to NULL buffer to find value size */
  +    size = 0;
  +    result = RegQueryValueEx(hkeyOpen, "", 0, &type, NULL, &size);
  +
  +    if (result == ERROR_SUCCESS) {
  +        buffer = ap_palloc(p, size);
  +        result = RegQueryValueEx(hkeyOpen, "", 0, &type, buffer, &size);
  +    }
  +
  +    RegCloseKey(hkeyOpen);
  +
  +    if (result != ERROR_SUCCESS)
  +        return NULL;
  +
  +    /*
  +     * The canonical way shell command entries are entered in the Win32 
  +     * registry is as follows:
  +     *   shell [options] "%1"
  +     * where
  +     *   shell - full path name to interpreter or shell to run.
  +     *           E.g., c:\usr\local\ntreskit\perl\bin\perl.exe
  +     *   options - optional switches
  +     *              E.g., \C
  +     *   "%1" - Place holder for file to run the shell against. 
  +     *          Typically quoted.
  +     *
  +     * If we find a %1 or a quoted %1, lop it off. 
  +     */
  +    if (buffer && *buffer) {
  +        if ((s = strstr(buffer, "\"%1")))
  +            *s = '\0';
  +        else if ((s = strstr(buffer, "%1"))) 
  +            *s = '\0';
  +    }
  +
  +    return buffer;
  +}
  +
  +API_EXPORT (file_type_e) ap_get_win32_interpreter(const  request_rec *r, 
  +                                                  char*  ext, 
  +                                                  char** interpreter )
  +{
  +    HANDLE hFile;
  +    DWORD nBytesRead;
  +    BOOLEAN bResult;
  +    char buffer[1024];
  +    core_dir_config *d;
  +    file_type_e fileType = FileTypeUNKNOWN;
  +    int i;
  +
  +    d = (core_dir_config *)ap_get_module_config(r->per_dir_config, 
  +                                                &core_module);
  +
  +    if (d->script_interpreter_source == INTERPRETER_SOURCE_REGISTRY) {
  +        /* 
  +         * Check the registry
  +         */
  +        *interpreter = get_interpreter_from_win32_registry(r->pool, ext);
  +        if (*interpreter)
  +            return FileTypeSCRIPT;
  +        else {
  +            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, r->server,
  +             "ScriptInterpreterSource config directive set to \"registry\".\n\t"
  +             "Registry was searched but interpreter not found. Trying the shebang line.");
  +        }
  +    }
  +
  +    /* 
  +     * Look for a #! line in the script
  +     */
  +    hFile = CreateFile(r->filename, GENERIC_READ, FILE_SHARE_READ, NULL,
  +                       OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
  +
  +    if (hFile == INVALID_HANDLE_VALUE) {
  +        return FileTypeUNKNOWN;
  +    }
  +
  +    bResult = ReadFile(hFile, (void*) &buffer, sizeof(buffer), 
  +                       &nBytesRead, NULL);
  +    if (!bResult || (nBytesRead == 0)) {
  +        ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
  +                      "ReadFile(%s) failed", r->filename);
  +        CloseHandle(hFile);
  +        return (FileTypeUNKNOWN);
  +    }
  +    CloseHandle(hFile);
  +    
  +    buffer[nBytesRead] = '\0';
  +    
  +    if ((buffer[0] == '#') && (buffer[1] == '!')) {
  +        fileType = FileTypeSCRIPT;
  +        for (i = 2; i < sizeof(buffer); i++) {
  +            if ((buffer[i] == '\r')
  +                || (buffer[i] == '\n')) {
  +                break;
  +            }
  +        }
  +        buffer[i] = '\0';
  +        for (i = 2; buffer[i] == ' '; ++i)
  +            ;
  +        *interpreter = ap_pstrdup(r->pool, buffer + i ); 
  +    }
  +    else {
  +        /* Check to see if it's a executable */
  +        IMAGE_DOS_HEADER *hdr = (IMAGE_DOS_HEADER*)interpreter;
  +        if (hdr->e_magic == IMAGE_DOS_SIGNATURE && hdr->e_cblp < 512) {
  +            fileType = FileTypeEXE;
  +        }
  +    }
  +
  +    return fileType;
  +}
  +#endif
  +
   /*****************************************************************
    *
    * Commands... this module handles almost all of the NCSA httpd.conf
  @@ -891,15 +1070,23 @@
           return ap_pstrcat(cmd->pool, "Unsupported HTTP response code ",
   			  w, NULL);
       }
  -                
  -    /* Store it... */
   
  -    if (conf->response_code_strings == NULL) {
  -	conf->response_code_strings =
  -	    ap_pcalloc(cmd->pool,
  -		       sizeof(*conf->response_code_strings) * RESPONSE_CODES);
  -    }
  -    conf->response_code_strings[index_number] = ap_pstrdup(cmd->pool, line);
  +    /* The entry should be ignored if it is a full URL for a 401 error */
  +
  +    if (error_number == 401 &&
  +	line[0] != '/' && line[0] != '"') { /* Ignore it... */
  +	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, NULL,
  +		     "cannot use a full URL in a 401 ErrorDocument "
  +		     "directive --- ignoring!");
  +    }
  +    else { /* Store it... */
  +    	if (conf->response_code_strings == NULL) {
  +	    conf->response_code_strings =
  +		ap_pcalloc(cmd->pool,
  +			   sizeof(*conf->response_code_strings) * RESPONSE_CODES);
  +        }
  +        conf->response_code_strings[index_number] = ap_pstrdup(cmd->pool, line);
  +    }   
   
       return NULL;
   }
  @@ -1073,28 +1260,18 @@
       
       while (limited_methods[0]) {
           char *method = ap_getword_conf(cmd->pool, &limited_methods);
  -	if (!strcmp(method, "GET")) {
  -	    limited |= (1 << M_GET);
  -	}
  -	else if (!strcmp(method, "PUT")) {
  -	    limited |= (1 << M_PUT);
  -	}
  -	else if (!strcmp(method, "POST")) {
  -	    limited |= (1 << M_POST);
  -	}
  -	else if (!strcmp(method, "DELETE")) {
  -	    limited |= (1 << M_DELETE);
  -	}
  -        else if (!strcmp(method, "CONNECT")) {
  -	    limited |= (1 << M_CONNECT);
  -	}
  -	else if (!strcmp(method, "OPTIONS")) {
  -	    limited |= (1 << M_OPTIONS);
  -	}
  -	else {
  -	    return ap_pstrcat(cmd->pool, "unknown method \"",
  -			      method, "\" in <Limit>", NULL);
  -	}
  +        int  methnum = ap_method_number_of(method);
  +
  +        if (methnum == M_TRACE) {
  +            return "TRACE cannot be controlled by <Limit>";
  +        }
  +        else if (methnum == M_INVALID) {
  +            return ap_pstrcat(cmd->pool, "unknown method \"",
  +                              method, "\" in <Limit>", NULL);
  +        }
  +        else {
  +            limited |= (1 << methnum);
  +        }
       }
   
       cmd->limited = limited;
  @@ -1428,7 +1605,7 @@
       return NULL;
   }
   
  -static int ap_exists_config_define(char *name)
  +API_EXPORT(int) ap_exists_config_define(char *name)
   {
       char **defines;
       int i;
  @@ -2466,6 +2643,21 @@
       return NULL;
   }
   
  +#ifdef WIN32
  +static const char *set_interpreter_source(cmd_parms *cmd, core_dir_config *d,
  +                                                char *arg)
  +{
  +    if (!strcasecmp(arg, "registry")) {
  +        d->script_interpreter_source = INTERPRETER_SOURCE_REGISTRY;
  +    } else if (!strcasecmp(arg, "script")) {
  +        d->script_interpreter_source = INTERPRETER_SOURCE_SHEBANG;
  +    } else {
  +        d->script_interpreter_source = INTERPRETER_SOURCE_SHEBANG;
  +    }
  +    return NULL;
  +}
  +#endif
  +
   /* Note --- ErrorDocument will now work from .htaccess files.  
    * The AllowOverride of Fileinfo allows webmasters to turn it off
    */
  @@ -2600,10 +2792,10 @@
     "Whether persistent connections should be On or Off" },
   { "IdentityCheck", set_idcheck, NULL, RSRC_CONF|ACCESS_CONF, FLAG,
     "Enable identd (RFC 1413) user lookups - SLOW" },
  -{ "ContentDigest", set_content_md5, NULL, RSRC_CONF|ACCESS_CONF|OR_AUTHCFG,
  +{ "ContentDigest", set_content_md5, NULL, OR_OPTIONS,
     FLAG, "whether or not to send a Content-MD5 header with each request" },
   { "UseCanonicalName", set_use_canonical_name, NULL,
  -  RSRC_CONF|ACCESS_CONF|OR_AUTHCFG, FLAG,
  +  OR_OPTIONS, FLAG,
     "Whether or not to always use the canonical ServerName : Port when "
     "constructing URLs" },
   { "StartServers", set_daemons_to_start, NULL, RSRC_CONF, TAKE1,
  @@ -2680,8 +2872,12 @@
     "Limit (0 = unlimited) on max number of header fields in a request message"},
   { "LimitRequestBody", set_limit_req_body,
     (void*)XtOffsetOf(core_dir_config, limit_req_body),
  -  RSRC_CONF|ACCESS_CONF|OR_ALL, TAKE1,
  +  OR_ALL, TAKE1,
     "Limit (in bytes) on maximum size of request message body" },
  +#ifdef WIN32
  +{ "ScriptInterpreterSource", set_interpreter_source, NULL, OR_FILEINFO, TAKE1,
  +  "Where to find interpreter to run Win32 scripts (Registry or script shebang line)" },
  +#endif
   { NULL },
   };
   
  
  
  
  1.2       +13 -7     apache-apr/pthreads/src/main/http_log.c
  
  Index: http_log.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_log.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- http_log.c	1999/01/21 23:08:33	1.1
  +++ http_log.c	1999/02/07 06:29:30	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -65,6 +65,7 @@
   
   #define CORE_PRIVATE
   #include "httpd.h"
  +#include "http_conf_globals.h"
   #include "http_config.h"
   #include "http_core.h"
   #include "http_log.h"
  @@ -206,14 +207,15 @@
   	    fname++;
   	    for (fac = facilities; fac->t_name; fac++) {
   		if (!strcasecmp(fname, fac->t_name)) {
  -		    openlog("httpd", LOG_NDELAY|LOG_CONS|LOG_PID, fac->t_val);
  +		    openlog(ap_server_argv0, LOG_NDELAY|LOG_CONS|LOG_PID,
  +			    fac->t_val);
   		    s->error_log = NULL;
   		    return;
   		}
   	    }
   	}
   	else
  -	    openlog("httpd", LOG_NDELAY|LOG_CONS|LOG_PID, LOG_LOCAL7);
  +	    openlog(ap_server_argv0, LOG_NDELAY|LOG_CONS|LOG_PID, LOG_LOCAL7);
   
   	s->error_log = NULL;
       }
  @@ -223,7 +225,8 @@
   	/*  Change to AP funcs. */
           if (!(s->error_log = ap_pfopen(p, fname, "a"))) {
               perror("fopen");
  -            fprintf(stderr,"httpd: could not open error log file %s.\n", fname);
  +            fprintf(stderr, "%s: could not open error log file %s.\n",
  +		    ap_server_argv0, fname);
               exit(1);
   	}
       }
  @@ -321,7 +324,8 @@
       }
   
       if (logf) {
  -	len = ap_snprintf(errstr, sizeof(errstr), "[%s] ", ap_get_time());
  +	len = ap_snprintf(errstr, sizeof(errstr), "%s: [%s] ",
  +			  ap_server_argv0, ap_get_time());
       } else {
   	len = 0;
       }
  @@ -396,7 +400,8 @@
   	     */
   	    nErrorCode = GetLastError();
   	    len += ap_snprintf(errstr + len, sizeof(errstr) - len,
  -		"(FormatMessage failed with code %d): ", nErrorCode);
  +			       "(FormatMessage failed with code %d): ",
  +			       nErrorCode);
   	}
   	else {
   	    /* FormatMessage put the message in the buffer, but it may
  @@ -493,7 +498,8 @@
   
       if(!(pid_file = fopen(fname, "w"))) {
   	perror("fopen");
  -        fprintf(stderr, "httpd: could not log pid to file %s\n", fname);
  +        fprintf(stderr, "%s: could not log pid to file %s\n",
  +		ap_server_argv0, fname);
           exit(1);
       }
       fprintf(pid_file, "%ld\n", (long)mypid);
  
  
  
  1.9       +37 -17    apache-apr/pthreads/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_main.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -u -r1.8 -r1.9
  --- http_main.c	1999/02/05 20:23:10	1.8
  +++ http_main.c	1999/02/07 06:29:30	1.9
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    * 
    * Redistribution and use in source and binary forms, with or without 
    * modification, are permitted provided that the following conditions 
  @@ -171,7 +171,7 @@
   time_t ap_restart_time;
   int ap_suexec_enabled = 0;
   int ap_listenbacklog;
  -int ap_dump_settings;
  +int ap_dump_settings = 0;
   API_VAR_EXPORT int ap_extended_status = 0;
   
   /*
  @@ -329,9 +329,9 @@
   #ifdef LINUX
           if (errno == ENOSYS) {
               ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, server_conf,
  -                         "Your kernel was built without CONFIG_SYSVIPC\n"
  -                         "%s: Please consult the Apache FAQ for details",
  -                         ap_server_argv0);
  +			 "Your kernel was built without CONFIG_SYSVIPC\n"
  +			 "%s: Please consult the Apache FAQ for details",
  +			 ap_server_argv0);
           }
   #endif
           ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  @@ -473,15 +473,15 @@
   	pad[i] = ' ';
       pad[i] = '\0';
   #ifdef SHARED_CORE
  -    fprintf(stderr, "Usage: %s [-L directory] [-d directory] [-f file]\n", bin);
  +    fprintf(stderr, "Usage: %s [-R directory] [-d directory] [-f file]\n", bin);
   #else
       fprintf(stderr, "Usage: %s [-d directory] [-f file]\n", bin);
   #endif
       fprintf(stderr, "       %s [-C \"directive\"] [-c \"directive\"]\n", pad);
  -    fprintf(stderr, "       %s [-v] [-V] [-h] [-l] [-S] [-t]\n", pad);
  +    fprintf(stderr, "       %s [-v] [-V] [-h] [-l] [-L] [-S] [-t]\n", pad);
       fprintf(stderr, "Options:\n");
   #ifdef SHARED_CORE
  -    fprintf(stderr, "  -L directory     : specify an alternate location for shared object files\n");
  +    fprintf(stderr, "  -R directory     : specify an alternate location for shared object files\n");
   #endif
       fprintf(stderr, "  -D name          : define a name for use in <IfDefine name> directives\n");
       fprintf(stderr, "  -d directory     : specify an alternate initial ServerRoot\n");
  @@ -490,8 +490,9 @@
       fprintf(stderr, "  -c \"directive\"   : process directive after  reading config files\n");
       fprintf(stderr, "  -v               : show version number\n");
       fprintf(stderr, "  -V               : show compile settings\n");
  -    fprintf(stderr, "  -h               : list available configuration directives\n");
  +    fprintf(stderr, "  -h               : list available command line options (this page)\n");
       fprintf(stderr, "  -l               : list compiled-in modules\n");
  +    fprintf(stderr, "  -L               : list available configuration directives\n");
       fprintf(stderr, "  -S               : show parsed settings (currently only vhost settings)\n");
       fprintf(stderr, "  -t               : run syntax test for configuration files only\n");
   #ifdef WIN32
  @@ -877,7 +878,7 @@
   static int volatile shutdown_pending;
   static int volatile restart_pending;
   static int volatile is_graceful;
  -static int volatile generation;
  +ap_generation_t volatile ap_my_generation;
   
   /*
    * ap_start_shutdown() and ap_start_restart(), below, are a first stab at
  @@ -2071,6 +2072,16 @@
   	clean_parent_exit(0);
       }
   
  +	/* advance to the next generation */
  +	/* XXX: we really need to make sure this new generation number isn't in
  +	 * use by any of the children.
  +	 */
  +	++ap_my_generation;
  +	ap_scoreboard_image->global.running_generation = ap_my_generation;
  +#ifdef HAVENTWRITENYET
  +	update_scoreboard_global();
  +#endif
  +
       if (is_graceful) {
   	int i;
   
  @@ -2120,7 +2131,7 @@
   
       do {
   	one_config_cycle();
  -        ++ap_scoreboard_image->global.exit_generation;
  +        ++ap_scoreboard_image->global.running_generation;
       } while (restart_pending);
   
       /*add_common_vars(NULL);*/
  @@ -2134,18 +2145,25 @@
       int c;
       int rc; /* ZZZZ */
       int configtestonly;
  +    char *s;
   
       MONCONTROL(0);
   
       common_init();
   
  -    ap_server_argv0 = argv[0];
  +    if ((s = strrchr(argv[0], '/')) != NULL) {
  +	ap_server_argv0 = ++s;
  +    }
  +    else {
  +	ap_server_argv0 = argv[0];
  +    }
  +    
       ap_cpystrn(ap_server_root, HTTPD_ROOT, sizeof(ap_server_root));
       ap_cpystrn(ap_server_confname, SERVER_CONFIG_FILE, sizeof(ap_server_confname));
       
       ap_setup_prelinked_modules();
       
  -    while ((c = getopt(argc, argv, "D:C:c:Xd:f:xVhlL:St"
  +    while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLR:Sth"
   #ifdef DEBUG_STOP
                          "Z:"
   #endif
  @@ -2179,12 +2197,12 @@
   	    ap_set_version();
   	    show_compile_settings();
   	    exit(0);
  -	case 'h':
  -	    ap_show_directives();
  -	    exit(0);
   	case 'l':
   	    ap_show_modules();
   	    exit(0);
  +	case 'L':
  +	    ap_show_directives();
  +	    exit(0);
   	case 'X':
   	    ++one_process;	/* Weird debugging mode. */
   	    break;
  @@ -2194,7 +2212,7 @@
   	    break;
   #endif
   #ifdef SHARED_CORE
  -	case 'L':
  +	case 'R':
   	    /* just ignore this option here, because it has only
   	     * effect when SHARED_CORE is used and then it was
   	     * already handled in the Shared Core Bootstrap
  @@ -2208,6 +2226,8 @@
   	case 't':
   	    configtestonly = 1;
   	    break;
  +	case 'h':
  +	    usage(argv[0]);
   	case '?':
   	    usage(argv[0]);
   	}
  
  
  
  1.4       +161 -41   apache-apr/pthreads/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_protocol.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -u -r1.3 -r1.4
  --- http_protocol.c	1999/02/05 07:55:24	1.3
  +++ http_protocol.c	1999/02/07 06:29:31	1.4
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -307,7 +307,7 @@
           (r->server->keep_alive_timeout > 0) &&
           ((r->server->keep_alive_max == 0) ||
            (r->server->keep_alive_max > r->connection->keepalives)) &&
  -        !status_drops_connection(r->status) &&
  +        !ap_status_drops_connection(r->status) &&
           !wimpy &&
           !ap_find_token(r->pool, conn, "close") &&
           (!ap_table_get(r->subprocess_env, "nokeepalive") ||
  @@ -408,7 +408,8 @@
        */
       if ((if_match = ap_table_get(r->headers_in, "If-Match")) != NULL) {
           if ((etag == NULL) ||
  -            ((if_match[0] != '*') && !ap_find_token(r->pool, if_match, etag))) {
  +            ((if_match[0] != '*')
  +	     && !ap_find_opaque_token(r->pool, if_match, etag))) {
               return HTTP_PRECONDITION_FAILED;
           }
       }
  @@ -443,7 +444,8 @@
           int rstatus;
   
           if ((if_nonematch[0] == '*')
  -            || ((etag != NULL) && ap_find_token(r->pool, if_nonematch, etag))) {
  +            || ((etag != NULL)
  +		&& ap_find_opaque_token(r->pool, if_nonematch, etag))) {
               rstatus = (r->method_number == M_GET) ? HTTP_NOT_MODIFIED
                                                     : HTTP_PRECONDITION_FAILED;
               return rstatus;
  @@ -478,7 +480,7 @@
    * could be modified again in as short an interval.  We rationalize the
    * modification time we're given to keep it from being in the future.
    */
  -API_EXPORT(void) ap_set_etag(request_rec *r)
  +API_EXPORT(char *) ap_make_etag(request_rec *r, int force_weak)
   {
       char *etag;
       char *weak;
  @@ -496,11 +498,11 @@
        * would be incorrect.
        */
       
  -    weak = (r->request_time - r->mtime > 1) ? "" : "W/";
  +    weak = ((r->request_time - r->mtime > 1) && !force_weak) ? "" : "W/";
   
       if (r->finfo.st_mode != 0) {
  -	etag = ap_psprintf(r->pool,
  -		    "%s\"%lx-%lx-%lx\"", weak,
  +        etag = ap_psprintf(r->pool,
  +                    "%s\"%lx-%lx-%lx\"", weak,
                       (unsigned long) r->finfo.st_ino,
                       (unsigned long) r->finfo.st_size,
                       (unsigned long) r->mtime);
  @@ -510,6 +512,50 @@
                       (unsigned long) r->mtime);
       }
   
  +    return etag;
  +}
  +
  +API_EXPORT(void) ap_set_etag(request_rec *r)
  +{
  +    char *etag;
  +    char *variant_etag, *vlv;
  +    int vlv_weak;
  +
  +    if (!r->vlist_validator) {
  +        etag = ap_make_etag(r, 0);
  +    }
  +    else {
  +        /* If we have a variant list validator (vlv) due to the
  +         * response being negotiated, then we create a structured
  +         * entity tag which merges the variant etag with the variant
  +         * list validator (vlv).  This merging makes revalidation
  +         * somewhat safer, ensures that caches which can deal with
  +         * Vary will (eventually) be updated if the set of variants is
  +         * changed, and is also a protocol requirement for transparent
  +         * content negotiation.
  +         */
  +
  +        /* if the variant list validator is weak, we make the whole
  +         * structured etag weak.  If we would not, then clients could
  +         * have problems merging range responses if we have different
  +         * variants with the same non-globally-unique strong etag.
  +         */
  +
  +        vlv = r->vlist_validator;
  +        vlv_weak = (vlv[0] == 'W');
  +               
  +        variant_etag = ap_make_etag(r, vlv_weak);
  +
  +        /* merge variant_etag and vlv into a structured etag */
  +
  +        variant_etag[strlen(variant_etag) - 1] = '\0';
  +        if (vlv_weak)
  +            vlv += 3;
  +        else
  +            vlv++;
  +        etag = ap_pstrcat(r->pool, variant_etag, ";", vlv, NULL);
  +    }
  +
       ap_table_setn(r->headers_out, "ETag", etag);
   }
   
  @@ -526,6 +572,72 @@
                 ap_gm_timestr_822(r->pool, mod_time));
   }
   
  +/* Get the method number associated with the given string, assumed to
  + * contain an HTTP method.  Returns M_INVALID if not recognized.
  + *
  + * This is the first step toward placing method names in a configurable
  + * list.  Hopefully it (and other routines) can eventually be moved to
  + * something like a mod_http_methods.c, complete with config stuff.
  + */
  +API_EXPORT(int) ap_method_number_of(const char *method)
  +{
  +    switch (*method) {
  +        case 'H':
  +           if (strcmp(method, "HEAD") == 0)
  +               return M_GET;   /* see header_only in request_rec */
  +           break;
  +        case 'G':
  +           if (strcmp(method, "GET") == 0)
  +               return M_GET;
  +           break;
  +        case 'P':
  +           if (strcmp(method, "POST") == 0)
  +               return M_POST;
  +           if (strcmp(method, "PUT") == 0)
  +               return M_PUT;
  +           if (strcmp(method, "PATCH") == 0)
  +               return M_PATCH;
  +           if (strcmp(method, "PROPFIND") == 0)
  +               return M_PROPFIND;
  +           if (strcmp(method, "PROPPATCH") == 0)
  +               return M_PROPPATCH;
  +           break;
  +        case 'D':
  +           if (strcmp(method, "DELETE") == 0)
  +               return M_DELETE;
  +           break;
  +        case 'C':
  +           if (strcmp(method, "CONNECT") == 0)
  +               return M_CONNECT;
  +           if (strcmp(method, "COPY") == 0)
  +               return M_COPY;
  +           break;
  +        case 'M':
  +           if (strcmp(method, "MKCOL") == 0)
  +               return M_MKCOL;
  +           if (strcmp(method, "MOVE") == 0)
  +               return M_MOVE;
  +           break;
  +        case 'O':
  +           if (strcmp(method, "OPTIONS") == 0)
  +               return M_OPTIONS;
  +           break;
  +        case 'T':
  +           if (strcmp(method, "TRACE") == 0)
  +               return M_TRACE;
  +           break;
  +        case 'L':
  +           if (strcmp(method, "LOCK") == 0)
  +               return M_LOCK;
  +           break;
  +        case 'U':
  +           if (strcmp(method, "UNLOCK") == 0)
  +               return M_UNLOCK;
  +           break;
  +    }
  +    return M_INVALID;
  +}
  +
   /* Get a line of protocol input, including any continuation lines
    * caused by MIME folding (or broken clients) if fold != 0, and place it
    * in the buffer s, of size n bytes, without the ending newline.
  @@ -693,26 +805,11 @@
       uri = ap_getword_white(r->pool, &ll);
   
       /* Provide quick information about the request method as soon as known */
  -    if (!strcmp(r->method, "HEAD")) {
  +
  +    r->method_number = ap_method_number_of(r->method);
  +    if (r->method_number == M_GET && r->method[0] == 'H') {
           r->header_only = 1;
  -        r->method_number = M_GET;
       }
  -    else if (!strcmp(r->method, "GET"))
  -        r->method_number = M_GET;
  -    else if (!strcmp(r->method, "POST"))
  -        r->method_number = M_POST;
  -    else if (!strcmp(r->method, "PUT"))
  -        r->method_number = M_PUT;
  -    else if (!strcmp(r->method, "DELETE"))
  -        r->method_number = M_DELETE;
  -    else if (!strcmp(r->method, "CONNECT"))
  -        r->method_number = M_CONNECT;
  -    else if (!strcmp(r->method, "OPTIONS"))
  -        r->method_number = M_OPTIONS;
  -    else if (!strcmp(r->method, "TRACE"))
  -        r->method_number = M_TRACE;
  -    else
  -        r->method_number = M_INVALID;   /* Will eventually croak. */
   
       ap_parse_uri(r, uri);
   
  @@ -1065,7 +1162,7 @@
    * and must be listed in order.
    */
   
  -static char *status_lines[] = {
  +static char *status_lines[RESPONSE_CODES] = {
       "100 Continue",
       "101 Switching Protocols",
       "102 Processing",
  @@ -1112,18 +1209,19 @@
       "421 unused",
       "422 Unprocessable Entity",
       "423 Locked",
  -#define LEVEL_500 43
  +    "424 Failed Dependency",
  +#define LEVEL_500 44
       "500 Internal Server Error",
       "501 Method Not Implemented",
       "502 Bad Gateway",
       "503 Service Temporarily Unavailable",
       "504 Gateway Time-out",
       "505 HTTP Version Not Supported",
  -    "506 Variant Also Negotiates"
  -    "507 unused",
  +    "506 Variant Also Negotiates",
  +    "507 Insufficient Storage",
       "508 unused",
       "509 unused",
  -    "510 Not Extended",
  +    "510 Not Extended"
   };
   
   /* The index is found by its offset from the x00 code of each level.
  @@ -1246,13 +1344,22 @@
   static char *make_allow(request_rec *r)
   {
       return 2 + ap_pstrcat(r->pool,
  -                       (r->allowed & (1 << M_GET)) ? ", GET, HEAD" : "",
  -                       (r->allowed & (1 << M_POST)) ? ", POST" : "",
  -                       (r->allowed & (1 << M_PUT)) ? ", PUT" : "",
  -                       (r->allowed & (1 << M_DELETE)) ? ", DELETE" : "",
  -                       (r->allowed & (1 << M_OPTIONS)) ? ", OPTIONS" : "",
  -                       ", TRACE",
  -                       NULL);
  +                   (r->allowed & (1 << M_GET))       ? ", GET, HEAD" : "",
  +                   (r->allowed & (1 << M_POST))      ? ", POST"      : "",
  +                   (r->allowed & (1 << M_PUT))       ? ", PUT"       : "",
  +                   (r->allowed & (1 << M_DELETE))    ? ", DELETE"    : "",
  +                   (r->allowed & (1 << M_CONNECT))   ? ", CONNECT"   : "",
  +                   (r->allowed & (1 << M_OPTIONS))   ? ", OPTIONS"   : "",
  +                   (r->allowed & (1 << M_PATCH))     ? ", PATCH"     : "",
  +                   (r->allowed & (1 << M_PROPFIND))  ? ", PROPFIND"  : "",
  +                   (r->allowed & (1 << M_PROPPATCH)) ? ", PROPPATCH" : "",
  +                   (r->allowed & (1 << M_MKCOL))     ? ", MKCOL"     : "",
  +                   (r->allowed & (1 << M_COPY))      ? ", COPY"      : "",
  +                   (r->allowed & (1 << M_MOVE))      ? ", MOVE"      : "",
  +                   (r->allowed & (1 << M_LOCK))      ? ", LOCK"      : "",
  +                   (r->allowed & (1 << M_UNLOCK))    ? ", UNLOCK"    : "",
  +                   ", TRACE",
  +                   NULL);
   }
   
   API_EXPORT(int) ap_send_http_trace(request_rec *r)
  @@ -2293,9 +2400,10 @@
   	    ap_bputs("response from an upstream server.<P>\015\012", fd);
   	    break;
   	case VARIANT_ALSO_VARIES:
  -	    ap_bvputs(fd, "A variant for the requested entity  ",
  -		      ap_escape_html(r->pool, r->uri), " is itself a ",
  -		      "transparently negotiable resource.<P>\n", NULL);
  +	    ap_bvputs(fd, "A variant for the requested resource\n<PRE>\n",
  +		      ap_escape_html(r->pool, r->uri),
  +		      "\n</PRE>\nis itself a negotiable resource. "
  +		      "This indicates a configuration error.<P>\n", NULL);
   	    break;
   	case HTTP_REQUEST_TIME_OUT:
   	    ap_bputs("I'm tired of waiting for your request.\n", fd);
  @@ -2348,6 +2456,18 @@
   	    ap_bputs("The requested resource is currently locked.\n"
   	             "The lock must be released or proper identification\n"
   	             "given before the method can be applied.\n", fd);
  +	    break;
  +	case HTTP_FAILED_DEPENDENCY:
  +	    ap_bputs("The method could not be performed on the resource\n"
  +	             "because the requested action depended on another\n"
  +	             "action and that other action failed.\n", fd);
  +	    break;
  +	case HTTP_INSUFFICIENT_STORAGE:
  +	    ap_bputs("The method could not be performed on the resource\n"
  +	             "because the server is unable to store the\n"
  +	             "representation needed to successfully complete the\n"
  +	             "request.  There is insufficient free space left in\n"
  +	             "your storage allocation.\n", fd);
   	    break;
   	case HTTP_SERVICE_UNAVAILABLE:
   	    ap_bputs("The server is temporarily unable to service your\n"
  
  
  
  1.2       +50 -19    apache-apr/pthreads/src/main/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_request.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- http_request.c	1999/01/21 23:08:33	1.1
  +++ http_request.c	1999/02/07 06:29:31	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -181,7 +181,6 @@
       char *last_cp = NULL;
       int rv;
   #ifdef WIN32
  -    char buf[5];
       BOOL bStripSlash=TRUE;
   #endif
   
  @@ -191,16 +190,12 @@
       }
   
   #ifdef WIN32
  -    /* If the path is x:/, then convert it to x:/., coz that's what stat
  -     * needs to work properly
  +    /* If the directory is x:\, then we don't want to strip
  +     * the trailing slash since x: is not a valid directory.
        */
  -    if (strlen(path) == 3 && path[1] == ':') {
  -	strcpy(buf,path);
  -	buf[3]='.';
  -	buf[4]='\0';
  -	path=buf;
  -	end=buf+4;
  -    }
  +    if (strlen(path) == 3 && path[1] == ':' && path[2] == '/')
  +        bStripSlash = FALSE;
  +
   
       /* If UNC name == //machine/share/, do not 
        * advance over the trailing slash.  Any other
  @@ -236,9 +231,22 @@
   
           *cp = '\0';
   
  -        errno = 0;
  -	/* ZZZ change to AP func for File Info */
  -        rv = stat(path, &r->finfo);
  +         /* We must not stat() filenames that may cause os-specific system
  +          * problems, such as "/file/aux" on DOS-abused filesystems.
  +          * So pretend that they do not exist by returning an ENOENT error.
  +          * This will force us to drop that part of the path and keep
  +          * looking back for a "real" file that exists, while still allowing
  +          * the "invalid" path parts within the PATH_INFO.
  +          */
  +         if (!ap_os_is_filename_valid(path)) {
  +             errno = ENOENT;
  +             rv = -1;
  +         }
  +         else {
  +             errno = 0;
  +	     /* ZZZ change to AP func for File Info */
  +             rv = stat(path, &r->finfo);
  +         }
   
           if (cp != end)
               *cp = '/';
  @@ -320,7 +328,7 @@
       char *test_filename;
       char *test_dirname;
       int res;
  -    unsigned i, num_dirs;
  +    unsigned i, num_dirs, iStart;
       int j, test_filename_len;
   
       /*
  @@ -400,6 +408,12 @@
       ap_no2slash(test_filename);
       num_dirs = ap_count_dirs(test_filename);
   
  +    if (!ap_os_is_filename_valid(r->filename)) {
  +        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  +                      "Filename is not valid: %s", r->filename);
  +        return HTTP_FORBIDDEN;
  +    }
  +
       if ((res = check_safe_file(r))) {
           return res;
       }
  @@ -421,9 +435,18 @@
        */
       test_dirname = ap_palloc(r->pool, test_filename_len + 2);
   
  +    iStart = 1;
  +#ifdef WIN32
  +    /* If the name is a UNC name, then do not walk through the
  +     * machine and share name (e.g. \\machine\share\)
  +     */
  +    if (num_dirs > 3 && test_filename[0] == '/' && test_filename[1] == '/')
  +        iStart = 4;
  +#endif
  +
       /* j keeps track of which section we're on, see core_reorder_directories */
       j = 0;
  -    for (i = 1; i <= num_dirs; ++i) {
  +    for (i = iStart; i <= num_dirs; ++i) {
           int overrides_here;
           core_dir_config *core_dir = (core_dir_config *)
               ap_get_module_config(per_dir_defaults, &core_module);
  @@ -723,7 +746,7 @@
           ap_parse_uri(rnew, new_file);
       else {
           udir = ap_make_dirstr_parent(rnew->pool, r->uri);
  -        udir = escape_uri(rnew->pool, udir);    /* re-escape it */
  +        udir = ap_escape_uri(rnew->pool, udir);    /* re-escape it */
           ap_parse_uri(rnew, ap_make_full_path(rnew->pool, udir, new_file));
       }
   
  @@ -809,7 +832,7 @@
   
           rnew->uri = ap_make_full_path(rnew->pool, udir, new_file);
           rnew->filename = ap_make_full_path(rnew->pool, fdir, new_file);
  -	ap_parse_uri(rnew, rnew->uri);    /* fill in parsed_uri values */
  +        ap_parse_uri(rnew, rnew->uri);    /* fill in parsed_uri values */
   
   	/* ZZZ use AP funcs to get File Info */
           if (stat(rnew->filename, &rnew->finfo) < 0) {
  @@ -898,7 +921,14 @@
   
   API_EXPORT(int) ap_run_sub_req(request_rec *r)
   {
  +#ifndef CHARSET_EBCDIC
       int retval = ap_invoke_handler(r);
  +#else /*CHARSET_EBCDIC*/
  +    /* Save the EBCDIC conversion setting of the caller across subrequests */
  +    int convert = ap_bgetflag(r->connection->client, B_EBCDIC2ASCII);
  +    int retval  = ap_invoke_handler(r);
  +    ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert);
  +#endif /*CHARSET_EBCDIC*/
       ap_finalize_sub_req_protocol(r);
       return retval;
   }
  @@ -958,7 +988,7 @@
        * (if any) has been read.
        */
       if ((r->status != HTTP_NOT_MODIFIED) && (r->status != HTTP_NO_CONTENT)
  -        && !status_drops_connection(r->status)
  +        && !ap_status_drops_connection(r->status)
           && r->connection && (r->connection->keepalive != -1)) {
   
           (void) ap_discard_request_body(r);
  @@ -1279,6 +1309,7 @@
       new->no_cache        = r->no_cache;
       new->no_local_copy   = r->no_local_copy;
       new->read_length     = r->read_length;     /* We can only read it once */
  +    new->vlist_validator = r->vlist_validator;
   
       ap_table_setn(new->subprocess_env, "REDIRECT_STATUS",
   	ap_psprintf(r->pool, "%d", r->status));
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/main/http_vhost.c
  
  Index: http_vhost.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_vhost.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- http_vhost.c	1999/01/21 23:08:33	1.1
  +++ http_vhost.c	1999/02/07 06:29:31	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/main/rfc1413.c
  
  Index: rfc1413.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/rfc1413.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- rfc1413.c	1999/01/21 23:08:33	1.1
  +++ rfc1413.c	1999/02/07 06:29:32	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +84 -5     apache-apr/pthreads/src/main/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/util.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- util.c	1999/01/21 23:08:34	1.1
  +++ util.c	1999/02/07 06:29:32	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -214,7 +214,15 @@
   }
   #endif
   
  +/* Roy owes Rob beer. */
  +/* Rob owes Roy dinner. */
   
  +/* These legacy comments would make a lot more sense if Roy hadn't
  + * replaced the old later_than() routine with util_date.c.
  + *
  + * Well, okay, they still wouldn't make any sense.
  + */
  +
   /* Match = 0, NoMatch = 1, Abort = -1
    * Based loosely on sections of wildmat.c by Rich Salz
    * Hmmm... shouldn't this really go component by component?
  @@ -757,6 +765,14 @@
           return NULL;
       }
   
  +    if (!ap_os_is_filename_valid(name)) {
  +        ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, NULL,
  +                    "Access to config file %s denied: not a valid filename",
  +                    name);
  +	errno = EACCES;
  +        return NULL;
  +    }
  + 
       /* ZZZ bopenf and use AP defines for flags. */
       file = ap_pfopen(p, name, "r");
   #ifdef DEBUG
  @@ -1046,7 +1062,68 @@
       }
   }
   
  +/*
  + * Find opaque HTTP tokens, which have no internal semantics and end
  + * at the first unquoted ',' or ' '.
  + */
  +API_EXPORT(int) ap_find_opaque_token(pool *p, const char *line,
  +				     const char *tok)
  +{
  +    const unsigned char *start_token;
  +    const unsigned char *s;
  +    char stop_quote = '\0';
  +
  +    if (!line) {
  +	return 0;
  +    }
   
  +    s = (const unsigned char *)line;
  +    for (;;) {
  +	/* 
  +	 * Find start of token, skip all stop characters, note NUL
  +	 * isn't a token stop, so we don't need to test for it
  +	 */
  +	while (TEST_CHAR(*s, T_HTTP_OPAQUETOKEN_STOP)) {
  +	    ++s;
  +	}
  +	if (!*s) {
  +	    return 0;
  +	}
  +	start_token = s;
  +	/* 
  +	 * Find end of the token 
  +	 */
  +	while (*s) {
  +	    /*
  +	     * If we see the beginning of a quoted string ("foo" or <foo>),
  +	     * mark the end character so we know when to stop skipping.
  +	     */
  +	    if (!stop_quote && ((*s == '"') || (*s == '<'))) {
  +		stop_quote = (*s == '"') ? '"' : '>';
  +	    }
  +	    else if (*s == stop_quote) {
  +		stop_quote = '\0';
  +	    }
  +	    /*
  +	     * If we're not inside a quoted string, check to see if we're
  +	     * at the end of the token.
  +	     */
  +	    else if (!stop_quote && TEST_CHAR(*s, T_HTTP_OPAQUETOKEN_STOP)) {
  +		break;
  +	    }
  +	    ++s;
  +	}
  +	if (!strncmp((const char *)start_token, (const char *)tok,
  +		     s - start_token)) {
  +	    return 1;
  +	}
  +	if (!*s) {
  +	    return 0;
  +	}
  +    }
  +}
  +
  +
   API_EXPORT(int) ap_find_last_token(pool *p, const char *line, const char *tok)
   {
       int llen, tlen, lidx;
  @@ -1250,7 +1327,7 @@
       return copy;
   }
   
  -/* escape_uri is now a macro for os_escape_path */
  +/* ap_escape_uri is now a macro for os_escape_path */
   
   API_EXPORT(char *) ap_escape_html(pool *p, const char *s)
   {
  @@ -1533,7 +1610,7 @@
   	return (atoi(&name[1]));
   
       if (!(ent = getpwnam(name))) {
  -	fprintf(stderr, "httpd: bad user name %s\n", name);
  +	fprintf(stderr, "%s: bad user name %s\n", ap_server_argv0, name);
   	exit(1);
       }
       return (ent->pw_uid);
  @@ -1551,7 +1628,7 @@
   	return (atoi(&name[1]));
   
       if (!(ent = getgrnam(name))) {
  -	fprintf(stderr, "httpd: bad group name %s\n", name);
  +	fprintf(stderr, "%s: bad group name %s\n", ap_server_argv0, name);
   	exit(1);
       }
       return (ent->gr_gid);
  @@ -1644,7 +1721,8 @@
       }
       str[MAXHOSTNAMELEN] = '\0';
       if ((!(p = gethostbyname(str))) || (!(server_hostname = find_fqdn(a, p)))) {
  -	fprintf(stderr, "httpd: cannot determine local host name.\n");
  +	fprintf(stderr, "%s: cannot determine local host name.\n",
  +		ap_server_argv0);
   	fprintf(stderr, "Use the ServerName directive to set it manually.\n");
   	exit(1);
       }
  @@ -1868,6 +1946,7 @@
   	 */
   	if ((*inchr == '\\') && (inchr[1] != '\0')) {
   	    inchr++;
  +	    newlen++;
   	}
   	inchr++;
       }
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/main/util_date.c
  
  Index: util_date.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/util_date.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- util_date.c	1999/01/21 23:08:34	1.1
  +++ util_date.c	1999/02/07 06:29:32	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +6 -3      apache-apr/pthreads/src/main/util_md5.c
  
  Index: util_md5.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/util_md5.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- util_md5.c	1999/01/21 23:08:34	1.1
  +++ util_md5.c	1999/02/07 06:29:32	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -89,6 +89,7 @@
   
   API_EXPORT(char *) ap_md5_binary(pool *p, const unsigned char *buf, int length)
   {
  +    const char *hex = "0123456789abcdef";
       AP_MD5_CTX my_md5;
       unsigned char hash[16];
       char *r, result[33];
  @@ -102,8 +103,10 @@
       ap_MD5Update(&my_md5, buf, length);
       ap_MD5Final(hash, &my_md5);
   
  -    for (i = 0, r = result; i < 16; i++, r += 2)
  -	sprintf(r, "%02x", hash[i]);
  +    for (i = 0, r = result; i < 16; i++) {
  +	*r++ = hex[hash[i] >> 4];
  +	*r++ = hex[hash[i] & 0xF];
  +    }
       *r = '\0';
   
       return ap_pstrdup(p, result);
  
  
  
  1.2       +105 -202  apache-apr/pthreads/src/main/util_script.c
  
  Index: util_script.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/util_script.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- util_script.c	1999/01/21 23:08:34	1.1
  +++ util_script.c	1999/02/07 06:29:32	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -396,7 +396,7 @@
   	 */
   	request_rec *pa_req;
   
  -	pa_req = ap_sub_req_lookup_uri(escape_uri(r->pool, r->path_info), r);
  +	pa_req = ap_sub_req_lookup_uri(ap_escape_uri(r->pool, r->path_info), r);
   
   	if (pa_req->filename) {
   #ifdef WIN32
  @@ -818,31 +818,31 @@
       }
   #elif defined(WIN32)
       {
  -	/* Adapted from Alec Kloss' work for OS/2 */
  -	int is_script = 0;
  -	int is_binary = 0;
  -	char interpreter[2048];	/* hope it's enough for the interpreter path */
  -	FILE *program;
  -	int i, sz;
  -	char *dot;
  -	char *exename;
  +        /* Adapted from Alec Kloss' work for OS/2 */
  +        char *interpreter = NULL;
  +        char *arguments = NULL;
  +        char *ext = NULL;
  +        char *exename = NULL;
  +        char *s = NULL;
           char *quoted_filename;
  -	int is_exe = 0;
  -	STARTUPINFO si;
  -	PROCESS_INFORMATION pi;
           char *pCommand;
           char *pEnvBlock, *pNext;
  +
  +        int i;
           int iEnvBlockLen;
   
  -	memset(&si, 0, sizeof(si));
  -	memset(&pi, 0, sizeof(pi));
  +        file_type_e fileType;
   
  -	interpreter[0] = 0;
  -	pid = -1;
  +        STARTUPINFO si;
  +        PROCESS_INFORMATION pi;
   
  -        quoted_filename = ap_pstrcat(r->pool, "\"", r->filename, "\"", NULL);
  +        memset(&si, 0, sizeof(si));
  +        memset(&pi, 0, sizeof(pi));
   
  +        pid = -1;
  +
           if (!shellcmd) {
  +            /* Find the file name */
               exename = strrchr(r->filename, '/');
               if (!exename) {
                   exename = strrchr(r->filename, '\\');
  @@ -853,66 +853,88 @@
               else {
                   exename++;
               }
  -            dot = strrchr(exename, '.');
  -            if (dot) {
  -                if (!strcasecmp(dot, ".BAT")
  -                    || !strcasecmp(dot, ".CMD")
  -                    || !strcasecmp(dot, ".EXE")
  -                    ||  !strcasecmp(dot, ".COM")) {
  -                    is_exe = 1;
  -                }
  +
  +            ext = strrchr(exename, '.');
  +            if ((ext) && (!strcasecmp(ext,".bat") ||
  +                          !strcasecmp(ext,".cmd"))) {
  +                fileType = FileTypeEXE;
  +            }
  +            else if ((ext) && (!strcasecmp(ext,".exe") ||
  +                               !strcasecmp(ext,".com"))) {
  +                /* 16 bit or 32 bit? */
  +                fileType = FileTypeEXE;
               }
  +            else {
  +                /* Maybe a script or maybe a binary.. */
  +                fileType = ap_get_win32_interpreter(r, ext, &interpreter);
  +            }
   
  -            if (!is_exe) {
  -                program = fopen(r->filename, "rb");
  -                if (!program) {
  -                    ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
  -                                 "fopen(%s) failed", r->filename);
  -                    return (pid);
  -                }
  -                sz = fread(interpreter, 1, sizeof(interpreter) - 1, program);
  -                if (sz < 0) {
  -                    ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
  -                                 "fread of %s failed", r->filename);
  -                    fclose(program);
  -                    return (pid);
  -                }
  -                interpreter[sz] = 0;
  -                fclose(program);
  -                if (!strncmp(interpreter, "#!", 2)) {
  -                    is_script = 1;
  -                    for (i = 2; i < sizeof(interpreter); i++) {
  -                        if ((interpreter[i] == '\r')
  -                            || (interpreter[i] == '\n')) {
  -                            break;
  -                        }
  -                    }
  -                    interpreter[i] = 0;
  -                    for (i = 2; interpreter[i] == ' '; ++i)
  -                        ;
  -                    memmove(interpreter+2,interpreter+i,strlen(interpreter+i)+1);
  -                }
  -                else {
  -                    /* Check to see if it's a executable */
  -                    IMAGE_DOS_HEADER *hdr = (IMAGE_DOS_HEADER*)interpreter;
  -                    if (hdr->e_magic == IMAGE_DOS_SIGNATURE && hdr->e_cblp < 512) {
  -                        is_binary = 1;
  +            if (fileType == FileTypeUNKNOWN) {
  +                ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r,
  +                              "%s is not executable; ensure interpreted scripts have "
  +                              "\"#!\" first line", 
  +                              r->filename);
  +                return (pid);
  +            }
  +
  +            /*
  +             * Look at the arguments...
  +             */
  +            arguments = "";
  +            if ((r->args) && (r->args[0]) && !strchr(r->args, '=')) { 
  +                /* If we are in this leg, there are some other arguments
  +                 * that we must include in the execution of the CGI.
  +                 * Because CreateProcess is the way it is, we have to
  +                 * create a command line like format for the execution
  +                 * of the CGI.  This means we need to create on long
  +                 * string with the executable and arguments.
  +                 *
  +                 * The arguments string comes in the request structure,
  +                 * and each argument is separated by a '+'.  We'll replace
  +                 * these pluses with spaces.
  +                 */
  +
  +                int iStringSize = 0;
  +                int x;
  +	    
  +                /*
  +                 *  Duplicate the request structure string so we don't change it.
  +                 */                                   
  +                arguments = ap_pstrdup(r->pool, r->args);
  +                
  +                /*
  +                 *  Change the '+' to ' '
  +                 */
  +                for (x=0; arguments[x]; x++) {
  +                    if ('+' == arguments[x]) {
  +                        arguments[x] = ' ';
                       }
                   }
  +       
  +                /*
  +                 * We need to unescape any characters that are 
  +                 * in the arguments list.
  +                 */
  +                ap_unescape_url(arguments);
  +                arguments = ap_escape_shell_cmd(r->pool, arguments);
               }
  -            /* Bail out if we haven't figured out what kind of
  -             * file this is by now..
  +
  +            /*
  +             * We have the interpreter (if there is one) and we have 
  +             * the arguments (if there are any).
  +             * Build the command string to pass to CreateProcess. 
                */
  -            if (!is_exe && !is_script && !is_binary) {
  -                ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r,
  -                             "%s is not executable; ensure interpreted scripts have "
  -                             "\"#!\" first line", 
  -                             r->filename);
  -                return (pid);
  +            quoted_filename = ap_pstrcat(r->pool, "\"", r->filename, "\"", NULL);
  +            if (interpreter && *interpreter) {
  +                pCommand = ap_pstrcat(r->pool, interpreter, " ", 
  +                                      quoted_filename, " ", arguments, NULL);
               }
  -        }
  +            else {
  +                pCommand = ap_pstrcat(r->pool, quoted_filename, " ", arguments, NULL);
  +            }
  +
  +         } else {
   
  -        if (shellcmd) {
               char *shell_cmd = "CMD.EXE /C ";
               OSVERSIONINFO osver;
               osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  @@ -927,96 +949,17 @@
               }       
               pCommand = ap_pstrcat(r->pool, shell_cmd, argv0, NULL);
           }
  - 	else if ((!r->args) || (!r->args[0]) || strchr(r->args, '=')) { 
  -	    if (is_exe || is_binary) {
  -	        /*
  -	         * When the CGI is a straight binary executable, 
  -		 * we can run it as is
  -	         */
  -	        pCommand = quoted_filename;
  -	    }
  -	    else if (is_script) {
  -                /* When an interpreter is needed, we need to create 
  -                 * a command line that has the interpreter name
  -                 * followed by the CGI script name.  
  -		 */
  -	        pCommand = ap_pstrcat(r->pool, interpreter + 2, " ", 
  -				      quoted_filename, NULL);
  -	    }
  -	    else {
  -	        /* If not an executable or script, just execute it
  -                 * from a command prompt.  
  -                 */
  -	        pCommand = ap_pstrcat(r->pool, SHELL_PATH, " /C ", 
  -				      quoted_filename, NULL);
  -	    }
  -	}
  -	else {
   
  -            /* If we are in this leg, there are some other arguments
  -             * that we must include in the execution of the CGI.
  -             * Because CreateProcess is the way it is, we have to
  -             * create a command line like format for the execution
  -             * of the CGI.  This means we need to create on long
  -             * string with the executable and arguments.
  -             *
  -             * The arguments string comes in the request structure,
  -             * and each argument is separated by a '+'.  We'll replace
  -             * these pluses with spaces.
  -	     */
  -	    char *arguments=NULL;
  -	    int iStringSize = 0;
  -	    int x;
  -	    
  -	    /*
  -	     *  Duplicate the request structure string so we don't change it.
  -	     */                                   
  -	    arguments = ap_pstrdup(r->pool, r->args);
  -       
  -	    /*
  -	     *  Change the '+' to ' '
  -	     */
  -	    for (x=0; arguments[x]; x++) {
  -	        if ('+' == arguments[x]) {
  -		  arguments[x] = ' ';
  -		}
  -	    }
  -       
  -	    /*
  -	     * We need to unescape any characters that are 
  -             * in the arguments list.
  -	     */
  -	    ap_unescape_url(arguments);
  -	    arguments = ap_escape_shell_cmd(r->pool, arguments);
  -           
  -	    /*
  -	     * The argument list should now be good to use, 
  -	     * so now build the command line.
  -	     */
  -	    if (is_exe || is_binary) {
  -	        pCommand = ap_pstrcat(r->pool, quoted_filename, " ", 
  -				      arguments, NULL);
  -	    }
  -	    else if (is_script) {
  -	        pCommand = ap_pstrcat(r->pool, interpreter + 2, " ", 
  -				      quoted_filename, " ", arguments, NULL);
  -	    }
  -	    else {
  -	        pCommand = ap_pstrcat(r->pool, SHELL_PATH, " /C ", 
  -				      quoted_filename, " ", arguments, NULL);
  -	    }
  -	}
  -
  -	/*
  -	 * Make child process use hPipeOutputWrite as standard out,
  -	 * and make sure it does not show on screen.
  -	 */
  -	si.cb = sizeof(si);
  -	si.dwFlags     = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
  -	si.wShowWindow = SW_HIDE;
  -	si.hStdInput   = pinfo->hPipeInputRead;
  -	si.hStdOutput  = pinfo->hPipeOutputWrite;
  -	si.hStdError   = pinfo->hPipeErrorWrite;
  +        /*
  +         * Make child process use hPipeOutputWrite as standard out,
  +         * and make sure it does not show on screen.
  +         */
  +        si.cb = sizeof(si);
  +        si.dwFlags     = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
  +        si.wShowWindow = SW_HIDE;
  +        si.hStdInput   = pinfo->hPipeInputRead;
  +        si.hStdOutput  = pinfo->hPipeOutputWrite;
  +        si.hStdError   = pinfo->hPipeErrorWrite;
     
           /*
            * Win32's CreateProcess call requires that the environment
  @@ -1050,50 +993,10 @@
                */ 
               CloseHandle(pi.hProcess);
               CloseHandle(pi.hThread);
  -        } else {
  -	    if (is_script) {
  -		/* since we are doing magic to find what we are executing
  -		 * if running a script, log what we think we should have
  -		 * executed
  -		 */
  -		ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, r,
  -			     "could not run script interpreter: %s", pCommand);
  -	    }
  -	}
  -#if 0
  -	if ((!r->args) || (!r->args[0]) || strchr(r->args, '=')) {
  -	    if (is_exe || is_binary) {
  -		pid = spawnle(_P_NOWAIT, r->filename, r->filename, NULL, env);
  -	    }
  -	    else if (is_script) {
  -		pid = spawnle(_P_NOWAIT, interpreter + 2, interpreter + 2,
  -			      r->filename, NULL, env);
  -	    }
  -	    else {
  -		pid = spawnle(_P_NOWAIT, SHELL_PATH, SHELL_PATH, "/C",
  -			      r->filename, NULL, env);
  -	    }
  -	}
  -	else {
  -	    if (is_exe || is_binary) {
  -		pid = spawnve(_P_NOWAIT, r->filename,
  -			      create_argv(r->pool, NULL, NULL, NULL, argv0, 
  -					  r->args), env);
  -	    }
  -	    else if (is_script) {
  -		pid = spawnve(_P_NOWAIT, interpreter + 2,
  -			      create_argv(r->pool, interpreter + 2, NULL, NULL,
  -					  r->filename, r->args), env);
  -	    }
  -	    else {
  -		pid = spawnve(_P_NOWAIT, SHELL_PATH,
  -			      create_argv_cmd(r->pool, argv0, r->args,
  -					      r->filename), env);
  -	    }
  -	}
  -#endif
  -	return (pid);
  +        }
  +        return (pid);
       }
  +
   #else
       if (ap_suexec_enabled
   	&& ((r->server->server_uid != ap_user_id)
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/main/util_uri.c
  
  Index: util_uri.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/util_uri.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- util_uri.c	1999/01/21 23:08:34	1.1
  +++ util_uri.c	1999/02/07 06:29:32	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/example/mod_example.c
  
  Index: mod_example.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/example/mod_example.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_example.c	1999/01/21 23:08:34	1.1
  +++ mod_example.c	1999/02/07 06:29:45	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/experimental/mod_mmap_static.c
  
  Index: mod_mmap_static.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/experimental/mod_mmap_static.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_mmap_static.c	1999/01/21 23:08:35	1.1
  +++ mod_mmap_static.c	1999/02/07 06:29:46	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/proxy/mod_proxy.c
  
  Index: mod_proxy.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/mod_proxy.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_proxy.c	1999/01/21 23:08:35	1.1
  +++ mod_proxy.c	1999/02/07 06:29:47	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/mod_proxy.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_proxy.h	1999/01/21 23:08:35	1.1
  +++ mod_proxy.h	1999/02/07 06:29:47	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.3       +8 -4      apache-apr/pthreads/src/modules/proxy/proxy_cache.c
  
  Index: proxy_cache.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/proxy_cache.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- proxy_cache.c	1999/01/29 15:48:28	1.2
  +++ proxy_cache.c	1999/02/07 06:29:47	1.3
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -58,6 +58,7 @@
   /* Cache and garbage collection routines for Apache proxy */
   
   #include "mod_proxy.h"
  +#include "http_conf_globals.h"
   #include "http_log.h"
   #include "http_main.h"
   #include "util_date.h"
  @@ -227,19 +228,22 @@
   #ifndef NO_SETSID
   		    if ((pgrp = setsid()) == -1) {
   			perror("setsid");
  -			fprintf(stderr, "httpd: setsid failed\n");
  +			fprintf(stderr, "%s: setsid failed\n",
  +				ap_server_argv0);
   			exit(1);
   		    }
   #elif defined(NEXT) || defined(NEWSOS)
   		    if (setpgrp(0, getpid()) == -1 || (pgrp = getpgrp(0)) == -1) {
   			perror("setpgrp");
  -			fprintf(stderr, "httpd: setpgrp or getpgrp failed\n");
  +			fprintf(stderr, "%S: setpgrp or getpgrp failed\n",
  +				ap_server_argv0);
   			exit(1);
   		    }
   #else
   		    if ((pgrp = setpgrp(getpid(), 0)) == -1) {
   			perror("setpgrp");
  -			fprintf(stderr, "httpd: setpgrp failed\n");
  +			fprintf(stderr, "%s: setpgrp failed\n",
  +				ap_server_argv0);
   			exit(1);
   		    }
   #endif
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/proxy/proxy_connect.c
  
  Index: proxy_connect.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/proxy_connect.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- proxy_connect.c	1999/01/21 23:08:35	1.1
  +++ proxy_connect.c	1999/02/07 06:29:47	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/proxy/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/proxy_ftp.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- proxy_ftp.c	1999/01/21 23:08:35	1.1
  +++ proxy_ftp.c	1999/02/07 06:29:48	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/proxy/proxy_http.c
  
  Index: proxy_http.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/proxy_http.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- proxy_http.c	1999/01/21 23:08:35	1.1
  +++ proxy_http.c	1999/02/07 06:29:48	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +11 -8     apache-apr/pthreads/src/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/proxy_util.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- proxy_util.c	1999/01/21 23:08:37	1.1
  +++ proxy_util.c	1999/02/07 06:29:48	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -263,11 +263,14 @@
   	    if (!ap_isdigit(strp[i]))
   		break;
   
  -	if (i == 0 || strp[i] != '\0')
  +	/* if (i == 0) the no port was given; keep default */
  +	if (strp[i] != '\0') {
   	    return "Bad port number in URL";
  -	*port = atoi(strp);
  -	if (*port > 65535)
  -	    return "Port number in URL > 65535";
  +	} else if (i > 0) {
  +	    *port = atoi(strp);
  +	    if (*port > 65535)
  +		return "Port number in URL > 65535";
  +	}
       }
       ap_str_tolower(host);		/* DNS names are case-insensitive */
       if (*host == '\0')
  @@ -652,10 +655,10 @@
       return 0;
   }
   
  -#ifdef WIN32
  +#ifdef CASE_BLIND_FILESYSTEM
   
   /*
  - * On NT, the file system is NOT case sensitive. So, a == A
  + * On some platforms, the file system is NOT case sensitive. So, a == A
    * need to map to smaller set of characters
    */
   void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength)
  @@ -753,7 +756,7 @@
       val[i + 22 - k] = '\0';
   }
   
  -#endif /* WIN32 */
  +#endif /* CASE_BLIND_FILESYSTEM */
   
   /*
    * Converts 8 hex digits to a time integer
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_access.c
  
  Index: mod_access.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_access.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_access.c	1999/01/21 23:08:38	1.1
  +++ mod_access.c	1999/02/07 06:29:50	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +46 -49    apache-apr/pthreads/src/modules/standard/mod_actions.c
  
  Index: mod_actions.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_actions.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_actions.c	1999/01/21 23:08:38	1.1
  +++ mod_actions.c	1999/02/07 06:29:50	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -56,7 +56,7 @@
    */
   
   /*
  - * mod_actions.c: executes scripts based on MIME type
  + * mod_actions.c: executes scripts based on MIME type or HTTP method
    *
    * by Alexei Kosut; based on mod_cgi.c, mod_mime.c and mod_includes.c,
    * adapted by rst from original NCSA code by Rob McCool
  @@ -69,6 +69,12 @@
    * requested. It sends the URL and file path of the requested document using 
    * the standard CGI PATH_INFO and PATH_TRANSLATED environment variables.
    *
  + * Script PUT /cgi-bin/script
  + *
  + * will activate /cgi-bin/script when a request is received with the
  + * HTTP method "PUT".  The available method names are defined in httpd.h.
  + * If the method is GET, the script will only be activated if the requested
  + * URI includes query information (stuff after a ?-mark).
    */
   
   #include "httpd.h"
  @@ -81,11 +87,8 @@
   #include "util_script.h"
   
   typedef struct {
  -    table *action_types;	/* Added with Action... */
  -    char *get;			/* Added with Script GET */
  -    char *post;			/* Added with Script POST */
  -    char *put;			/* Added with Script PUT */
  -    char *delete;		/* Added with Script DELETE */
  +    table *action_types;       /* Added with Action... */
  +    char *scripted[METHODS];   /* Added with Script... */
   } action_dir_config;
   
   module action_module;
  @@ -96,10 +99,7 @@
       (action_dir_config *) ap_palloc(p, sizeof(action_dir_config));
   
       new->action_types = ap_make_table(p, 4);
  -    new->get = NULL;
  -    new->post = NULL;
  -    new->put = NULL;
  -    new->delete = NULL;
  +    memset(new->scripted, 0, sizeof(new->scripted));
   
       return new;
   }
  @@ -108,17 +108,17 @@
   {
       action_dir_config *base = (action_dir_config *) basev;
       action_dir_config *add = (action_dir_config *) addv;
  -    action_dir_config *new =
  -    (action_dir_config *) ap_palloc(p, sizeof(action_dir_config));
  +    action_dir_config *new = (action_dir_config *) ap_palloc(p,
  +                                  sizeof(action_dir_config));
  +    int i;
   
       new->action_types = ap_overlay_tables(p, add->action_types,
   				       base->action_types);
   
  -    new->get = add->get ? add->get : base->get;
  -    new->post = add->post ? add->post : base->post;
  -    new->put = add->put ? add->put : base->put;
  -    new->delete = add->delete ? add->delete : base->delete;
  -
  +    for (i = 0; i < METHODS; ++i) {
  +        new->scripted[i] = add->scripted[i] ? add->scripted[i]
  +                                            : base->scripted[i];
  +    }
       return new;
   }
   
  @@ -129,19 +129,18 @@
       return NULL;
   }
   
  -static const char *set_script(cmd_parms *cmd, action_dir_config * m, char *method,
  -			      char *script)
  +static const char *set_script(cmd_parms *cmd, action_dir_config * m,
  +                              char *method, char *script)
   {
  -    if (!strcmp(method, "GET"))
  -	m->get = script;
  -    else if (!strcmp(method, "POST"))
  -	m->post = script;
  -    else if (!strcmp(method, "PUT"))
  -	m->put = script;
  -    else if (!strcmp(method, "DELETE"))
  -	m->delete = script;
  +    int methnum;
  +
  +    methnum = ap_method_number_of(method);
  +    if (methnum == M_TRACE)
  +        return "TRACE not allowed for Script";
  +    else if (methnum == M_INVALID)
  +        return "Unknown method type for Script";
       else
  -	return "Unknown method type for Script";
  +        m->scripted[methnum] = script;
   
       return NULL;
   }
  @@ -157,30 +156,28 @@
   
   static int action_handler(request_rec *r)
   {
  -    action_dir_config *conf =
  -    (action_dir_config *) ap_get_module_config(r->per_dir_config, &action_module);
  +    action_dir_config *conf = (action_dir_config *)
  +        ap_get_module_config(r->per_dir_config, &action_module);
       const char *t, *action = r->handler ? r->handler : r->content_type;
  -    const char *script = NULL;
  +    const char *script;
  +    int i;
   
       /* Set allowed stuff */
  -    if (conf->get)
  -	r->allowed |= (1 << M_GET);
  -    if (conf->post)
  -	r->allowed |= (1 << M_POST);
  -    if (conf->put)
  -	r->allowed |= (1 << M_PUT);
  -    if (conf->delete)
  -	r->allowed |= (1 << M_DELETE);
  +    for (i = 0; i < METHODS; ++i) {
  +        if (conf->scripted[i])
  +            r->allowed |= (1 << i);
  +    }
   
       /* First, check for the method-handling scripts */
  -    if ((r->method_number == M_GET) && r->args && conf->get)
  -	script = conf->get;
  -    else if ((r->method_number == M_POST) && conf->post)
  -	script = conf->post;
  -    else if ((r->method_number == M_PUT) && conf->put)
  -	script = conf->put;
  -    else if ((r->method_number == M_DELETE) && conf->delete)
  -	script = conf->delete;
  +    if (r->method_number == M_GET) {
  +        if (r->args)
  +            script = conf->scripted[M_GET];
  +        else
  +            script = NULL;
  +    }
  +    else {
  +        script = conf->scripted[r->method_number];
  +    }
   
       /* Check for looping, which can happen if the CGI script isn't */
       if (script && r->prev && r->prev->prev)
  @@ -200,7 +197,7 @@
       if (script == NULL)
   	return DECLINED;
   
  -    ap_internal_redirect_handler(ap_pstrcat(r->pool, script, escape_uri(r->pool,
  +    ap_internal_redirect_handler(ap_pstrcat(r->pool, script, ap_escape_uri(r->pool,
   			  r->uri), r->args ? "?" : NULL, r->args, NULL), r);
       return OK;
   }
  
  
  
  1.2       +2 -2      apache-apr/pthreads/src/modules/standard/mod_alias.c
  
  Index: mod_alias.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_alias.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_alias.c	1999/01/21 23:08:38	1.1
  +++ mod_alias.c	1999/02/07 06:29:51	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -305,7 +305,7 @@
   		    found = ap_pregsub(r->pool, p->real, r->uri,
   				    p->regexp->re_nsub + 1, regm);
   		    if (found && doesc) {
  -			found = escape_uri(r->pool, found);
  +			found = ap_escape_uri(r->pool, found);
   		    }
   		}
   		else {
  
  
  
  1.3       +2 -2      apache-apr/pthreads/src/modules/standard/mod_asis.c
  
  Index: mod_asis.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_asis.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- mod_asis.c	1999/01/22 17:10:28	1.2
  +++ mod_asis.c	1999/02/07 06:29:51	1.3
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -85,7 +85,7 @@
   	return FORBIDDEN;
       }
   
  -    scan_script_header(r, f);
  +    ap_scan_script_header_err(r, f, NULL);
       location = ap_table_get(r->headers_out, "Location");
   
       if (location && location[0] == '/' &&
  
  
  
  1.2       +7 -7      apache-apr/pthreads/src/modules/standard/mod_auth.c
  
  Index: mod_auth.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_auth.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_auth.c	1999/01/21 23:08:38	1.1
  +++ mod_auth.c	1999/02/07 06:29:51	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -74,9 +74,7 @@
   #include "http_core.h"
   #include "http_log.h"
   #include "http_protocol.h"
  -#if defined(HAVE_CRYPT_H)
  -#include <crypt.h>
  -#endif
  +#include "ap_md5.h"
   
   typedef struct auth_config_struct {
       char *auth_pwfile;
  @@ -203,6 +201,7 @@
       conn_rec *c = r->connection;
       const char *sent_pw;
       char *real_pw;
  +    char *invalid_pw;
       int res;
   
       if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
  @@ -219,10 +218,11 @@
   	ap_note_basic_auth_failure(r);
   	return AUTH_REQUIRED;
       }
  -    /* anyone know where the prototype for crypt is? */
  -    if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw))) {
  +    invalid_pw = ap_validate_password(sent_pw, real_pw);
  +    if (invalid_pw != NULL) {
   	ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -		    "user %s: password mismatch: %s", c->user, r->uri);
  +		      "user %s: authentication failure for \"%s\": %s",
  +		      c->user, r->uri, invalid_pw);
   	ap_note_basic_auth_failure(r);
   	return AUTH_REQUIRED;
       }
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_auth_anon.c
  
  Index: mod_auth_anon.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_auth_anon.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_auth_anon.c	1999/01/21 23:08:38	1.1
  +++ mod_auth_anon.c	1999/02/07 06:29:51	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +9 -5      apache-apr/pthreads/src/modules/standard/mod_auth_db.c
  
  Index: mod_auth_db.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_auth_db.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_auth_db.c	1999/01/21 23:08:38	1.1
  +++ mod_auth_db.c	1999/02/07 06:29:51	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -96,6 +96,7 @@
   #include "http_log.h"
   #include "http_protocol.h"
   #include <db.h>
  +#include "ap_md5.h"
   
   #if defined(DB_VERSION_MAJOR) && (DB_VERSION_MAJOR == 2)
   #define DB2
  @@ -226,6 +227,7 @@
       conn_rec *c = r->connection;
       const char *sent_pw;
       char *real_pw, *colon_pw;
  +    char *invalid_pw;
       int res;
   
       if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
  @@ -244,12 +246,14 @@
       }
       /* Password is up to first : if exists */
       colon_pw = strchr(real_pw, ':');
  -    if (colon_pw)
  +    if (colon_pw) {
   	*colon_pw = '\0';
  -    /* anyone know where the prototype for crypt is? */
  -    if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw))) {
  +    }
  +    invalid_pw = ap_validate_password(sent_pw, real_pw);
  +    if (invalid_pw != NULL) {
   	ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -		    "DB user %s: password mismatch: %s", c->user, r->uri);
  +		      "DB user %s: authentication failure for \"%s\": %s",
  +		      c->user, r->uri, invalid_pw);
   	ap_note_basic_auth_failure(r);
   	return AUTH_REQUIRED;
       }
  
  
  
  1.2       +9 -5      apache-apr/pthreads/src/modules/standard/mod_auth_dbm.c
  
  Index: mod_auth_dbm.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_auth_dbm.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_auth_dbm.c	1999/01/21 23:08:38	1.1
  +++ mod_auth_dbm.c	1999/02/07 06:29:51	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -75,6 +75,7 @@
   #include "http_log.h"
   #include "http_protocol.h"
   #include <ndbm.h>
  +#include "ap_md5.h"
   
   /*
    * Module definition information - the part between the -START and -END
  @@ -208,6 +209,7 @@
       conn_rec *c = r->connection;
       const char *sent_pw;
       char *real_pw, *colon_pw;
  +    char *invalid_pw;
       int res;
   
       if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
  @@ -226,12 +228,14 @@
       }
       /* Password is up to first : if exists */
       colon_pw = strchr(real_pw, ':');
  -    if (colon_pw)
  +    if (colon_pw) {
   	*colon_pw = '\0';
  -    /* anyone know where the prototype for crypt is? */
  -    if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw))) {
  +    }
  +    invalid_pw = ap_validate_password(sent_pw, real_pw);
  +    if (invalid_pw != NULL) {
   	ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -		    "user %s: password mismatch: %s", c->user, r->uri);
  +		      "DBM user %s: authentication failure for \"%s\": %s",
  +		      c->user, r->uri, invalid_pw);
   	ap_note_basic_auth_failure(r);
   	return AUTH_REQUIRED;
       }
  
  
  
  1.4       +69 -19    apache-apr/pthreads/src/modules/standard/mod_autoindex.c
  
  Index: mod_autoindex.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_autoindex.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -u -r1.3 -r1.4
  --- mod_autoindex.c	1999/02/03 17:50:12	1.3
  +++ mod_autoindex.c	1999/02/07 06:29:51	1.4
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -141,6 +141,7 @@
       int name_adjust;
       int icon_width;
       int icon_height;
  +    char *default_order;
   
       array_header *icon_list, *alt_list, *desc_list, *ign_list;
       array_header *hdr_list, *rdme_list;
  @@ -442,6 +443,48 @@
       return NULL;
   }
   
  +static const char *set_default_order(cmd_parms *cmd, void *m, char *direction,
  +				     char *key)
  +{
  +    char temp[4];
  +    autoindex_config_rec *d_cfg = (autoindex_config_rec *) m;
  +
  +    ap_cpystrn(temp, "k=d", sizeof(temp));
  +    if (!strcasecmp(direction, "Ascending")) {
  +	temp[2] = D_ASCENDING;
  +    }
  +    else if (!strcasecmp(direction, "Descending")) {
  +	temp[2] = D_DESCENDING;
  +    }
  +    else {
  +	return "First keyword must be 'Ascending' or 'Descending'";
  +    }
  +
  +    if (!strcasecmp(key, "Name")) {
  +	temp[0] = K_NAME;
  +    }
  +    else if (!strcasecmp(key, "Date")) {
  +	temp[0] = K_LAST_MOD;
  +    }
  +    else if (!strcasecmp(key, "Size")) {
  +	temp[0] = K_SIZE;
  +    }
  +    else if (!strcasecmp(key, "Description")) {
  +	temp[0] = K_DESC;
  +    }
  +    else {
  +	return "Second keyword must be 'Name', 'Date', 'Size', or "
  +	    "'Description'";
  +    }
  +
  +    if (d_cfg->default_order == NULL) {
  +	d_cfg->default_order = ap_palloc(cmd->pool, 4);
  +	d_cfg->default_order[3] = '\0';
  +    }
  +    ap_cpystrn(d_cfg->default_order, temp, sizeof(temp));
  +    return NULL;
  +}
  +
   #define DIR_CMD_PERMS OR_INDEXES
   
   static const command_rec autoindex_cmds[] =
  @@ -460,6 +503,8 @@
        "alternate descriptive text followed by one or more content encodings"},
       {"IndexOptions", add_opts, NULL, DIR_CMD_PERMS, RAW_ARGS,
        "one or more index options"},
  +    {"IndexOrderDefault", set_default_order, NULL, DIR_CMD_PERMS, TAKE2,
  +     "{Ascending,Descending} {Name,Size,Description,Date}"},
       {"IndexIgnore", add_ignore, NULL, DIR_CMD_PERMS, ITERATE,
        "one or more file extensions"},
       {"AddDescription", add_desc, BY_PATH, DIR_CMD_PERMS, ITERATE2,
  @@ -492,6 +537,7 @@
       new->opts = 0;
       new->incremented_opts = 0;
       new->decremented_opts = 0;
  +    new->default_order = NULL;
   
       return (void *) new;
   }
  @@ -570,6 +616,8 @@
   	new->name_adjust = add->name_adjust;
       }
   
  +    new->default_order = (add->default_order != NULL)
  +	? add->default_order : base->default_order;
       return new;
   }
   
  @@ -1317,31 +1365,33 @@
   
       /*
        * Figure out what sort of indexing (if any) we're supposed to use.
  +     *
  +     * If no QUERY_STRING was specified or column sorting has been
  +     * explicitly disabled, we use the default specified by the
  +     * IndexOrderDefault directive (if there is one); otherwise,
  +     * we fall back to ascending by name.
        */
  -    if (autoindex_opts & SUPPRESS_COLSORT) {
  +    qstring = r->args;
  +    if ((autoindex_opts & SUPPRESS_COLSORT)
  +	|| ((qstring == NULL) || (*qstring == '\0'))) {
  +	qstring = autoindex_conf->default_order;
  +    }
  +    /*
  +     * If there is no specific ordering defined for this directory,
  +     * default to ascending by filename.
  +     */
  +    if ((qstring == NULL) || (*qstring == '\0')) {
   	keyid = K_NAME;
   	direction = D_ASCENDING;
       }
       else {
  -	qstring = r->args;
  -
  -	/*
  -	 * If no QUERY_STRING was specified, we use the default: ascending
  -	 * by name.
  -	 */
  -	if ((qstring == NULL) || (*qstring == '\0')) {
  -	    keyid = K_NAME;
  -	    direction = D_ASCENDING;
  +	keyid = *qstring;
  +	ap_getword(r->pool, &qstring, '=');
  +	if (qstring != '\0') {
  +	    direction = *qstring;
   	}
   	else {
  -	    keyid = *qstring;
  -	    ap_getword(r->pool, &qstring, '=');
  -	    if (qstring != '\0') {
  -		direction = *qstring;
  -	    }
  -	    else {
  -		direction = D_ASCENDING;
  -	    }
  +	    direction = D_ASCENDING;
   	}
       }
   
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_cern_meta.c
  
  Index: mod_cern_meta.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_cern_meta.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_cern_meta.c	1999/01/21 23:08:38	1.1
  +++ mod_cern_meta.c	1999/02/07 06:29:52	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_cgi.c
  
  Index: mod_cgi.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_cgi.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_cgi.c	1999/01/21 23:08:38	1.1
  +++ mod_cgi.c	1999/02/07 06:29:52	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_digest.c
  
  Index: mod_digest.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_digest.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_digest.c	1999/01/21 23:08:38	1.1
  +++ mod_digest.c	1999/02/07 06:29:52	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +5 -5      apache-apr/pthreads/src/modules/standard/mod_dir.c
  
  Index: mod_dir.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_dir.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_dir.c	1999/01/21 23:08:38	1.1
  +++ mod_dir.c	1999/02/07 06:29:52	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -127,10 +127,10 @@
       if (r->uri[0] == '\0' || r->uri[strlen(r->uri) - 1] != '/') {
           char *ifile;
           if (r->args != NULL)
  -            ifile = ap_pstrcat(r->pool, escape_uri(r->pool, r->uri),
  +            ifile = ap_pstrcat(r->pool, ap_escape_uri(r->pool, r->uri),
                               "/", "?", r->args, NULL);
           else
  -            ifile = ap_pstrcat(r->pool, escape_uri(r->pool, r->uri),
  +            ifile = ap_pstrcat(r->pool, ap_escape_uri(r->pool, r->uri),
                               "/", NULL);
   
           ap_table_setn(r->headers_out, "Location",
  @@ -162,7 +162,7 @@
           request_rec *rr = ap_sub_req_lookup_uri(name_ptr, r);
   
           if (rr->status == HTTP_OK && rr->finfo.st_mode != 0) {
  -            char *new_uri = escape_uri(r->pool, rr->uri);
  +            char *new_uri = ap_escape_uri(r->pool, rr->uri);
   
               if (rr->args != NULL)
                   new_uri = ap_pstrcat(r->pool, new_uri, "?", rr->args, NULL);
  @@ -179,13 +179,13 @@
           if (ap_is_HTTP_REDIRECT(rr->status) ||
               (rr->status == HTTP_NOT_ACCEPTABLE && num_names == 1)) {
   
  +            ap_pool_join(r->pool, rr->pool);
               error_notfound = rr->status;
               r->notes = ap_overlay_tables(r->pool, r->notes, rr->notes);
               r->headers_out = ap_overlay_tables(r->pool, r->headers_out,
                                               rr->headers_out);
               r->err_headers_out = ap_overlay_tables(r->pool, r->err_headers_out,
                                                   rr->err_headers_out);
  -            ap_destroy_sub_req(rr);
               return error_notfound;
           }
   
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_env.c
  
  Index: mod_env.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_env.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_env.c	1999/01/21 23:08:38	1.1
  +++ mod_env.c	1999/02/07 06:29:52	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_expires.c
  
  Index: mod_expires.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_expires.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_expires.c	1999/01/21 23:08:38	1.1
  +++ mod_expires.c	1999/02/07 06:29:53	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_headers.c
  
  Index: mod_headers.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_headers.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_headers.c	1999/01/21 23:08:38	1.1
  +++ mod_headers.c	1999/02/07 06:29:53	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_imap.c
  
  Index: mod_imap.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_imap.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_imap.c	1999/01/21 23:08:38	1.1
  +++ mod_imap.c	1999/02/07 06:29:53	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.3       +46 -18    apache-apr/pthreads/src/modules/standard/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_include.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- mod_include.c	1999/01/27 16:15:47	1.2
  +++ mod_include.c	1999/02/07 06:29:53	1.3
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -689,13 +689,41 @@
                       "in parsed file %s";
               }
               if (error_fmt == NULL) {
  +		/* try to avoid recursive includes.  We do this by walking
  +		 * up the r->main list of subrequests, and at each level
  +		 * walking back through any internal redirects.  At each
  +		 * step, we compare the filenames and the URIs.  
  +		 *
  +		 * The filename comparison catches a recursive include
  +		 * with an ever-changing URL, eg.
  +		 * <!--#include virtual=
  +		 *      "$REQUEST_URI/$QUERY_STRING?$QUERY_STRING/x"-->
  +		 * which, although they would eventually be caught because
  +		 * we have a limit on the length of files, etc., can 
  +		 * recurse for a while.
  +		 *
  +		 * The URI comparison catches the case where the filename
  +		 * is changed while processing the request, so the 
  +		 * current name is never the same as any previous one.
  +		 * This can happen with "DocumentRoot /foo" when you
  +		 * request "/" on the server and it includes "/".
  +		 * This only applies to modules such as mod_dir that 
  +		 * (somewhat improperly) mess with r->filename outside 
  +		 * of a filename translation phase.
  +		 */
  +		int founddupe = 0;
                   request_rec *p;
  +                for (p = r; p != NULL && !founddupe; p = p->main) {
  +		    request_rec *q;
  +		    for (q = p; q != NULL; q = q->prev) {
  +			if ( (strcmp(q->filename, rr->filename) == 0) ||
  +			     (strcmp(q->uri, rr->uri) == 0) ){
  +			    founddupe = 1;
  +			    break;
  +			}
  +		    }
  +		}
   
  -                for (p = r; p != NULL; p = p->main) {
  -                    if (strcmp(p->filename, rr->filename) == 0) {
  -                        break;
  -                    }
  -                }
                   if (p != NULL) {
                       error_fmt = "Recursive include of \"%s\" "
                           "in parsed file %s";
  @@ -770,7 +798,7 @@
   
           ap_table_setn(env, "PATH_INFO", ap_escape_shell_cmd(r->pool, r->path_info));
   
  -        pa_req = ap_sub_req_lookup_uri(escape_uri(r->pool, r->path_info), r);
  +        pa_req = ap_sub_req_lookup_uri(ap_escape_uri(r->pool, r->path_info), r);
           if (pa_req->filename) {
               ap_table_setn(env, "PATH_TRANSLATED",
                         ap_pstrcat(r->pool, pa_req->filename, pa_req->path_info,
  @@ -807,7 +835,7 @@
       fprintf(dbg, "Exec failed\n");
   #endif
       ap_snprintf(err_string, sizeof(err_string),
  -                "httpd: exec of %s failed, reason: %s (errno = %d)\n",
  +                "exec of %s failed, reason: %s (errno = %d)\n",
                   SHELL_PATH, strerror(errno), errno);
       write(STDERR_FILENO, err_string, strlen(err_string));
       exit(0);
  @@ -928,10 +956,10 @@
       SV *sub = Nullsv;
       AV *av = newAV();
   
  -    if (!(ap_allow_options(r) & OPT_INCLUDES)) {
  +    if (ap_allow_options(r) & OPT_INCNOEXEC) {
           ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -                    "httpd: #perl SSI disallowed by IncludesNoExec in %s",
  -                    r->filename);
  +		      "#perl SSI disallowed by IncludesNoExec in %s",
  +		      r->filename);
           return DECLINED;
       }
       while (1) {
  @@ -2181,8 +2209,8 @@
               if (!strcmp(directive, "exec")) {
                   if (noexec) {
                       ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -                                "httpd: exec used but not allowed in %s",
  -                                r->filename);
  +				  "exec used but not allowed in %s",
  +				  r->filename);
                       if (printing) {
                           ap_rputs(error, r);
                       }
  @@ -2220,9 +2248,9 @@
   #endif
               else {
                   ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -                            "httpd: unknown directive \"%s\" "
  -                            "in parsed doc %s",
  -                            directive, r->filename);
  +			      "unknown directive \"%s\" "
  +			      "in parsed doc %s",
  +			      directive, r->filename);
                   if (printing) {
                       ap_rputs(error, r);
                   }
  @@ -2230,8 +2258,8 @@
               }
               if (ret) {
                   ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -                            "httpd: premature EOF in parsed file %s",
  -                            r->filename);
  +			      "premature EOF in parsed file %s",
  +			      r->filename);
                   return;
               }
           }
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_info.c
  
  Index: mod_info.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_info.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_info.c	1999/01/21 23:08:38	1.1
  +++ mod_info.c	1999/02/07 06:29:53	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +2 -2      apache-apr/pthreads/src/modules/standard/mod_log_agent.c
  
  Index: mod_log_agent.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_log_agent.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_log_agent.c	1999/01/21 23:08:38	1.1
  +++ mod_log_agent.c	1999/02/07 06:29:53	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -126,7 +126,7 @@
       else if (*cls->fname != '\0') {
           if ((cls->agent_fd = ap_popenf(p, fname, xfer_flags, xfer_mode)) < 0) {
               ap_log_error(APLOG_MARK, APLOG_ERR, s,
  -                         "httpd: could not open agent log file %s.", fname);
  +                         "could not open agent log file %s.", fname);
               exit(1);
           }
       }
  
  
  
  1.2       +5 -4      apache-apr/pthreads/src/modules/standard/mod_log_config.c
  
  Index: mod_log_config.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_log_config.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_log_config.c	1999/01/21 23:08:38	1.1
  +++ mod_log_config.c	1999/02/07 06:29:54	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -407,12 +407,13 @@
    */
   static const char *log_virtual_host(request_rec *r, char *a)
   {
  -    return ap_get_server_name(r);
  +    return r->server->server_hostname;
   }
   
   static const char *log_server_port(request_rec *r, char *a)
   {
  -    return ap_psprintf(r->pool, "%u", ap_get_server_port(r));
  +    return ap_psprintf(r->pool, "%u",
  +	r->server->port ? r->server->port : ap_default_port(r));
   }
   
   static const char *log_child_pid(request_rec *r, char *a)
  @@ -913,7 +914,7 @@
           char *fname = ap_server_root_relative(p, cls->fname);
           if ((cls->log_fd = ap_popenf(p, fname, xfer_flags, xfer_mode)) < 0) {
               ap_log_error(APLOG_MARK, APLOG_ERR, s,
  -                         "httpd: could not open transfer log file %s.", fname);
  +                         "could not open transfer log file %s.", fname);
               exit(1);
           }
       }
  
  
  
  1.2       +2 -2      apache-apr/pthreads/src/modules/standard/mod_log_referer.c
  
  Index: mod_log_referer.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_log_referer.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_log_referer.c	1999/01/21 23:08:38	1.1
  +++ mod_log_referer.c	1999/02/07 06:29:54	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -143,7 +143,7 @@
       else if (*cls->fname != '\0') {
           if ((cls->referer_fd = ap_popenf(p, fname, xfer_flags, xfer_mode)) < 0) {
   	    ap_log_error(APLOG_MARK, APLOG_ERR, s,
  -			 "httpd: could not open referer log file %s.", fname);        
  +			 "could not open referer log file %s.", fname);        
   	    exit(1);
   	}
       }
  
  
  
  1.2       +26 -5     apache-apr/pthreads/src/modules/standard/mod_mime.c
  
  Index: mod_mime.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_mime.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_mime.c	1999/01/21 23:08:38	1.1
  +++ mod_mime.c	1999/02/07 06:29:54	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -81,6 +81,7 @@
   
       char *type;                 /* Type forced with ForceType  */
       char *handler;              /* Handler forced with SetHandler */
  +    char *default_language;     /* Language if no AddLanguage ext found */
   } mime_dir_config;
   
   module MODULE_VAR_EXPORT mime_module;
  @@ -98,6 +99,7 @@
   
       new->type = NULL;
       new->handler = NULL;
  +    new->default_language = NULL;
   
       return new;
   }
  @@ -107,13 +109,13 @@
       mime_dir_config *base = (mime_dir_config *) basev;
       mime_dir_config *add = (mime_dir_config *) addv;
       mime_dir_config *new =
  -	(mime_dir_config *) ap_palloc(p, sizeof(mime_dir_config));
  +        (mime_dir_config *) ap_palloc(p, sizeof(mime_dir_config));
       int i;
       handlers_info *hand;
   
       hand = (handlers_info *) add->handlers_remove->elts;
       for (i = 0; i < add->handlers_remove->nelts; i++) {
  -	ap_table_unset(base->handlers, hand[i].name);
  +        ap_table_unset(base->handlers, hand[i].name);
       }
   
       new->forced_types = ap_overlay_tables(p, add->forced_types,
  @@ -127,6 +129,8 @@
   
       new->type = add->type ? add->type : base->type;
       new->handler = add->handler ? add->handler : base->handler;
  +    new->default_language = add->default_language ?
  +        add->default_language : base->default_language;
   
       return new;
   }
  @@ -182,7 +186,7 @@
       handlers_info *hand;
   
       if (*ext == '.') {
  -	++ext;
  +        ++ext;
       }
       hand = (handlers_info *) ap_push_array(mcfg->handlers_remove);
       hand->name = ap_pstrdup(cmd->pool, ext);
  @@ -219,6 +223,9 @@
        "a handler name"},
       {"TypesConfig", set_types_config, NULL, RSRC_CONF, TAKE1,
        "the MIME types config file"},
  +    {"DefaultLanguage", ap_set_string_slot,
  +     (void*)XtOffsetOf(mime_dir_config, default_language), OR_FILEINFO, TAKE1,
  +     "language to use for documents with no other language file extension" },
       {NULL}
   };
   
  @@ -250,7 +257,7 @@
   
       if (!(f = ap_pcfg_openfile(p, types_confname))) {
           ap_log_error(APLOG_MARK, APLOG_ERR, s,
  -		     "httpd: could not open mime types log file %s.", types_confname);
  +		     "could not open mime types log file %s.", types_confname);
           exit(1);
       }
   
  @@ -347,6 +354,20 @@
               r->handler = orighandler;
           }
   
  +    }
  +
  +    /* Set default language, if none was specified by the extensions
  +     * and we have a DefaultLanguage setting in force
  +     */
  +
  +    if (!r->content_languages && conf->default_language) {
  +        const char **new;
  +
  +        r->content_language = conf->default_language; /* back compat. only */
  +        if (!r->content_languages)
  +            r->content_languages = ap_make_array(r->pool, 2, sizeof(char *));
  +        new = (const char **) ap_push_array(r->content_languages);
  +        *new = conf->default_language;
       }
   
       /* Check for overrides with ForceType/SetHandler */
  
  
  
  1.5       +1 -1      apache-apr/pthreads/src/modules/standard/mod_mime_magic.c
  
  Index: mod_mime_magic.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_mime_magic.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -u -r1.4 -r1.5
  --- mod_mime_magic.c	1999/02/04 20:31:20	1.4
  +++ mod_mime_magic.c	1999/02/07 06:29:54	1.5
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1115 -626 apache-apr/pthreads/src/modules/standard/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_negotiation.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_negotiation.c	1999/01/21 23:08:38	1.1
  +++ mod_negotiation.c	1999/02/07 06:29:54	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -65,19 +65,11 @@
   #include "httpd.h"
   #include "http_config.h"
   #include "http_request.h"
  +#include "http_protocol.h"
   #include "http_core.h"
   #include "http_log.h"
   #include "util_script.h"
   
  -/* define TCN_02 to allow for Holtman I-D transparent negotiation.
  - * This file currently implements the draft-02, except for
  - * anything to do with features and cache-control (max-age etc)
  - *
  - * Since the draft is just that, and we don't yet implement
  - * everything, regard the transparent negotiation stuff as experimental.
  - */
  -/*#define TCN_02 */
  -
   /* Commands --- configuring document caching on a per (virtual?)
    * server basis... 
    */
  @@ -88,17 +80,6 @@
   
   module MODULE_VAR_EXPORT negotiation_module;
   
  -static char *merge_string_array(pool *p, array_header *arr, char *sep)
  -{
  -    int i;
  -    char *t = "";
  -
  -    for (i = 0; i < arr->nelts; i++) {
  -        t = ap_pstrcat(p, t, (i ? sep : ""), ((char **) arr->elts)[i], NULL);
  -    }
  -    return t;
  -}
  -
   static void *create_neg_dir_config(pool *p, char *dummy)
   {
       neg_dir_config *new = (neg_dir_config *) ap_palloc(p, sizeof(neg_dir_config));
  @@ -157,7 +138,7 @@
    */
   
   typedef struct accept_rec {
  -    char *type_name;		/* MUST be lowercase */
  +    char *name;                 /* MUST be lowercase */
       float quality;
       float max_bytes;
       float level;
  @@ -174,31 +155,39 @@
    *             if the client actually accepts this media type at that
    *             level (and *not* if it got in on a wildcard).  See level_cmp
    *             below.
  + * mime_stars -- initialized to zero.  Set to the number of stars
  + *               present in the best matching Accept header element.
  + *               1 for star/star, 2 for type/star and 3 for
  + *               type/subtype.
  + *
  + * definite -- initialized to 1.  Set to 0 if there is a match which
  + *             makes the variant non-definite according to the rules
  + *             in rfc2296.
    */
   
   typedef struct var_rec {
       request_rec *sub_req;       /* May be NULL (is, for map files) */
  -    char *type_name;		/* MUST be lowercase */
  +    char *mime_type;            /* MUST be lowercase */
       char *file_name;
       const char *content_encoding;
  -    array_header *content_languages;    /* list of languages for this variant */
  +    array_header *content_languages;   /* list of languages for this variant */
       char *content_charset;
       char *description;
   
       /* The next five items give the quality values for the dimensions
        * of negotiation for this variant. They are obtained from the
  -     * appropriate header lines, except for accept_type_quality, which
  +     * appropriate header lines, except for source_quality, which
        * is obtained from the variant itself (the 'qs' parameter value
  -     * from the variant's mime-type). Apart from type_quality,
  +     * from the variant's mime-type). Apart from source_quality,
        * these values are set when we find the quality for each variant
  -     * (see best_match()). type_quality is set from the 'qs' parameter
  +     * (see best_match()). source_quality is set from the 'qs' parameter
        * of the variant description or mime type: see set_mime_fields().
        */
       float lang_quality;         /* quality of this variant's language */
  -    int encoding_quality;       /* ditto encoding (1 or 0 only) */
  +    float encoding_quality;     /* ditto encoding */
       float charset_quality;      /* ditto charset */
  -    float accept_type_quality;  /* ditto media type */
  -    float type_quality;         /* quality of source for this type */
  +    float mime_type_quality;    /* ditto media type */
  +    float source_quality;       /* source quality for this variant */
   
       /* Now some special values */
       float level;                /* Auxiliary to content-type... */
  @@ -226,19 +215,25 @@
       int accept_q;               /* 1 if an Accept item has a q= param */
       float default_lang_quality; /* fiddle lang q for variants with no lang */
   
  -
  -    array_header *accepts;      /* accept_recs */
  -    int have_accept_header;     /* 1 if Accept-Header present */
  -    array_header *accept_encodings;     /* accept_recs */
  -    array_header *accept_charsets;      /* accept_recs */
  -    array_header *accept_langs; /* accept_recs */
  -    array_header *avail_vars;   /* available variants */
  -
  -    int count_multiviews_variants;      /* number of variants found on disk */
  -
  -    int ua_can_negotiate;       /* 1 if ua can do transparent negotiate */
  -    int use_transparent_neg;    /* 1 if we are using transparent neg */
  -    int short_accept_headers;   /* 1 if ua does trans neg & sent short accpt */
  +    /* the array pointers below are NULL if the corresponding accept
  +     * headers are not present
  +     */
  +    array_header *accepts;            /* accept_recs */
  +    array_header *accept_encodings;   /* accept_recs */
  +    array_header *accept_charsets;    /* accept_recs */
  +    array_header *accept_langs;       /* accept_recs */
  +
  +    array_header *avail_vars;         /* available variants */
  +
  +    int count_multiviews_variants;    /* number of variants found on disk */
  +
  +    int is_transparent;       /* 1 if this resource is trans. negotiable */
  +
  +    int dont_fiddle_headers;  /* 1 if we may not fiddle with accept hdrs */
  +    int ua_supports_trans;    /* 1 if ua supports trans negotiation */
  +    int send_alternates;      /* 1 if we want to send an Alternates header */
  +    int may_choose;           /* 1 if we may choose a variant for the client */
  +    int use_rvsa;             /* 1 if we must use RVSA/1.0 negotiation algo */
   } negotiation_state;
   
   /* A few functions to manipulate var_recs.
  @@ -248,7 +243,7 @@
   static void clean_var_rec(var_rec *mime_info)
   {
       mime_info->sub_req = NULL;
  -    mime_info->type_name = "";
  +    mime_info->mime_type = "";
       mime_info->file_name = "";
       mime_info->content_encoding = NULL;
       mime_info->content_languages = NULL;
  @@ -264,10 +259,10 @@
       mime_info->definite = 1;
   
       mime_info->charset_quality = 1.0f;
  -    mime_info->type_quality = 0.0f;
  -    mime_info->encoding_quality = 1;
  +    mime_info->encoding_quality = 1.0f;
       mime_info->lang_quality = 1.0f;
  -    mime_info->accept_type_quality = 1.0f;
  +    mime_info->mime_type_quality = 1.0f;
  +    mime_info->source_quality = 0.0f;
   }
   
   /* Initializing the relevant fields of a variant record from the
  @@ -276,16 +271,35 @@
   
   static void set_mime_fields(var_rec *var, accept_rec *mime_info)
   {
  -    var->type_name = mime_info->type_name;
  -    var->type_quality = mime_info->quality;
  +    var->mime_type = mime_info->name;
  +    var->source_quality = mime_info->quality;
       var->level = mime_info->level;
       var->content_charset = mime_info->charset;
   
  -    var->is_pseudo_html = (!strcmp(var->type_name, "text/html")
  -                           || !strcmp(var->type_name, INCLUDES_MAGIC_TYPE)
  -                           || !strcmp(var->type_name, INCLUDES_MAGIC_TYPE3));
  +    var->is_pseudo_html = (!strcmp(var->mime_type, "text/html")
  +                           || !strcmp(var->mime_type, INCLUDES_MAGIC_TYPE)
  +                           || !strcmp(var->mime_type, INCLUDES_MAGIC_TYPE3));
   }
   
  +/* Create a variant list validator in r using info from vlistr. */
  +
  +static void set_vlist_validator(request_rec *r, request_rec *vlistr)
  +{
  +    /* Calculating the variant list validator is similar to
  +     * calculating an etag for the source of the variant list
  +     * information, so we use ap_make_etag().  Note that this
  +     * validator can be 'weak' in extreme case.
  +     */
  +
  +    ap_update_mtime (vlistr, vlistr->finfo.st_mtime);
  +    r->vlist_validator = ap_make_etag(vlistr, 0);
  +
  +    /* ap_set_etag will later take r->vlist_validator into account
  +     * when creating the etag header
  +     */
  +}
  +
  +
   /*****************************************************************
    *
    * Parsing (lists of) media types and their parameters, as seen in
  @@ -297,7 +311,8 @@
    * enter the values we recognize into the argument accept_rec
    */
   
  -static const char *get_entry(pool *p, accept_rec *result, const char *accept_line)
  +static const char *get_entry(pool *p, accept_rec *result,
  +                             const char *accept_line)
   {
       result->quality = 1.0f;
       result->max_bytes = 0.0f;
  @@ -315,22 +330,22 @@
        * in the CERN server code?  I must be missing something).
        */
   
  -    result->type_name = ap_get_token(p, &accept_line, 0);
  -    ap_str_tolower(result->type_name);     /* You want case-insensitive,
  -                                         * you'll *get* case-insensitive.
  -                                         */
  +    result->name = ap_get_token(p, &accept_line, 0);
  +    ap_str_tolower(result->name);     /* You want case-insensitive,
  +                                       * you'll *get* case-insensitive.
  +                                       */
   
       /* KLUDGE!!! Default HTML to level 2.0 unless the browser
        * *explicitly* says something else.
        */
   
  -    if (!strcmp(result->type_name, "text/html") && (result->level == 0.0)) {
  +    if (!strcmp(result->name, "text/html") && (result->level == 0.0)) {
           result->level = 2.0f;
       }
  -    else if (!strcmp(result->type_name, INCLUDES_MAGIC_TYPE)) {
  +    else if (!strcmp(result->name, INCLUDES_MAGIC_TYPE)) {
           result->level = 2.0f;
       }
  -    else if (!strcmp(result->type_name, INCLUDES_MAGIC_TYPE3)) {
  +    else if (!strcmp(result->name, INCLUDES_MAGIC_TYPE3)) {
           result->level = 3.0f;
       }
   
  @@ -405,18 +420,19 @@
    * basic structure of a list of items of the format
    *    name; q=N; charset=TEXT
    *
  - * where q is only valid in Accept, Accept-Charset and Accept-Languages,
  - * and charset is only valid in Accept.
  + * where charset is only valid in Accept.
    */
   
   static array_header *do_header_line(pool *p, const char *accept_line)
   {
  -    array_header *accept_recs = ap_make_array(p, 40, sizeof(accept_rec));
  +    array_header *accept_recs;
   
       if (!accept_line) {
  -        return accept_recs;
  +        return NULL;
       }
   
  +    accept_recs = ap_make_array(p, 40, sizeof(accept_rec));
  +
       while (*accept_line) {
           accept_rec *new = (accept_rec *) ap_push_array(accept_recs);
           accept_line = get_entry(p, new, accept_line);
  @@ -456,12 +472,11 @@
   
   static negotiation_state *parse_accept_headers(request_rec *r)
   {
  -    negotiation_state *new = (negotiation_state *) ap_pcalloc(r->pool,
  -                                                 sizeof(negotiation_state));
  +    negotiation_state *new =
  +        (negotiation_state *) ap_pcalloc(r->pool, sizeof(negotiation_state));
       accept_rec *elts;
       table *hdrs = r->headers_in;
       int i;
  -    const char *hdr;
   
       new->pool = r->pool;
       new->r = r;
  @@ -469,86 +484,147 @@
   
       new->accepts = do_header_line(r->pool, ap_table_get(hdrs, "Accept"));
   
  -    hdr = ap_table_get(hdrs, "Accept-encoding");
  -    if (hdr) {
  -        new->have_accept_header = 1;
  -    }
  -    new->accept_encodings = do_header_line(r->pool, hdr);
  -
  -    new->accept_langs = do_header_line(r->pool,
  -                                       ap_table_get(hdrs, "Accept-language"));
  -    new->accept_charsets = do_header_line(r->pool,
  -                                          ap_table_get(hdrs, "Accept-charset"));
  -    new->avail_vars = ap_make_array(r->pool, 40, sizeof(var_rec));
  +    /* calculate new->accept_q value */
  +    if (new->accepts) {
  +        elts = (accept_rec *) new->accepts->elts;
   
  -#ifdef TCN_02
  -    if (ap_table_get(r->headers_in, "Negotiate")) {
  -        /* Negotiate: header tells us UA does transparent negotiation
  -         * We have to decide whether we want to ... for now, yes,
  -         * we do */
  -
  -        new->ua_can_negotiate = 1;
  -        if (r->method_number == M_GET) {
  -            new->use_transparent_neg = 1;       /* should be configurable */
  -        }
  -
  -        /* Check for 'Short Accept', ie either no Accept: header,
  -         * or just "Accept: * / *" */
  -        if (new->accepts->nelts == 0 ||
  -            (new->accepts->nelts == 1 &&
  -             (!strcmp(((accept_rec *) new->accepts->elts)[0].type_name,
  -                      "*/*")))) {
  -            /* Using short accept header */
  -            new->short_accept_headers = 1;
  +        for (i = 0; i < new->accepts->nelts; ++i) {
  +            if (elts[i].quality < 1.0) {
  +                new->accept_q = 1;
  +            }
           }
       }
  -#endif
   
  -    if (!new->use_transparent_neg) {
  -        /* Now we check for q-values. If they're all 1.0, we assume the
  -         * client is "broken", and we are allowed to fiddle with the
  -         * values later. Otherwise, we leave them alone.
  -         */
  +    new->accept_encodings =
  +        do_header_line(r->pool, ap_table_get(hdrs, "Accept-Encoding"));
  +    new->accept_langs =
  +        do_header_line(r->pool, ap_table_get(hdrs, "Accept-Language"));
  +    new->accept_charsets =
  +        do_header_line(r->pool, ap_table_get(hdrs, "Accept-Charset"));
   
  -        elts = (accept_rec *) new->accepts->elts;
  +    new->avail_vars = ap_make_array(r->pool, 40, sizeof(var_rec));
   
  -        for (i = 0; i < new->accepts->nelts; ++i) {
  -            if (elts[i].quality < 1.0) {
  -                new->accept_q = 1;
  +    return new;
  +}
  +
  +
  +static void parse_negotiate_header(request_rec *r, negotiation_state *neg)
  +{
  +    const char *negotiate = ap_table_get(r->headers_in, "Negotiate");
  +    
  +    if (negotiate) {
  +        /* Negotiate: header tells us UA does transparent negotiation */
  +
  +        /* sending Alternates on non-transparent resources is allowed,
  +         * and may even be useful, but we don't for now, also
  +         * because it could clash with an Alternates header set by
  +         * a sub- or super- request on a transparent resource.
  +         */
  +
  +        while (*negotiate) {
  +            char *tok = ap_get_token(neg->pool, &negotiate, 1);
  +            char *cp;
  +
  +            for (cp = tok; (*cp && !ap_isspace(*cp) && *cp != '='); ++cp) {
  +                *cp = ap_tolower(*cp);
  +            }
  +            *cp = 0;
  +            
  +            if (strcmp(tok, "trans") == 0 ||
  +                strcmp(tok, "vlist") == 0 ||
  +                strcmp(tok, "guess-small") == 0 ||
  +                ap_isdigit(tok[0]) ||
  +                strcmp(tok, "*") == 0) {
  +
  +                /* The user agent supports transparent negotiation */
  +                neg->ua_supports_trans = 1;
  +
  +                /* Send-alternates could be configurable, but note
  +                 * that it must be 1 if we have 'vlist' in the
  +                 * negotiate header.
  +                 */
  +                neg->send_alternates = 1;
  +
  +                if (strcmp(tok, "1.0") == 0) {
  +                    /* we may use the RVSA/1.0 algorithm, configure for it */
  +                    neg->may_choose = 1;
  +                    neg->use_rvsa = 1;
  +                    neg->dont_fiddle_headers = 1;
  +                }
  +                else if (strcmp(tok, "*") == 0) {
  +                    /* we may use any variant selection algorithm, configure
  +                     * to use the Apache algorithm
  +                     */
  +                    neg->may_choose = 1;
  +                    
  +                    /* We disable header fiddles on the assumption that a
  +                     * client sending Negotiate knows how to send correct
  +                     * headers which don't need fiddling.
  +                     */
  +                    neg->dont_fiddle_headers = 1; 
  +                }
               }
  +
  +            if (*negotiate)
  +                negotiate++; /* skip over , */
           }
       }
  -    else {
  -        new->accept_q = 1;
  +
  +    if (!neg->ua_supports_trans) {
  +        /* User agent does not support transparent negotiation,
  +         * configure to do server-driven negotiation with the Apache
  +         * algorithm.
  +         */
  +        neg->may_choose = 1;
  +
  +        /* To save network bandwidth, we do not configure to send an
  +         * Alternates header to the user agent in this case.  User
  +         * agents which want an Alternates header for agent-driven
  +         * negotiation will have to request it by sending an
  +         * appropriate Negotiate header.
  +         */
       }
   
  -    return new;
  +#ifdef NEG_DEBUG
  +    fprintf(stderr, "dont_fiddle_headers=%d use_rvsa=%d ua_supports_trans=%d "
  +            "send_alternates=%d, may_choose=%d\n",
  +            neg->dont_fiddle_headers, neg->use_rvsa,  
  +            neg->ua_supports_trans, neg->send_alternates, neg->may_choose);
  +#endif
  +
   }
   
   /* Sometimes clients will give us no Accept info at all; this routine sets
    * up the standard default for that case, and also arranges for us to be
    * willing to run a CGI script if we find one.  (In fact, we set up to
    * dramatically prefer CGI scripts in cases where that's appropriate,
  - * e.g., POST).
  + * e.g., POST or when URI includes query args or extra path info).
    */
  -
  -static void maybe_add_default_encodings(negotiation_state *neg, int prefer_scripts)
  +static void maybe_add_default_accepts(negotiation_state *neg, 
  +                                      int prefer_scripts)
   {
  -    accept_rec *new_accept = (accept_rec *) ap_push_array(neg->accepts);
  +    accept_rec *new_accept;
   
  -    new_accept->type_name = CGI_MAGIC_TYPE;
  -    new_accept->quality = prefer_scripts ? 1e-20f : 1e20f;
  -    new_accept->level = 0.0f;
  -    new_accept->max_bytes = 0.0f;
  -
  -    if (neg->accepts->nelts > 1) {
  -        return;
  -    }
  +    if (!neg->accepts) {
  +        neg->accepts = ap_make_array(neg->pool, 4, sizeof(accept_rec));
  +
  +        new_accept = (accept_rec *) ap_push_array(neg->accepts);
  +        
  +        new_accept->name = "*/*";
  +        new_accept->quality = 1.0f;
  +        new_accept->level = 0.0f;
  +        new_accept->max_bytes = 0.0f;
  +    }    
   
       new_accept = (accept_rec *) ap_push_array(neg->accepts);
   
  -    new_accept->type_name = "*/*";
  -    new_accept->quality = 1.0f;
  +    new_accept->name = CGI_MAGIC_TYPE;
  +    if (neg->use_rvsa) {
  +        new_accept->quality = 0;
  +    }
  +    else {
  +        new_accept->quality = prefer_scripts ? 2.0f : 0.001f;
  +    }
       new_accept->level = 0.0f;
       new_accept->max_bytes = 0.0f;
   }
  @@ -646,14 +722,15 @@
   static void strip_paren_comments(char *hdr)
   {
       /* Hmmm... is this correct?  In Roy's latest draft, (comments) can nest! */
  +    /* Nope, it isn't correct.  Fails to handle backslash escape as well.    */
   
       while (*hdr) {
           if (*hdr == '"') {
  -	    hdr = strchr(hdr, '"');
  -	    if (hdr == NULL) {
  -		return;
  -	    }
  -	    ++hdr;
  +            hdr = strchr(hdr, '"');
  +            if (hdr == NULL) {
  +                return;
  +            }
  +            ++hdr;
           }
           else if (*hdr == '(') {
               while (*hdr && *hdr != ')') {
  @@ -682,7 +759,7 @@
   
       if (!*cp) {
           ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -                    "Syntax error in type map --- no ':': %s", r->filename);
  +                      "Syntax error in type map --- no ':': %s", r->filename);
           return NULL;
       }
   
  @@ -692,8 +769,8 @@
   
       if (!*cp) {
           ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -                    "Syntax error in type map --- no header body: %s",
  -                    r->filename);
  +                      "Syntax error in type map --- no header body: %s",
  +                      r->filename);
           return NULL;
       }
   
  @@ -707,6 +784,7 @@
       char buffer[MAX_STRING_LEN];
       enum header_state hstate;
       struct var_rec mime_info;
  +    int has_content;
   
       /* We are not using multiviews */
       neg->count_multiviews_variants = 0;
  @@ -714,25 +792,26 @@
       map = ap_pfopen(neg->pool, rr->filename, "r");
       if (map == NULL) {
           ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
  -                    "cannot access type map file: %s", rr->filename);
  +                      "cannot access type map file: %s", rr->filename);
           return HTTP_FORBIDDEN;
       }
   
       clean_var_rec(&mime_info);
  +    has_content = 0;
   
       do {
           hstate = get_header_line(buffer, MAX_STRING_LEN, map);
   
           if (hstate == header_seen) {
               char *body1 = lcase_header_name_return_body(buffer, neg->r);
  -	    const char *body;
  +            const char *body;
   
               if (body1 == NULL) {
                   return SERVER_ERROR;
               }
   
               strip_paren_comments(body1);
  -	    body=body1;
  +            body = body1;
   
               if (!strncmp(buffer, "uri:", 4)) {
                   mime_info.file_name = ap_get_token(neg->pool, &body, 0);
  @@ -742,39 +821,77 @@
   
                   get_entry(neg->pool, &accept_info, body);
                   set_mime_fields(&mime_info, &accept_info);
  +                has_content = 1;
               }
               else if (!strncmp(buffer, "content-length:", 15)) {
                   mime_info.bytes = atof(body);
  +                has_content = 1;
               }
               else if (!strncmp(buffer, "content-language:", 17)) {
                   mime_info.content_languages = do_languages_line(neg->pool,
                                                                   &body);
  +                has_content = 1;
               }
               else if (!strncmp(buffer, "content-encoding:", 17)) {
                   mime_info.content_encoding = ap_get_token(neg->pool, &body, 0);
  +                has_content = 1;
               }
               else if (!strncmp(buffer, "description:", 12)) {
  -                mime_info.description = ap_get_token(neg->pool, &body, 0);
  +                /* XXX: The possibility to set a description is
  +                 * currently not documented.
  +                 */
  +                char *desc = ap_pstrdup(neg->pool, body);
  +                char *cp;
  +
  +                for (cp = desc; *cp; ++cp) {
  +                    if (*cp=='\n') *cp=' ';
  +                }
  +                if (cp>desc) *(cp-1)=0;
  +                mime_info.description = desc;
               }
           }
           else {
  -            if (mime_info.type_quality > 0 && *mime_info.file_name) {
  +            if (*mime_info.file_name && has_content) {
                   void *new_var = ap_push_array(neg->avail_vars);
   
                   memcpy(new_var, (void *) &mime_info, sizeof(var_rec));
               }
   
               clean_var_rec(&mime_info);
  +            has_content = 0;
           }
       } while (hstate != header_eof);
   
       ap_pfclose(neg->pool, map);
  +
  +    set_vlist_validator(r, rr);
  +
       return OK;
   }
   
  +
  +/* Sort function used by read_types_multi. */
  +static int variantsortf(var_rec *a, var_rec *b) {
  +
  +    /* First key is the source quality, sort in descending order. */
  +
  +    /* XXX: note that we currently implement no method of setting the
  +     * source quality for multiviews variants, so we are always comparing
  +     * 1.0 to 1.0 for now
  +     */
  +    if (a->source_quality < b->source_quality)
  +        return 1;
  +    if (a->source_quality > b->source_quality)
  +        return -1;
  +
  +    /* Second key is the variant name */
  +    return strcmp(a->file_name, b->file_name);
  +}
  +
   /*****************************************************************
    *
  - * Same, except we use a filtered directory listing as the map...
  + * Same as read_type_map, except we use a filtered directory listing
  + * as the map...  
    */
   
   static int read_types_multi(negotiation_state *neg)
  @@ -853,14 +970,13 @@
   
               ap_pclosedir(neg->pool, dirp);
               neg->avail_vars->nelts = 0;
  -	    if (sub_req->status != HTTP_OK) {
  -		return sub_req->status;
  -	    }
  +            if (sub_req->status != HTTP_OK) {
  +                return sub_req->status;
  +            }
               return read_type_map(neg, sub_req);
           }
   
  -        /* Have reasonable variant --- gather notes.
  -         */
  +        /* Have reasonable variant --- gather notes. */
   
           mime_info.sub_req = sub_req;
           mime_info.file_name = ap_pstrdup(neg->pool, dir_entry->d_name);
  @@ -883,13 +999,27 @@
       }
   
       ap_pclosedir(neg->pool, dirp);
  +
  +    set_vlist_validator(r, r);
  +
  +    /* Sort the variants into a canonical order.  The negotiation
  +     * result sometimes depends on the order of the variants.  By
  +     * sorting the variants into a canonical order, rather than using
  +     * the order in which readdir() happens to return them, we ensure
  +     * that the negotiation result will be consistent over filesystem
  +     * backup/restores and over all mirror sites.
  +     */
  +       
  +    qsort((void *) neg->avail_vars->elts, neg->avail_vars->nelts,
  +          sizeof(var_rec), (int (*)(const void *, const void *)) variantsortf);
  +
       return OK;
   }
   
   
   /*****************************************************************
    * And now for the code you've been waiting for... actually
  - * finding a match to the client's requirements.
  + * finding a match to the client's requirements.  
    */
   
   /* Matching MIME types ... the star/star and foo/star commenting conventions
  @@ -906,8 +1036,8 @@
   
   static int mime_match(accept_rec *accept_r, var_rec *avail)
   {
  -    char *accept_type = accept_r->type_name;
  -    char *avail_type = avail->type_name;
  +    char *accept_type = accept_r->name;
  +    char *avail_type = avail->mime_type;
       int len = strlen(accept_type);
   
       if (accept_type[0] == '*') {        /* Anything matches star/star */
  @@ -970,9 +1100,13 @@
           return 0;
       }
   
  -    if (!var1->is_pseudo_html && strcmp(var1->type_name, var2->type_name)) {
  +    if (!var1->is_pseudo_html && strcmp(var1->mime_type, var2->mime_type)) {
           return 0;
       }
  +    /* The result of the above if statements is that, if we get to
  +     * here, both variants have the same mime_type or both are
  +     * pseudo-html.
  +     */    
   
       /* Take highest level that matched, if either did match. */
   
  @@ -1008,12 +1142,12 @@
    *                        directive order.
    *
    * When we do the variant checking for best variant, we use language
  - * quality first, and if a tie, language_index next (this only
  - * applies when _not_ using the network algorithm). If using
  - * network algorithm, lang_index is never used.
  + * quality first, and if a tie, language_index next (this only applies
  + * when _not_ using the RVSA/1.0 algorithm). If using the RVSA/1.0
  + * algorithm, lang_index is never used.
    *
    * set_language_quality() calls find_lang_index() and find_default_index()
  - * to set lang_index.
  + * to set lang_index.  
    */
   
   static int find_lang_index(array_header *accept_langs, char *lang)
  @@ -1021,14 +1155,14 @@
       accept_rec *accs;
       int i;
   
  -    if (!lang) {
  +    if (!lang || !accept_langs) {
           return -1;
       }
   
       accs = (accept_rec *) accept_langs->elts;
   
       for (i = 0; i < accept_langs->nelts; ++i) {
  -        if (!strncmp(lang, accs[i].type_name, strlen(accs[i].type_name))) {
  +        if (!strncmp(lang, accs[i].name, strlen(accs[i].name))) {
               return i;
           }
       }
  @@ -1076,8 +1210,8 @@
    * are acceptable. The default q value set here is assigned to variants
    * with no language type in set_language_quality().
    *
  - * Note that if using the transparent negotiation network algorythm,
  - * we don't use this fiddle.
  + * Note that if using the RVSA/1.0 algorithm, we don't use this
  + * fiddle.  
    */
   
   static void set_default_lang_quality(negotiation_state *neg)
  @@ -1085,7 +1219,7 @@
       var_rec *avail_recs = (var_rec *) neg->avail_vars->elts;
       int j;
   
  -    if (!neg->use_transparent_neg) {
  +    if (!neg->dont_fiddle_headers) {
           for (j = 0; j < neg->avail_vars->nelts; ++j) {
               var_rec *variant = &avail_recs[j];
               if (variant->content_languages &&
  @@ -1103,11 +1237,11 @@
    * assigns lang_index for back-compat. 
    *
    * To find the language_quality value, we look for the 'q' value
  - * of the 'best' matching language on the Accept-Language:
  - * header. The'best' match is the language on Accept-Language:
  + * of the 'best' matching language on the Accept-Language
  + * header. The 'best' match is the language on Accept-Language
    * header which matches the language of this variant either fully,
    * or as far as the prefix marker (-). If two or more languages
  - * match, use the longest string from the Accept-Language: header
  + * match, use the longest string from the Accept-Language header
    * (see HTTP/1.1 [14.4])
    *
    * When a variant has multiple languages, we find the 'best'
  @@ -1132,135 +1266,160 @@
   
   static void set_language_quality(negotiation_state *neg, var_rec *variant)
   {
  -    int i;
  -    int naccept = neg->accept_langs->nelts;
  -    int idx;
  -    neg_dir_config *conf = NULL;
       char *firstlang;
  -
  -    if (naccept == 0) {
  -        conf = (neg_dir_config *) ap_get_module_config(neg->r->per_dir_config,
  -                                                    &negotiation_module);
  -    }
  -
  -    if (naccept == 0 && (!variant->content_languages ||
  -                         !variant->content_languages->nelts)) {
  -        return;                 /* no accept-language and no variant lang */
  -    }
  +    int idx;
   
       if (!variant->content_languages || !variant->content_languages->nelts) {
           /* This variant has no content-language, so use the default
            * quality factor for variants with no content-language
  -         * (previously set by set_default_lang_quality()). */
  -        variant->lang_quality = neg->default_lang_quality;
  -
  -        if (naccept == 0) {
  -            return;             /* no accept-language items */
  +         * (previously set by set_default_lang_quality()).
  +         * Leave the factor alone (it remains at 1.0) when we may not fiddle
  +         * with the headers.
  +         */
  +        if (!neg->dont_fiddle_headers) {
  +            variant->lang_quality = neg->default_lang_quality;
  +        }
  +        if (!neg->accept_langs) {
  +            return;             /* no accept-language header */
           }
   
       }
  -    else if (naccept) {
  -        /* Variant has one (or more) languages, and we have one (or more)
  -         * language ranges on the Accept-Language header. Look for
  -         * the best match. We do this by going through each language
  -         * on the variant description looking for a match on the
  -         * Accept-Language header. The best match is the longest matching
  -         * language on the header. The final result is the best q value
  -         * from all the languages on the variant description.
  -         */
  -        int j;
  -        float fiddle_q = 0.0f;
  -        accept_rec *accs = (accept_rec *) neg->accept_langs->elts;
  -        accept_rec *best = NULL, *star = NULL;
  -        char *p;
  -
  -        for (j = 0; j < variant->content_languages->nelts; ++j) {
  -            char *lang;         /* language from variant description */
  -            accept_rec *bestthistag = NULL;
  -            int prefixlen = 0;
  -            int longest_lang_range_len = 0;
  -            int len;
  -
  -            /* lang is the variant's language-tag, which is the one
  -             * we are allowed to use the prefix of in HTTP/1.1
  -             */
  -            lang = ((char **) (variant->content_languages->elts))[j];
  -            p = strchr(lang, '-');      /* find prefix part (if any) */
  -            if (p) {
  -                prefixlen = p - lang;
  -            }
  +    else {
  +        /* Variant has one (or more) languages.  Look for the best
  +         * match. We do this by going through each language on the
  +         * variant description looking for a match on the
  +         * Accept-Language header. The best match is the longest
  +         * matching language on the header. The final result is the
  +         * best q value from all the languages on the variant
  +         * description.
  +         */
   
  -            /* now find the best (i.e. longest) matching Accept-Language
  -             * header language. We put the best match for this tag in 
  -             * bestthistag. We cannot update the overall best (based on
  -             * q value) because the best match for this tag is the longest
  -             * language item on the accept header, not necessarily the
  -             * highest q.
  -             */
  -            for (i = 0; i < neg->accept_langs->nelts; ++i) {
  -                if (!strcmp(accs[i].type_name, "*")) {
  -                    if (!star) {
  -                        star = &accs[i];
  +        if (!neg->accept_langs) {
  +            /* no accept-language header makes the variant indefinite */
  +            variant->definite = 0;
  +        }
  +        else {    /* There is an accept-language with 0 or more items */
  +            accept_rec *accs = (accept_rec *) neg->accept_langs->elts;
  +            accept_rec *best = NULL, *star = NULL;
  +            accept_rec *bestthistag;
  +            char *lang, *p;
  +            float fiddle_q = 0.0f;
  +            int any_match_on_star = 0;
  +            int i, j, alen, longest_lang_range_len;
  +            
  +            for (j = 0; j < variant->content_languages->nelts; ++j) {
  +                p = NULL;
  +                bestthistag = NULL;
  +                longest_lang_range_len = 0;
  +                alen = 0;
  +                
  +                /* lang is the variant's language-tag, which is the one
  +                 * we are allowed to use the prefix of in HTTP/1.1
  +                 */
  +                lang = ((char **) (variant->content_languages->elts))[j];
  +                
  +                /* now find the best (i.e. longest) matching
  +                 * Accept-Language header language. We put the best match
  +                 * for this tag in bestthistag. We cannot update the
  +                 * overall best (based on q value) because the best match
  +                 * for this tag is the longest language item on the accept
  +                 * header, not necessarily the highest q.
  +                 */
  +                for (i = 0; i < neg->accept_langs->nelts; ++i) {
  +                    if (!strcmp(accs[i].name, "*")) {
  +                        if (!star) {
  +                            star = &accs[i];
  +                        }
  +                        continue;
                       }
  -                    continue;
  -                }
  -
  -                /* Find language. We match if either the variant language
  -                 * tag exactly matches, or the prefix of the tag up to the
  -                 * '-' character matches the whole of the language in the
  -                 * Accept-Language header. We only use this accept-language
  -                 * item as the best match for the current tag if it
  -                 * is longer than the previous best match */
  -                if ((!strcmp(lang, accs[i].type_name) ||
  -                     (prefixlen &&
  -                      !strncmp(lang, accs[i].type_name, prefixlen) &&
  -                      (accs[i].type_name[prefixlen] == '\0'))) &&
  -                    ((len = strlen(accs[i].type_name)) >
  -                     longest_lang_range_len)) {
  -                    longest_lang_range_len = len;
  -                    bestthistag = &accs[i];
  -                }
  -
  -                if (!bestthistag) {
  -                    /* The next bit is a fiddle. Some browsers might be
  -                     * configured to send more specific language ranges
  -                     * than desirable. For example, an Accept-Language of
  -                     * en-US should never match variants with languages en
  -                     * or en-GB. But US English speakers might pick en-US
  -                     * as their language choice.  So this fiddle checks if
  -                     * the language range has a prefix, and if so, it
  -                     * matches variants which match that prefix with a
  -                     * priority of 0.001. So a request for en-US would
  -                     * match variants of types en and en-GB, but at much
  -                     * lower priority than matches of en-US directly, or
  -                     * of any other language listed on the Accept-Language
  -                     * header
  +                    /* Find language. We match if either the variant
  +                     * language tag exactly matches the language range
  +                     * from the accept header, or a prefix of the variant
  +                     * language tag up to a '-' character matches the
  +                     * whole of the language range in the Accept-Language
  +                     * header.  Note that HTTP/1.x allows any number of
  +                     * '-' characters in a tag or range, currently only
  +                     * tags with zero or one '-' characters are defined
  +                     * for general use (see rfc1766).
  +                     *  
  +                     * We only use language range in the Accept-Language
  +                     * header the best match for the variant language tag
  +                     * if it is longer than the previous best match.
                        */
  -                    if ((p = strchr(accs[i].type_name, '-'))) {
  -                        int plen = p - accs[i].type_name;
  -                        if (!strncmp(lang, accs[i].type_name, plen)) {
  -                            fiddle_q = 0.001f;
  +                    
  +                    alen = strlen(accs[i].name);
  +                    
  +                    if ((strlen(lang) >= alen) &&
  +                        !strncmp(lang, accs[i].name, alen) &&
  +                        ((lang[alen] == 0) || (lang[alen] == '-')) ) {
  +                        
  +                        if (alen > longest_lang_range_len) {
  +                            longest_lang_range_len = alen;
  +                            bestthistag = &accs[i];
                           }
                       }
  +                    
  +                    if (!bestthistag && !neg->dont_fiddle_headers) {
  +                        /* The next bit is a fiddle. Some browsers might
  +                         * be configured to send more specific language
  +                         * ranges than desirable. For example, an
  +                         * Accept-Language of en-US should never match
  +                         * variants with languages en or en-GB. But US
  +                         * English speakers might pick en-US as their
  +                         * language choice.  So this fiddle checks if the
  +                         * language range has a prefix, and if so, it
  +                         * matches variants which match that prefix with a
  +                         * priority of 0.001. So a request for en-US would
  +                         * match variants of types en and en-GB, but at
  +                         * much lower priority than matches of en-US
  +                         * directly, or of any other language listed on
  +                         * the Accept-Language header. Note that this
  +                         * fiddle does not handle multi-level prefixes.
  +                         */
  +                        if ((p = strchr(accs[i].name, '-'))) {
  +                            int plen = p - accs[i].name;
  +
  +                            if (!strncmp(lang, accs[i].name, plen)) {
  +                                fiddle_q = 0.001f;
  +                            }
  +                        }
  +                    }
  +                }
  +                /* Finished looking at Accept-Language headers, the best
  +                 * (longest) match is in bestthistag, or NULL if no match
  +                 */
  +                if (!best ||
  +                    (bestthistag && bestthistag->quality > best->quality)) {
  +                    best = bestthistag;
  +                }
  +                
  +                /* See if the tag matches on a * in the Accept-Language
  +                 * header. If so, record this fact for later use 
  +                 */
  +                if (!bestthistag && star) {
  +                    any_match_on_star = 1;
                   }
               }
  -            /* Finished looking at Accept-Language headers, the best
  -             * (longest) match is in bestthistag, or NULL if no match
  +            
  +            /* If one of the language tags of the variant matched on *, we
  +             * need to see if its q is better than that of any non-* match
  +             * on any other tag of the variant.  If so the * match takes
  +             * precedence and the overall match is not definite.
                */
  -            if (!best ||
  -                (bestthistag && bestthistag->quality > best->quality)) {
  -                best = bestthistag;
  +            if ( any_match_on_star &&
  +                ((best && star->quality > best->quality) ||
  +                 (!best)) ) {
  +                best = star;
  +                variant->definite = 0;
               }
  +            
  +            variant->lang_quality = best ? best->quality : fiddle_q;
           }
  -
  -        variant->lang_quality = best
  -            ? best->quality
  -            : (star ? star->quality : fiddle_q);
       }
   
       /* Now set the old lang_index field. Since this is old 
  -     * stuff anyway, don't both with handling multiple languages
  -     * per variant, just use the first one assigned to it
  +     * stuff anyway, don't bother with handling multiple languages
  +     * per variant, just use the first one assigned to it 
        */
       idx = 0;
       if (variant->content_languages && variant->content_languages->nelts) {
  @@ -1269,8 +1428,10 @@
       else {
           firstlang = "";
       }
  -    if (naccept == 0) {         /* Client doesn't care */
  -        idx = find_default_index(conf, firstlang);
  +    if (!neg->accept_langs) {   /* Client doesn't care */
  +        idx = find_default_index((neg_dir_config *) ap_get_module_config(
  +                                  neg->r->per_dir_config, &negotiation_module),
  +                                 firstlang);
       }
       else {                      /* Client has Accept-Language */
           idx = find_lang_index(neg->accept_langs, firstlang);
  @@ -1294,7 +1455,7 @@
   
       if (variant->bytes == 0) {
           char *fullname = ap_make_full_path(neg->pool, neg->dir_name,
  -                                        variant->file_name);
  +                                           variant->file_name);
   
           if (stat(fullname, &statb) >= 0) {
               /* Note, precision may be lost */
  @@ -1307,29 +1468,37 @@
   
   /* For a given variant, find the best matching Accept: header
    * and assign the Accept: header's quality value to the
  - * accept_type_quality field of the variant, for later use in
  + * mime_type_quality field of the variant, for later use in
    * determining the best matching variant.
    */
   
   static void set_accept_quality(negotiation_state *neg, var_rec *variant)
   {
       int i;
  -    accept_rec *accept_recs = (accept_rec *) neg->accepts->elts;
  +    accept_rec *accept_recs;
       float q = 0.0f;
       int q_definite = 1;
   
       /* if no Accept: header, leave quality alone (will
  -     * remain at the default value of 1) */
  -    if (!neg->accepts || neg->accepts->nelts == 0) {
  +     * remain at the default value of 1) 
  +     *
  +     * XXX: This if is currently never true because of the effect of
  +     * maybe_add_default_accepts().
  +     */
  +    if (!neg->accepts) {
  +        if (variant->mime_type && *variant->mime_type)
  +            variant->definite = 0;
           return;
       }
   
  +    accept_recs = (accept_rec *) neg->accepts->elts;
  +
       /*
        * Go through each of the ranges on the Accept: header,
        * looking for the 'best' match with this variant's
        * content-type. We use the best match's quality
        * value (from the Accept: header) for this variant's
  -     * accept_type_quality field.
  +     * mime_type_quality field.
        *
        * The best match is determined like this:
        *    type/type is better than type/ * is better than * / *
  @@ -1354,22 +1523,25 @@
               }
           }
   
  -        /* Check maxbytes -- not in HTTP/1.1 or Holtman */
  +        /* Check maxbytes -- not in HTTP/1.1 or TCN */
   
           if (type->max_bytes > 0
               && (find_content_length(neg, variant) > type->max_bytes)) {
               continue;
           }
   
  -        /* If we are allowed to mess with the q-values,
  +        /* If we are allowed to mess with the q-values
  +         * and have no explicit q= parameters in the accept header,
            * make wildcards very low, so we have a low chance
            * of ending up with them if there's something better.
            */
   
  -        if (!neg->accept_q && variant->mime_stars == 1) {
  +        if (!neg->dont_fiddle_headers && !neg->accept_q &&
  +            variant->mime_stars == 1) {
               q = 0.01f;
           }
  -        else if (!neg->accept_q && variant->mime_stars == 2) {
  +        else if (!neg->dont_fiddle_headers && !neg->accept_q &&
  +                 variant->mime_stars == 2) {
               q = 0.02f;
           }
           else {
  @@ -1378,37 +1550,55 @@
   
           q_definite = (variant->mime_stars == 3);
       }
  -    variant->accept_type_quality = q;
  +    variant->mime_type_quality = q;
       variant->definite = variant->definite && q_definite;
   
  -    /* if the _best_ quality we got for this variant was 0.0,
  -     * eliminate it now */
   }
   
   /* For a given variant, find the 'q' value of the charset given
    * on the Accept-Charset line. If not charsets are listed,
    * assume value of '1'.
    */
  -
   static void set_charset_quality(negotiation_state *neg, var_rec *variant)
   {
       int i;
  -    accept_rec *accept_recs = (accept_rec *) neg->accept_charsets->elts;
  +    accept_rec *accept_recs;
       char *charset = variant->content_charset;
       accept_rec *star = NULL;
   
       /* if no Accept-Charset: header, leave quality alone (will
  -     * remain at the default value of 1) */
  -    if (!neg->accept_charsets || neg->accept_charsets->nelts == 0) {
  +     * remain at the default value of 1)
  +     */
  +    if (!neg->accept_charsets) {
  +        if (charset && *charset)
  +            variant->definite = 0;
           return;
       }
   
  +    accept_recs = (accept_rec *) neg->accept_charsets->elts;
  +
       if (charset == NULL || !*charset) {
  -        charset = "iso-8859-1";
  +        /* Charset of variant not known */
  +
  +        /* if not a text / * type, leave quality alone */
  +        if (!(!strncmp(variant->mime_type, "text/", 5)
  +              || !strcmp(variant->mime_type, INCLUDES_MAGIC_TYPE)
  +              || !strcmp(variant->mime_type, INCLUDES_MAGIC_TYPE3) 
  +              ))
  +            return;
  +
  +        /* Don't go guessing if we are in strict header mode,
  +         * e.g. when running the rvsa, as any guess won't be reflected
  +         * in the variant list or content-location headers.
  +         */
  +        if (neg->dont_fiddle_headers)
  +            return;
  +
  +        charset = "iso-8859-1"; /* The default charset for HTTP text types */
       }
   
       /*
  -     * Go through each of the items on the Accept-Charset: header,
  +     * Go through each of the items on the Accept-Charset header,
        * looking for a match with this variant's charset. If none
        * match, charset is unacceptable, so set quality to 0.
        */
  @@ -1416,17 +1606,18 @@
   
           accept_rec *type = &accept_recs[i];
   
  -        if (!strcmp(type->type_name, charset)) {
  +        if (!strcmp(type->name, charset)) {
               variant->charset_quality = type->quality;
               return;
           }
  -        else if (strcmp(type->type_name, "*") == 0) {
  +        else if (strcmp(type->name, "*") == 0) {
               star = type;
           }
       }
       /* No explicit match */
       if (star) {
           variant->charset_quality = star->quality;
  +        variant->definite = 0;
           return;
       }
       /* If this variant is in charset iso-8859-1, the default is 1.0 */
  @@ -1438,11 +1629,6 @@
       }
   }
   
  -/* For a given variant, find the best matching Accept: header
  - * and assign the Accept: header's quality value to the
  - * accept_type_quality field of the variant, for later use in
  - * determining the best matching variant.
  - */
   
   /* is_identity_encoding is included for back-compat, but does anyone
    * use 7bit, 8bin or binary in their var files??
  @@ -1454,25 +1640,46 @@
               || !strcmp(enc, "binary"));
   }
   
  +/*
  + * set_encoding_quality determines whether the encoding for a particular
  + * variant is acceptable for the user-agent.
  + *
  + * The rules for encoding are that if the user-agent does not supply
  + * any Accept-Encoding header, then all encodings are allowed but a
  + * variant with no encoding should be preferred.
  + * If there is an empty Accept-Encoding header, then no encodings are 
  + * acceptable. If there is a non-empty Accept-Encoding header, then
  + * any of the listed encodings are acceptable, as well as no encoding
  + * unless the "identity" encoding is specifically excluded.
  + */
   static void set_encoding_quality(negotiation_state *neg, var_rec *variant)
   {
  -    int i;
  -    accept_rec *accept_recs = (accept_rec *) neg->accept_encodings->elts;
  +    accept_rec *accept_recs;
       const char *enc = variant->content_encoding;
  +    accept_rec *star = NULL;
  +    float value_if_not_found = 0.0f;
  +    int i;
   
  -    if (!enc || is_identity_encoding(enc)) {
  +    if (!neg->accept_encodings) {
  +        /* We had no Accept-Encoding header, assume that all
  +         * encodings are acceptable with a low quality,
  +         * but we prefer no encoding if available.
  +         */
  +        if (!enc || is_identity_encoding(enc))
  +            variant->encoding_quality = 1.0f;
  +        else
  +            variant->encoding_quality = 0.5f;
  +
           return;
       }
   
  -    /* if no Accept: header, leave quality alone (will
  -     * remain at the default value of 1) */
  -    if (neg->accept_encodings->nelts == 0) {
  -        /* If we had an empty Accept-Encoding header, assume that
  -         * no encodings are acceptable, else all encodings are ok */
  -        variant->encoding_quality = neg->have_accept_header ? 0 : 1;
  -        return;
  +    if (!enc || is_identity_encoding(enc)) {
  +        enc = "identity";
  +        value_if_not_found = 0.0001f;
       }
   
  +    accept_recs = (accept_rec *) neg->accept_encodings->elts;
  +
       /* Go through each of the encodings on the Accept-Encoding: header,
        * looking for a match with our encoding. x- prefixes are ignored.
        */
  @@ -1480,93 +1687,123 @@
           enc += 2;
       }
       for (i = 0; i < neg->accept_encodings->nelts; ++i) {
  -        char *name = accept_recs[i].type_name;
  +
  +        char *name = accept_recs[i].name;
   
           if (name[0] == 'x' && name[1] == '-') {
               name += 2;
           }
   
           if (!strcmp(name, enc)) {
  -            variant->encoding_quality = 1;
  +            variant->encoding_quality = accept_recs[i].quality;
               return;
           }
  +
  +        if (strcmp(name, "*") == 0) {
  +            star = &accept_recs[i];
  +        }
  +
       }
  +    /* No explicit match */
  +    if (star) {
  +        variant->encoding_quality = star->quality;
  +        return;
  +    }
   
       /* Encoding not found on Accept-Encoding: header, so it is
  -     * _not_ acceptable */
  -    variant->encoding_quality = 0;
  +     * _not_ acceptable unless it is the identity (no encoding)
  +     */
  +    variant->encoding_quality = value_if_not_found;
   }
   
  -/* Possible results of the network algorithm */
  +/************************************************************* 
  + * Possible results of the variant selection algorithm 
  + */
   enum algorithm_results {
  -    na_not_applied = -1,        /* net algorithm not used */
  -    na_choice = 1,              /* choose variant */
  -    na_list                     /* list variants */
  +    alg_choice = 1,              /* choose variant */
  +    alg_list                     /* list variants */
   };
   
  -/*
  - * This is a heavily-rewritten 'best_match' function. For a start, it
  - * now returns an int, which has one of the three values: na_not_applied,
  - * na_choice or na_list, which give the result of the network algorithm
  - * (if it was not applied, the return value is na_not_applied).
  - * The best variable is returned in *pbest. It also has two possible
  - * algorithms for determining the best match: the network algorithm,
  - * and the standard Apache algorithm. These are split out into
  - * separate functions (is_variant_better_na() and is_variant_better()).
  - *
  - * Previously, best_match iterated first through the content_types
  - * in the Accept: header, then checked each variant, and eliminated
  - * those that didn't match the variant's type. We cannot do this because
  - * we need full information, including language, charset, etc
  - * quality for _every_ variant, for the Alternates: header,
  - * and (possibly) the human-readable choice responses or 406 errors.
  - *
  - * After the 'best' (if any) is determined, the overall result of
  - * the negotiation is obtained. If the network algorithm was not
  - * in use, the result is na_not_applied. Else the result is
  - * na_list if 'short accept header' is in use, else na_list
  - * if _no_ best match was found, or na_choice if a best match
  - * was found.
  - */
  -
  -/* Firstly, the negotiation 'network algorithm' from Holtman.
  +/* Below is the 'best_match' function. It returns an int, which has
  + * one of the two values alg_choice or alg_list, which give the result
  + * of the variant selection algorithm.  alg_list means that no best
  + * variant was found by the algorithm, alg_choice means that a best
  + * variant was found and should be returned.  The list/choice
  + * terminology comes from TCN (rfc2295), but is used in a more generic
  + * way here.  The best variant is returned in *pbest. best_match has
  + * two possible algorithms for determining the best variant: the
  + * RVSA/1.0 algorithm (from RFC2296), and the standard Apache
  + * algorithm. These are split out into separate functions
  + * (is_variant_better_rvsa() and is_variant_better()).  Selection of
  + * one is through the neg->use_rvsa flag.
  + *
  + * The call to best_match also creates full information, including
  + * language, charset, etc quality for _every_ variant. This is needed
  + * for generating a correct Vary header, and can be used for the
  + * Alternates header, the human-readable list responses and 406 errors.
  + */
  +
  +/* Firstly, the RVSA/1.0 (HTTP Remote Variant Selection Algorithm
  + * v1.0) from rfc2296.  This is the algorithm that goes together with
  + * transparent content negotiation (TCN).
    */
  -
  -static int is_variant_better_na(negotiation_state *neg, var_rec *variant,
  -                                var_rec *best, float *p_bestq)
  +static int is_variant_better_rvsa(negotiation_state *neg, var_rec *variant,
  +                                  var_rec *best, float *p_bestq)
   {
       float bestq = *p_bestq, q;
  -
  -    /* Note: Encoding is not negotiated in the Holtman
  -     * transparent neg draft, so we ignored it here. But
  -     * it does mean we could return encodings the UA
  -     * or proxy cannot handle. Eek. */
   
  -    q = variant->accept_type_quality *
  -        variant->type_quality *
  +    /* TCN does not cover negotiation on content-encoding.  For now,
  +     * we ignore the encoding unless it was explicitly excluded.
  +     */
  +    if (variant->encoding_quality == 0.0f)
  +        return 0;
  +    
  +    q = variant->mime_type_quality *
  +        variant->source_quality *
           variant->charset_quality *
           variant->lang_quality;
   
  +   /* Make sure that variants with a very low nonzero q value
  +    * do not get rounded down to 0
  +    */
  +   if (q <= 0.0f)
  +       q = 0.0f; 
  +   else if (q < 0.00001f)
  +       q = 0.00001f; 
  +
   #ifdef NEG_DEBUG
  -    fprintf(stderr, "Variant: file=%s type=%s lang=%s acceptq=%1.3f "
  -            "langq=%1.3f typeq=%1.3f q=%1.3f definite=%d\n",
  +    fprintf(stderr, "Variant: file=%s type=%s lang=%s sourceq=%1.3f "
  +           "mimeq=%1.3f langq=%1.3f charq=%1.3f encq=%1.3f "
  +           "q=%1.5f definite=%d\n",            
               (variant->file_name ? variant->file_name : ""),
  -            (variant->type_name ? variant->type_name : ""),
  +            (variant->mime_type ? variant->mime_type : ""),
               (variant->content_languages
  -             ? merge_string_array(neg->pool, variant->content_languages, ",")
  +             ? ap_array_pstrcat(neg->pool, variant->content_languages, ',')
                : ""),
  -            variant->accept_type_quality,
  +            variant->source_quality,
  +            variant->mime_type_quality,
               variant->lang_quality,
  -            variant->type_quality,
  +            variant->charset_quality,
  +            variant->encoding_quality,
               q,
               variant->definite);
   #endif
   
  +    if (q == 0.0f) {
  +        return 0;
  +    }
       if (q > bestq) {
           *p_bestq = q;
           return 1;
       }
       if (q == bestq) {
  +        /* If the best variant's encoding is of lesser quality than
  +         * this variant, then we prefer this variant
  +         */
  +        if (variant->encoding_quality > best->encoding_quality) {
  +            *p_bestq = q;
  +            return 1;
  +        }
           /* If the best variant's charset is ISO-8859-1 and this variant has
            * the same charset quality, then we prefer this variant
            */
  @@ -1588,13 +1825,13 @@
    * (just about). 
    */
   
  -static int is_variant_better(negotiation_state *neg, var_rec *variant, var_rec *best, float *p_bestq)
  +static int is_variant_better(negotiation_state *neg, var_rec *variant,
  +                             var_rec *best, float *p_bestq)
   {
       float bestq = *p_bestq, q;
       int levcmp;
   
  -    /*
  -     * For non-transparent negotiation, server can choose how
  +    /* For non-transparent negotiation, server can choose how
        * to handle the negotiation. We'll use the following in
        * order: content-type, language, content-type level, charset,
        * content length.
  @@ -1616,16 +1853,32 @@
       /* First though, eliminate this variant if it is not
        * acceptable by type, charset, encoding or language.
        */
  +
  +#ifdef NEG_DEBUG
  +    fprintf(stderr, "Variant: file=%s type=%s lang=%s sourceq=%1.3f "
  +           "mimeq=%1.3f langq=%1.3f langidx=%d charq=%1.3f encq=%1.3f \n",
  +            (variant->file_name ? variant->file_name : ""),
  +            (variant->mime_type ? variant->mime_type : ""),
  +            (variant->content_languages
  +             ? ap_array_pstrcat(neg->pool, variant->content_languages, ',')
  +             : ""),
  +            variant->source_quality,
  +            variant->mime_type_quality,
  +            variant->lang_quality,
  +            variant->lang_index,
  +            variant->charset_quality,
  +            variant->encoding_quality);
  +#endif
   
  -    if (variant->encoding_quality == 0 ||
  -        variant->lang_quality == 0 ||
  -        variant->type_quality == 0 ||
  -        variant->charset_quality == 0 ||
  -        variant->accept_type_quality == 0) {
  +    if (variant->encoding_quality == 0.0f ||
  +        variant->lang_quality == 0.0f ||
  +        variant->source_quality == 0.0f ||
  +        variant->charset_quality == 0.0f ||
  +        variant->mime_type_quality == 0.0f) {
           return 0;               /* don't consider unacceptables */
       }
   
  -    q = variant->accept_type_quality * variant->type_quality;
  +    q = variant->mime_type_quality * variant->source_quality;
       if (q == 0.0 || q < bestq) {
           return 0;
       }
  @@ -1644,7 +1897,11 @@
       }
   
       /* if language qualities were equal, try the LanguagePriority
  -     * stuff */
  +     * stuff
  +     */
  +    /* XXX: TODO: there is a slight discrepancy between how this
  +     * behaves and how it described in the documentation
  +     */
       if (best->lang_index != -1 && variant->lang_index > best->lang_index) {
           return 0;
       }
  @@ -1654,7 +1911,9 @@
           return 1;
       }
   
  -    /* content-type level (text/html only?) */
  +    /* content-type level (sometimes used with text/html, though we
  +     * support it on other types too)
  +     */
       levcmp = level_cmp(variant, best);
       if (levcmp == -1) {
           return 0;
  @@ -1664,17 +1923,6 @@
           return 1;
       }
   
  -    /* encoding -- can only be 1 or 0, and if 0 we eliminated this
  -     * variant at the start of this function. However we 
  -     * prefer variants with no encoding over those with encoding */
  -    if (best->content_encoding == NULL && variant->content_encoding) {
  -        return 0;
  -    }
  -    if (best->content_encoding && variant->content_encoding == NULL) {
  -        *p_bestq = q;
  -        return 1;
  -    }
  -
       /* charset */
       if (variant->charset_quality < best->charset_quality) {
           return 0;
  @@ -1682,6 +1930,10 @@
       /* If the best variant's charset is ISO-8859-1 and this variant has
        * the same charset quality, then we prefer this variant
        */
  +    /* XXX: TODO: this specific tie-breaker is not described in the
  +     * documentation
  +     */
  +
       if (variant->charset_quality > best->charset_quality ||
           ((variant->content_charset != NULL &&
             *variant->content_charset != '\0' &&
  @@ -1693,6 +1945,15 @@
           return 1;
       }
   
  +    /* Prefer the highest value for encoding_quality.
  +     */
  +    if (variant->encoding_quality < best->encoding_quality) {
  +       return 0;
  +    }
  +    if (variant->encoding_quality > best->encoding_quality) {
  +       *p_bestq = q;
  +       return 1;
  +    }
   
       /* content length if all else equal */
       if (find_content_length(neg, variant) >= find_content_length(neg, best)) {
  @@ -1700,7 +1961,8 @@
       }
   
       /* ok, to get here means every thing turned out equal, except
  -     * we have a shorter content length, so use this variant */
  +     * we have a shorter content length, so use this variant
  +     */
       *p_bestq = q;
       return 1;
   }
  @@ -1710,221 +1972,307 @@
       int j;
       var_rec *best = NULL;
       float bestq = 0.0f;
  -    enum algorithm_results algorithm_result = na_not_applied;
  +    enum algorithm_results algorithm_result;
   
       var_rec *avail_recs = (var_rec *) neg->avail_vars->elts;
   
       set_default_lang_quality(neg);
   
       /*
  -     * Find the 'best' variant
  +     * Find the 'best' variant 
        */
   
       for (j = 0; j < neg->avail_vars->nelts; ++j) {
           var_rec *variant = &avail_recs[j];
   
           /* Find all the relevant 'quality' values from the
  -         * Accept... headers, and store in the variant
  +         * Accept... headers, and store in the variant.  This also
  +         * prepares for sending an Alternates header etc so we need to
  +         * do it even if we do not actually plan to find a best
  +         * variant.  
            */
           set_accept_quality(neg, variant);
           set_language_quality(neg, variant);
           set_encoding_quality(neg, variant);
           set_charset_quality(neg, variant);
   
  -        /* Now find out if this variant is better than the current
  -         * best, either using the network algorithm, or Apache's
  -         * internal server-driven algorithm. Presumably other
  -         * server-driven algorithms are possible, and could be
  -         * implemented here.
  +        /* Only do variant selection if we may actually choose a
  +         * variant for the client 
            */
  +        if (neg->may_choose) {
   
  -        if (neg->use_transparent_neg) {
  -            if (is_variant_better_na(neg, variant, best, &bestq)) {
  -                best = variant;
  +            /* Now find out if this variant is better than the current
  +             * best, either using the RVSA/1.0 algorithm, or Apache's
  +             * internal server-driven algorithm. Presumably other
  +             * server-driven algorithms are possible, and could be
  +             * implemented here.
  +             */
  +     
  +            if (neg->use_rvsa) {
  +                if (is_variant_better_rvsa(neg, variant, best, &bestq)) {
  +                    best = variant;
  +                }
               }
  -        }
  -        else {
  -            if (is_variant_better(neg, variant, best, &bestq)) {
  -                best = variant;
  +            else {
  +                if (is_variant_better(neg, variant, best, &bestq)) {
  +                    best = variant;
  +                }
               }
           }
       }
   
  -    /* We now either have a best variant, or no best variant 
  -     */
  -    if (neg->use_transparent_neg) {
  -        if (neg->short_accept_headers) {
  -            algorithm_result = na_list;
  -        }
  -        else {
  -            /* From Holtman, result is:
  -             *   If variant & URI are not neigbors, list_ua or list_os
  -             *   Else
  -             *     If UA can do trans neg
  -             *        IF best is definite && best q > 0, choice_ua 
  -             *        ELSE                               list_ua
  -             *     ELSE
  -             *        IF best q > 0, choose_os
  -             *        ELSE           list_os (or forward_os on proxy)
  -             */
  -
  -            /* assume variant and URI are neigbors (since URI in
  -             * var map must be in same directory) */
  +    /* We now either have a best variant, or no best variant */
   
  -            if (neg->use_transparent_neg) {
  -                algorithm_result = (best && best->definite) && (bestq > 0)
  -                    ? na_choice : na_list;
  -            }
  -            else {
  -                algorithm_result = bestq > 0 ? na_choice : na_list;
  -            }
  -        }
  +    if (neg->use_rvsa)    {
  +        /* calculate result for RVSA/1.0 algorithm:
  +         * only a choice response if the best variant has q>0
  +         * and is definite
  +         */
  +        algorithm_result = (best && best->definite) && (bestq > 0) ?
  +                           alg_choice : alg_list;
       }
  +    else {
  +        /* calculate result for Apache negotiation algorithm */
  +        algorithm_result = bestq > 0 ? alg_choice : alg_list;        
  +    }
   
  +    /* Returning a choice response with a non-neighboring variant is a
  +     * protocol security error in TCN (see rfc2295).  We do *not*
  +     * verify here that the variant and URI are neighbors, even though
  +     * we may return alg_choice.  We depend on the environment (the
  +     * caller) to only declare the resource transparently negotiable if
  +     * all variants are neighbors.
  +     */
       *pbest = best;
       return algorithm_result;
   }
   
  -/*
  - * Sets the Alternates and Vary headers, used if we are going to
  - * return 406 Not Acceptable status, a 300 Multiple Choice status,
  - * or a Choice response.
  - *
  - * 'type' is the result of the network algorithm, if applied.
  - * We do different things if the network algorithm was not applied
  - * (type == na_not_applied): no Alternates header, and Vary:
  - * does not include 'negotiate'.
  - *
  - * We should also add a max-age lifetime for the Alternates header,
  - * but how long we we give it? Presumably this should be
  - * configurable in the map file.
  +/* Sets response headers for a negotiated response.
  + * neg->is_transparent determines whether a transparently negotiated
  + * response or a plain `server driven negotiation' response is
  + * created.   Applicable headers are Alternates, Vary, and TCN.
  + *
  + * The Vary header we create is sometimes longer than is required for
  + * the correct caching of negotiated results by HTTP/1.1 caches.  For
  + * example if we have 3 variants x.html, x.ps.en and x.ps.nl, and if
  + * the Accept: header assigns a 0 quality to .ps, then the results of
  + * the two server-side negotiation algorithms we currently implement
  + * will never depend on Accept-Language so we could return `Vary:
  + * negotiate, accept' instead of the longer 'Vary: negotiate, accept,
  + * accept-language' which the code below will return.  A routine for
  + * computing the exact minimal Vary header would be a huge pain to code
  + * and maintain though, especially because we need to take all possible
  + * twiddles in the server-side negotiation algorithms into account.
    */
  -
   static void set_neg_headers(request_rec *r, negotiation_state *neg,
  -                            int na_result)
  +                            int alg_result)
   {
  -    int j;
  +    table *hdrs;
       var_rec *avail_recs = (var_rec *) neg->avail_vars->elts;
  -    char *sample_type = NULL;
  -    char *sample_language = NULL;
  +    const char *sample_type = NULL;
  +    const char *sample_language = NULL;
       const char *sample_encoding = NULL;
  -    char *sample_charset = NULL;
  +    const char *sample_charset = NULL;
  +    char *lang;
  +    char *qstr;
  +    char *lenstr;
  +    long len;
  +    array_header *arr;
  +    int max_vlist_array = (neg->avail_vars->nelts * 21);
  +    int first_variant = 1;
       int vary_by_type = 0;
       int vary_by_language = 0;
       int vary_by_charset = 0;
       int vary_by_encoding = 0;
  -    table *hdrs;
  +    int j;
  +
  +    /* In order to avoid O(n^2) memory copies in building Alternates,
  +     * we preallocate a table with the maximum substrings possible,
  +     * fill it with the variant list, and then concatenate the entire array.
  +     * Note that if you change the number of substrings pushed, you also
  +     * need to change the calculation of max_vlist_array above.
  +     */
  +    if (neg->send_alternates && neg->avail_vars->nelts)
  +        arr = ap_make_array(r->pool, max_vlist_array, sizeof(char *));
  +    else
  +        arr = NULL;
   
  -    /* Put headers into err_headers_out, new send_http_header()
  -     * outputs both headers_out and err_headers_out */
  +    /* Put headers into err_headers_out, since send_http_header()
  +     * outputs both headers_out and err_headers_out.
  +     */
       hdrs = r->err_headers_out;
   
       for (j = 0; j < neg->avail_vars->nelts; ++j) {
           var_rec *variant = &avail_recs[j];
  -        char *rec;
  -        char qstr[6];
  -        long len;
  -        char lenstr[22];        /* enough for 2^64 */
  -
  -        ap_snprintf(qstr, sizeof(qstr), "%1.3f", variant->type_quality);
   
  -        /* Strip trailing zeros (saves those valuable network bytes) */
  -        if (qstr[4] == '0') {
  -            qstr[4] = '\0';
  -            if (qstr[3] == '0') {
  -                qstr[3] = '\0';
  -                if (qstr[2] == '0') {
  -                    qstr[1] = '\0';
  -                }
  -            }
  +        if (variant->content_languages && variant->content_languages->nelts) {
  +            lang = ap_array_pstrcat(r->pool, variant->content_languages, ',');
  +        }
  +        else {
  +            lang = NULL;
           }
   
  -        rec = ap_pstrcat(r->pool, "{\"", variant->file_name, "\" ", qstr, NULL);
  -        if (variant->type_name) {
  -            if (*variant->type_name) {
  -                rec = ap_pstrcat(r->pool, rec, " {type ",
  -                              variant->type_name, "}", NULL);
  -            }
  -            if (!sample_type) {
  -                sample_type = variant->type_name;
  -            }
  -            else if (strcmp(sample_type, variant->type_name)) {
  +        /* Calculate Vary by looking for any difference between variants */
  +
  +        if (first_variant) {
  +            sample_type     = variant->mime_type;
  +            sample_charset  = variant->content_charset;
  +            sample_language = lang;
  +            sample_encoding = variant->content_encoding;
  +        }
  +        else {
  +            if (!vary_by_type &&
  +                strcmp(sample_type ? sample_type : "", 
  +                       variant->mime_type ? variant->mime_type : "")) {
                   vary_by_type = 1;
               }
  -        }
  -        if (variant->content_languages && variant->content_languages->nelts) {
  -            char *langs = merge_string_array(r->pool,
  -                                           variant->content_languages, ",");
  -            rec = ap_pstrcat(r->pool, rec, " {language ", langs, "}", NULL);
  -            if (!sample_language) {
  -                sample_language = langs;
  +            if (!vary_by_charset &&
  +                strcmp(sample_charset ? sample_charset : "",
  +                       variant->content_charset ?
  +                       variant->content_charset : "")) {
  +                vary_by_charset = 1;
               }
  -            else if (strcmp(sample_language, langs)) {
  +            if (!vary_by_language &&
  +                strcmp(sample_language ? sample_language : "", 
  +                       lang ? lang : "")) {
                   vary_by_language = 1;
  -            }
  -        }
  -        if (variant->content_encoding) {
  -            if (!sample_encoding) {
  -                sample_encoding = variant->content_encoding;
               }
  -            else if (strcmp(sample_encoding, variant->content_encoding)) {
  +            if (!vary_by_encoding &&
  +                strcmp(sample_encoding ? sample_encoding : "",
  +                       variant->content_encoding ? 
  +                       variant->content_encoding : "")) {
                   vary_by_encoding = 1;
               }
           }
  -        if (variant->content_charset) {
  -            if (*variant->content_charset) {
  -                rec = ap_pstrcat(r->pool, rec, " {charset ",
  -                              variant->content_charset, "}", NULL);
  -            }
  -            if (!sample_charset) {
  -                sample_charset = variant->content_charset;
  -            }
  -            else if (strcmp(sample_charset, variant->content_charset)) {
  -                vary_by_charset = 1;
  +        first_variant = 0;
  +
  +        if (!neg->send_alternates)
  +            continue;
  +
  +        /* Generate the string components for this Alternates entry */
  +
  +        *((const char **) ap_push_array(arr)) = "{\"";
  +        *((const char **) ap_push_array(arr)) = variant->file_name;
  +        *((const char **) ap_push_array(arr)) = "\" ";
  +
  +        qstr = (char *) ap_palloc(r->pool, 6);
  +        ap_snprintf(qstr, 6, "%1.3f", variant->source_quality);
  +
  +        /* Strip trailing zeros (saves those valuable network bytes) */
  +        if (qstr[4] == '0') {
  +            qstr[4] = '\0';
  +            if (qstr[3] == '0') {
  +                qstr[3] = '\0';
  +                if (qstr[2] == '0') {
  +                    qstr[1] = '\0';
  +                }
               }
           }
  -        if ((len = find_content_length(neg, variant)) != 0) {
  -            ap_snprintf(lenstr, sizeof(lenstr), "%ld", len);
  -            rec = ap_pstrcat(r->pool, rec, " {length ", lenstr, "}", NULL);
  +        *((const char **) ap_push_array(arr)) = qstr;
  +
  +        if (variant->mime_type && *variant->mime_type) {
  +            *((const char **) ap_push_array(arr)) = " {type ";
  +            *((const char **) ap_push_array(arr)) = variant->mime_type;
  +            *((const char **) ap_push_array(arr)) = "}";
           }
  +        if (variant->content_charset && *variant->content_charset) {
  +            *((const char **) ap_push_array(arr)) = " {charset ";
  +            *((const char **) ap_push_array(arr)) = variant->content_charset;
  +            *((const char **) ap_push_array(arr)) = "}";
  +        }
  +        if (lang) {
  +            *((const char **) ap_push_array(arr)) = " {language ";
  +            *((const char **) ap_push_array(arr)) = lang;
  +            *((const char **) ap_push_array(arr)) = "}";
  +        }
  +        if (variant->content_encoding && *variant->content_encoding) {
  +            /* Strictly speaking, this is non-standard, but so is TCN */
  +
  +            *((const char **) ap_push_array(arr)) = " {encoding ";
  +            *((const char **) ap_push_array(arr)) = variant->content_encoding;
  +            *((const char **) ap_push_array(arr)) = "}";
  +        }
  +
  +        /* Note that the Alternates specification (in rfc2295) does
  +         * not require that we include {length x}, so we could omit it
  +         * if determining the length is too expensive.  We currently
  +         * always include it though.  22 bytes is enough for 2^64.
  +         *
  +         * If the variant is a CGI script, find_content_length would
  +         * return the length of the script, not the output it
  +         * produces, so we check for the presence of a handler and if
  +         * there is one we don't add a length.
  +         * 
  +         * XXX: TODO: This check does not detect a CGI script if we
  +         * get the variant from a type map.  This needs to be fixed
  +         * (without breaking things if the type map specifies a
  +         * content-length, which currently leads to the correct result).
  +         */
  +        if (!(variant->sub_req && variant->sub_req->handler)
  +            && (len = find_content_length(neg, variant)) != 0) {
   
  -        rec = ap_pstrcat(r->pool, rec, "}", NULL);
  +            lenstr = (char *) ap_palloc(r->pool, 22);
  +            ap_snprintf(lenstr, 22, "%ld", len);
  +            *((const char **) ap_push_array(arr)) = " {length ";
  +            *((const char **) ap_push_array(arr)) = lenstr;
  +            *((const char **) ap_push_array(arr)) = "}";
  +        }
  +      
  +        *((const char **) ap_push_array(arr)) = "}";
  +        *((const char **) ap_push_array(arr)) = ", "; /* trimmed below */
  +    }
  +
  +    if (neg->send_alternates && neg->avail_vars->nelts) {
  +        arr->nelts--;                                 /* remove last comma */
  +        ap_table_mergen(hdrs, "Alternates",
  +                        ap_array_pstrcat(r->pool, arr, '\0'));
  +    } 
  +
  +    /* Theoretically the negotiation result _always_ has a dependence on
  +     * the contents of the Accept header because we do 'mxb='
  +     * processing in set_accept_quality().  However, variations in mxb
  +     * only affect the relative quality of several acceptable variants,
  +     * so there is no reason to worry about an unacceptable variant
  +     * being mistakenly prioritized.  We therefore ignore mxb in deciding
  +     * whether or not to include Accept in the Vary field value.
  +     */
  +    if (neg->is_transparent || vary_by_type || vary_by_language ||
  +        vary_by_language || vary_by_charset || vary_by_encoding) {
   
  -        if (na_result != na_not_applied) {
  -            ap_table_mergen(hdrs, "Alternates", rec);
  -        }
  +        ap_table_mergen(hdrs, "Vary", 2 + ap_pstrcat(r->pool,
  +            neg->is_transparent ? ", negotiate"       : "",
  +            vary_by_type        ? ", accept"          : "",
  +            vary_by_language    ? ", accept-language" : "",
  +            vary_by_charset     ? ", accept-charset"  : "",
  +            vary_by_encoding    ? ", accept-encoding" : "", NULL));
       }
   
  -    if (na_result != na_not_applied) {
  -        ap_table_mergen(hdrs, "Vary", "negotiate");
  -    }
  -    if (vary_by_type) {
  -        ap_table_mergen(hdrs, "Vary", "accept");
  -    }
  -    if (vary_by_language) {
  -        ap_table_mergen(hdrs, "Vary", "accept-language");
  +    if (neg->is_transparent) { /* Create TCN response header */
  +        ap_table_setn(hdrs, "TCN",
  +                      alg_result == alg_list ? "list" : "choice");
       }
  -    if (vary_by_charset) {
  -        ap_table_mergen(hdrs, "Vary", "accept-charset");
  -    }
  -    if (vary_by_encoding && na_result == na_not_applied) {
  -        ap_table_mergen(hdrs, "Vary", "accept-encoding");
  -    }
   }
   
   /**********************************************************************
    *
    * Return an HTML list of variants. This is output as part of the
  - * 300 or 406 status body.
  + * choice response or 406 status body.
    */
   
  -/* XXX: this is disgusting, this has O(n^2) behaviour! -djg */
   static char *make_variant_list(request_rec *r, negotiation_state *neg)
   {
  +    array_header *arr;
       int i;
  -    char *t;
  +    int max_vlist_array = (neg->avail_vars->nelts * 15) + 2;
  +
  +    /* In order to avoid O(n^2) memory copies in building the list,
  +     * we preallocate a table with the maximum substrings possible,
  +     * fill it with the variant list, and then concatenate the entire array.
  +     */
  +    arr = ap_make_array(r->pool, max_vlist_array, sizeof(char *));
   
  -    t = ap_pstrdup(r->pool, "Available variants:\n<ul>\n");
  +    *((const char **) ap_push_array(arr)) = "Available variants:\n<ul>\n";
  +
       for (i = 0; i < neg->avail_vars->nelts; ++i) {
           var_rec *variant = &((var_rec *) neg->avail_vars->elts)[i];
           char *filename = variant->file_name ? variant->file_name : "";
  @@ -1932,27 +2280,39 @@
           char *description = variant->description ? variant->description : "";
   
           /* The format isn't very neat, and it would be nice to make
  -         * the tags human readable (eg replace 'language en' with
  -         * 'English'). */
  -        t = ap_pstrcat(r->pool, t, "<li><a href=\"", filename, "\">",
  -                    filename, "</a> ", description, NULL);
  -        if (variant->type_name && *variant->type_name) {
  -            t = ap_pstrcat(r->pool, t, ", type ", variant->type_name, NULL);
  +         * the tags human readable (eg replace 'language en' with 'English').
  +         * Note that if you change the number of substrings pushed, you also
  +         * need to change the calculation of max_vlist_array above.
  +         */
  +        *((const char **) ap_push_array(arr)) = "<li><a href=\"";
  +        *((const char **) ap_push_array(arr)) = filename;
  +        *((const char **) ap_push_array(arr)) = "\">";
  +        *((const char **) ap_push_array(arr)) = filename;
  +        *((const char **) ap_push_array(arr)) = "</a> ";
  +        *((const char **) ap_push_array(arr)) = description;
  +
  +        if (variant->mime_type && *variant->mime_type) {
  +            *((const char **) ap_push_array(arr)) = ", type ";
  +            *((const char **) ap_push_array(arr)) = variant->mime_type;
           }
           if (languages && languages->nelts) {
  -            t = ap_pstrcat(r->pool, t, ", language ",
  -                        merge_string_array(r->pool, languages, ", "),
  -                        NULL);
  +            *((const char **) ap_push_array(arr)) = ", language ";
  +            *((const char **) ap_push_array(arr)) = ap_array_pstrcat(r->pool,
  +                                                       languages, ',');
           }
           if (variant->content_charset && *variant->content_charset) {
  -            t = ap_pstrcat(r->pool, t, ", charset ", variant->content_charset,
  -                        NULL);
  +            *((const char **) ap_push_array(arr)) = ", charset ";
  +            *((const char **) ap_push_array(arr)) = variant->content_charset;
  +        }
  +        if (variant->content_encoding) {
  +            *((const char **) ap_push_array(arr)) = ", encoding ";
  +            *((const char **) ap_push_array(arr)) = variant->content_encoding;
           }
  -        t = ap_pstrcat(r->pool, t, "\n", NULL);
  +        *((const char **) ap_push_array(arr)) = "\n";
       }
  -    t = ap_pstrcat(r->pool, t, "</ul>\n", NULL);
  +    *((const char **) ap_push_array(arr)) = "</ul>\n";
   
  -    return t;
  +    return ap_array_pstrcat(r->pool, arr, '\0');
   }
   
   static void store_variant_list(request_rec *r, negotiation_state *neg)
  @@ -1962,17 +2322,18 @@
       }
       else {
           ap_table_setn(r->main->notes, "variant-list",
  -                  make_variant_list(r->main, neg));
  +                      make_variant_list(r->main, neg));
       }
   }
   
  -/* Called if we got a "Choice" response from the network algorithm.
  +/* Called if we got a "Choice" response from the variant selection algorithm.
    * It checks the result of the chosen variant to see if it
    * is itself negotiated (if so, return error VARIANT_ALSO_VARIES).
    * Otherwise, add the appropriate headers to the current response.
    */
   
  -static int setup_choice_response(request_rec *r, negotiation_state *neg, var_rec *variant)
  +static int setup_choice_response(request_rec *r, negotiation_state *neg,
  +                                 var_rec *variant)
   {
       request_rec *sub_req;
       const char *sub_vary;
  @@ -1982,7 +2343,9 @@
   
           sub_req = ap_sub_req_lookup_file(variant->file_name, r);
           status = sub_req->status;
  -        if (status != HTTP_OK && status != HTTP_MULTIPLE_CHOICES) {
  +
  +        if (status != HTTP_OK && 
  +            !ap_table_get(sub_req->err_headers_out, "TCN")) {
               ap_destroy_sub_req(sub_req);
               return status;
           }
  @@ -1992,28 +2355,90 @@
           sub_req = variant->sub_req;
       }
   
  -    /* The network algorithm told us to return a "Choice"
  +    /* The variant selection algorithm told us to return a "Choice"
        * response. This is the normal variant response, with
        * some extra headers. First, ensure that the chosen
  -     * variant did not itself return a "List" or "Choice" response.
  +     * variant did or will not itself engage in transparent negotiation.
        * If not, set the appropriate headers, and fall through to
        * the normal variant handling 
        */
   
  -    if ((sub_req->status == HTTP_MULTIPLE_CHOICES) ||
  -        (ap_table_get(sub_req->err_headers_out, "Alternates")) ||
  -        (ap_table_get(sub_req->err_headers_out, "Content-Location"))) {
  +    /* This catches the error that a transparent type map selects a
  +     * transparent multiviews resource as the best variant.
  +     *
  +     * XXX: We do not signal an error if a transparent type map
  +     * selects a _non_transparent multiviews resource as the best
  +     * variant, because we can generate a legal negotiation response
  +     * in this case.  In this case, the vlist_validator of the
  +     * nontransparent subrequest will be lost however.  This could
  +     * lead to cases in which a change in the set of variants or the
  +     * negotiation algorithm of the nontransparent resource is never
  +     * propagated up to a HTTP/1.1 cache which interprets Vary.  To be
  +     * completely on the safe side we should return VARIANT_ALSO_VARIES
  +     * for this type of recursive negotiation too.
  +     */
  +    if (neg->is_transparent &&
  +        ap_table_get(sub_req->err_headers_out, "TCN")) {
           return VARIANT_ALSO_VARIES;
       }
   
  +    /* This catches the error that a transparent type map recursively
  +     * selects, as the best variant, another type map which itself
  +     * causes transparent negotiation to be done.
  +     *
  +     * XXX: Actually, we catch this error by catching all cases of
  +     * type map recursion.  There are some borderline recursive type
  +     * map arrangements which would not produce transparent
  +     * negotiation protocol errors or lack of cache propagation
  +     * problems, but such arrangements are very hard to detect at this
  +     * point in the control flow, so we do not bother to single them
  +     * out.
  +     *
  +     * Recursive type maps imply a recursive arrangement of negotiated
  +     * resources which is visible to outside clients, and this is not
  +     * supported by the transparent negotiation caching protocols, so
  +     * if we are to have generic support for recursive type maps, we
  +     * have to create some configuration setting which makes all type
  +     * maps non-transparent when recursion is enabled.  Also, if we
  +     * want recursive type map support which ensures propagation of
  +     * type map changes into HTTP/1.1 caches that handle Vary, we
  +     * would have to extend the current mechanism for generating
  +     * variant list validators.
  +     */
  +    if (sub_req->handler && strcmp(sub_req->handler, "type-map") == 0) {
  +        return VARIANT_ALSO_VARIES;
  +    }
  +
  +    /* This adds an appropriate Variant-Vary header if the subrequest
  +     * is a multiviews resource.
  +     *
  +     * XXX: TODO: Note that this does _not_ handle any Vary header
  +     * returned by a CGI if sub_req is a CGI script, because we don't
  +     * see that Vary header yet at this point in the control flow.
  +     * This won't cause any cache consistency problems _unless_ the
  +     * CGI script also returns a Cache-Control header marking the
  +     * response as cachable.  This needs to be fixed, also there are
  +     * problems if a CGI returns an Etag header which also need to be
  +     * fixed.
  +     */
       if ((sub_vary = ap_table_get(sub_req->err_headers_out, "Vary")) != NULL) {
           ap_table_setn(r->err_headers_out, "Variant-Vary", sub_vary);
  +
  +        /* Move the subreq Vary header into the main request to
  +         * prevent having two Vary headers in the response, which
  +         * would be legal but strange.
  +         */
  +        ap_table_setn(r->err_headers_out, "Vary", sub_vary);
  +        ap_table_unset(sub_req->err_headers_out, "Vary");
       }
  +    
       ap_table_setn(r->err_headers_out, "Content-Location",
  -		ap_pstrdup(r->pool, variant->file_name));
  -    set_neg_headers(r, neg, na_choice);         /* add Alternates and Vary */
  -    /* to do: add Expires */
  +                  ap_pstrdup(r->pool, variant->file_name));
  +
  +    set_neg_headers(r, neg, alg_choice);         /* add Alternates and Vary */
   
  +    /* Still to do by caller: add Expires */
  +
       return 0;
   }
   
  @@ -2022,69 +2447,167 @@
    * Executive...
    */
   
  -static int handle_map_file(request_rec *r)
  +static int do_negotiation(request_rec *r, negotiation_state *neg, 
  +                          var_rec **bestp, int prefer_scripts) 
   {
  -    negotiation_state *neg = parse_accept_headers(r);
  -    var_rec *best;
  +    var_rec *avail_recs = (var_rec *) neg->avail_vars->elts;
  +    int alg_result;              /* result of variant selection algorithm */
       int res;
  -    int na_result;
  +    int j;
   
  -    char *udir;
  +    /* Decide if resource is transparently negotiable */
   
  -    if ((res = read_type_map(neg, r))) {
  -        return res;
  +    /* GET or HEAD? (HEAD has same method number as GET) */
  +    if (r->method_number == M_GET) {
  +
  +        /* maybe this should be configurable, see also the comment
  +         * about recursive type maps in setup_choice_response()
  +         */
  +        neg->is_transparent = 1;       
  +
  +        /* We can't be transparent if we are a map file in the middle
  +         * of the request URI.
  +         */
  +        if (r->path_info && *r->path_info)
  +            neg->is_transparent = 0;
  +
  +        for (j = 0; j < neg->avail_vars->nelts; ++j) {
  +            var_rec *variant = &avail_recs[j];
  +
  +            /* We can't be transparent, because of internal
  +             * assumptions in best_match(), if there is a
  +             * non-neighboring variant.  We can have a non-neighboring
  +             * variant when processing a type map.  
  +             */
  +            if (strchr(variant->file_name, '/'))
  +                neg->is_transparent = 0;
  +        }
  +    }
  +
  +    if (neg->is_transparent)  {
  +        parse_negotiate_header(r, neg);
  +    }
  +    else { /* configure negotiation on non-transparent resource */
  +        neg->may_choose = 1;
       }
   
  -    maybe_add_default_encodings(neg, 0);
  +    maybe_add_default_accepts(neg, prefer_scripts);
   
  -    na_result = best_match(neg, &best);
  +    alg_result = best_match(neg, bestp);
   
  -    /* na_result is one of
  -     *   na_not_applied: we didn't use the network algorithm
  -     *   na_choice: return a "Choice" response
  -     *   na_list: return a "List" response (no variant chosen)
  +    /* alg_result is one of
  +     *   alg_choice: a best variant is chosen
  +     *   alg_list: no best variant is chosen
        */
  +
  +    if (alg_result == alg_list) {
  +        /* send a list response or NOT_ACCEPTABLE error response  */
   
  -    if (na_result == na_list) {
  -        set_neg_headers(r, neg, na_list);
  +        neg->send_alternates = 1; /* always include Alternates header */
  +        set_neg_headers(r, neg, alg_result); 
           store_variant_list(r, neg);
  -        return MULTIPLE_CHOICES;
  +
  +        if (neg->is_transparent && neg->ua_supports_trans) {
  +            /* XXX todo: expires? cachability? */
  +            
  +            /* Some HTTP/1.0 clients are known to choke when they get
  +             * a 300 (multiple choices) response without a Location
  +             * header.  However the 300 code response we are are about
  +             * to generate will only reach 1.0 clients which support
  +             * transparent negotiation, and they should be OK. The
  +             * response should never reach older 1.0 clients, even if
  +             * we have CacheNegotiatedDocs enabled, because no 1.0
  +             * proxy cache (we know of) will cache and return 300
  +             * responses (they certainly won't if they conform to the
  +             * HTTP/1.0 specification).
  +             */
  +            return MULTIPLE_CHOICES;
  +        }
  +        
  +        if (!*bestp) {
  +            ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  +                          "no acceptable variant: %s", r->filename);
  +            return NOT_ACCEPTABLE;
  +        }
       }
   
  -    if (!best) {
  -        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -                    "no acceptable variant: %s", r->filename);
  +    /* Variant selection chose a variant */
   
  -        set_neg_headers(r, neg, na_result);
  -        store_variant_list(r, neg);
  -        return NOT_ACCEPTABLE;
  -    }
  +    /* XXX todo: merge the two cases in the if statement below */
  +    if (neg->is_transparent) {
   
  -    if (na_result == na_choice) {
  -        if ((res = setup_choice_response(r, neg, best)) != 0) {
  -            return res;
  +        if ((res = setup_choice_response(r, neg, *bestp)) != 0) {
  +            return res; /* return if error */
           }
       }
  +    else {
  +        set_neg_headers(r, neg, alg_result);
  +    }
   
       /* Make sure caching works - Vary should handle HTTP/1.1, but for
  -     * HTTP/1.0, we can't allow caching at all. NB that we merge the
  -     * header in case some other module negotiates on something else.
  +     * HTTP/1.0, we can't allow caching at all.
  +     */
  +
  +    /* XXX: Note that we only set r->no_cache to 1, which causes
  +     * Expires: <now> to be added, when responding to a HTTP/1.0
  +     * client.  If we return the response to a 1.1 client, we do not
  +     * add Expires <now>, because doing so would degrade 1.1 cache
  +     * performance by preventing re-use of the response without prior
  +     * revalidation.  On the other hand, if the 1.1 client is a proxy
  +     * which was itself contacted by a 1.0 client, or a proxy cache
  +     * which can be contacted later by 1.0 clients, then we currently
  +     * rely on this 1.1 proxy to add the Expires: <now> when it
  +     * forwards the response.
  +     *
  +     * XXX: TODO: Find out if the 1.1 spec requires proxies and
  +     * tunnels to add Expires: <now> when forwarding the response to
  +     * 1.0 clients.  I (kh) recall it is rather vague on this point.
  +     * Testing actual 1.1 proxy implementations would also be nice. If
  +     * Expires: <now> is not added by proxies then we need to always
  +     * include Expires: <now> ourselves to ensure correct caching, but
  +     * this would degrade HTTP/1.1 cache efficiency unless we also add
  +     * Cache-Control: max-age=N, which we currently don't.
  +     *
  +     * Roy: No, we are not going to screw over HTTP future just to
  +     *      ensure that people who can't be bothered to upgrade their
  +     *      clients will always receive perfect server-side negotiation.
  +     *      Hell, those clients are sending bogus accept headers anyway.
  +     *
  +     *      Manual setting of cache-control/expires always overrides this
  +     *      automated kluge, on purpose.
        */
  -    if (!do_cache_negotiated_docs(r->server) && (r->proto_num < HTTP_VERSION(1,1))) {
  +    
  +    if ((!do_cache_negotiated_docs(r->server)
  +         && (r->proto_num < HTTP_VERSION(1,1)))        
  +         && neg->count_multiviews_variants != 1) {
           r->no_cache = 1;
       }
  +
  +    return OK;
  +}
   
  -    if (na_result == na_not_applied) {
  -        set_neg_headers(r, neg, na_not_applied);
  +static int handle_map_file(request_rec *r)
  +{
  +    negotiation_state *neg = parse_accept_headers(r);
  +    var_rec *best;
  +    int res;
  +
  +    char *udir;
  +
  +    if ((res = read_type_map(neg, r))) {
  +        return res;
       }
   
  +    res = do_negotiation(r, neg, &best, 0);
  +    if (res != 0) return res;
  +
       if (r->path_info && *r->path_info) {
           r->uri[ap_find_path_info(r->uri, r->path_info)] = '\0';
       }
       udir = ap_make_dirstr_parent(r->pool, r->uri);
  -    udir = escape_uri(r->pool, udir);
  -    ap_internal_redirect(ap_pstrcat(r->pool, udir, best->file_name, r->path_info,
  -                              NULL), r);
  +    udir = ap_escape_uri(r->pool, udir);
  +    ap_internal_redirect(ap_pstrcat(r->pool, udir, best->file_name,
  +                                    r->path_info, NULL), r);
       return OK;
   }
   
  @@ -2095,7 +2618,6 @@
       request_rec *sub_req;
       int res;
       int j;
  -    int na_result;              /* result of network algorithm */
   
       if (r->finfo.st_mode != 0 || !(ap_allow_options(r) & OPT_MULTI)) {
           return DECLINED;
  @@ -2119,40 +2641,11 @@
           return DECLINED;
       }
   
  -    maybe_add_default_encodings(neg,
  -                                (r->method_number != M_GET) ||
  -                                r->args || r->path_info);
  -
  -    na_result = best_match(neg, &best);
  -    if (na_result == na_list) {
  -        /*
  -         * Network algorithm tols us to output a "List" response.
  -         * This is output at a 300 status code, which we will
  -         * return. The list of variants will be stored in r->notes
  -         * under the name "variants-list".
  -         */
  -        set_neg_headers(r, neg, na_list);       /* set Alternates: and Vary: */
  -
  -        store_variant_list(r, neg);
  -        res = MULTIPLE_CHOICES;
  +    res = do_negotiation(r, neg, &best,
  +                         (r->method_number != M_GET) || r->args ||
  +                         (r->path_info && *r->path_info));
  +    if (res != 0)
           goto return_from_multi;
  -    }
  -
  -    if (!best) {
  -        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
  -                    "no acceptable variant: %s", r->filename);
  -
  -        set_neg_headers(r, neg, na_result);
  -        store_variant_list(r, neg);
  -        res = NOT_ACCEPTABLE;
  -        goto return_from_multi;
  -    }
  -
  -    if (na_result == na_choice) {
  -        if ((res = setup_choice_response(r, neg, best)) != 0) {
  -            goto return_from_multi;
  -        }
  -    }
   
       if (!(sub_req = best->sub_req)) {
           /* We got this out of a map file, so we don't actually have
  @@ -2167,7 +2660,7 @@
           }
       }
   
  -    /* BLETCH --- don't multi-resolve non-ordinary files */
  +    /* BLECH --- don't multi-resolve non-ordinary files */
   
       if (!S_ISREG(sub_req->finfo.st_mode)) {
           res = NOT_FOUND;
  @@ -2176,15 +2669,6 @@
   
       /* Otherwise, use it. */
   
  -    if ((!do_cache_negotiated_docs(r->server) && (r->proto_num < HTTP_VERSION(1,1)))
  -        && neg->count_multiviews_variants != 1) {
  -        r->no_cache = 1;
  -    }
  -
  -    if (na_result == na_not_applied) {
  -        set_neg_headers(r, neg, na_not_applied);
  -    }
  -
       /* now do a "fast redirect" ... promote the sub_req into the main req */
       /* We need to tell POOL_DEBUG that we're guaranteeing that sub_req->pool
        * will exist as long as r->pool.  Otherwise we run into troubles because
  @@ -2192,6 +2676,7 @@
        * sub_req->pool.
        */
       ap_pool_join(r->pool, sub_req->pool);
  +    r->mtime = 0; /* reset etag info for subrequest */
       r->filename = sub_req->filename;
       r->handler = sub_req->handler;
       r->content_type = sub_req->content_type;
  @@ -2218,7 +2703,8 @@
       return OK;
   }
   
  -/* There is a problem with content-encoding, as some clients send and
  +/********************************************************************** 
  + * There is a problem with content-encoding, as some clients send and
    * expect an x- token (e.g. x-gzip) while others expect the plain token
    * (i.e. gzip). To try and deal with this as best as possible we do
    * the following: if the client sent an Accept-Encoding header and it
  @@ -2247,13 +2733,16 @@
       if (enc[0] == 'x' && enc[1] == '-') {
           enc += 2;
       }
  +
  +    if ((accept_encodings = do_header_line(r->pool,
  +             ap_table_get(r->headers_in, "Accept-Encoding"))) == NULL) {
  +        return DECLINED;
  +    }
   
  -    accept_encodings = do_header_line(r->pool,
  -                                ap_table_get(r->headers_in, "Accept-encoding"));
       accept_recs = (accept_rec *) accept_encodings->elts;
   
       for (i = 0; i < accept_encodings->nelts; ++i) {
  -        char *name = accept_recs[i].type_name;
  +        char *name = accept_recs[i].name;
   
           if (!strcmp(name, enc)) {
               r->content_encoding = name;
  @@ -2284,7 +2773,7 @@
   {
       STANDARD_MODULE_STUFF,
       NULL,                       /* initializer */
  -    create_neg_dir_config,      /* dir config creater */
  +    create_neg_dir_config,      /* dir config creator */
       merge_neg_dir_configs,      /* dir merger --- default is to override */
       NULL,                       /* server config */
       NULL,                       /* merge server config */
  
  
  
  1.2       +53 -20    apache-apr/pthreads/src/modules/standard/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_rewrite.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_rewrite.c	1999/01/21 23:08:38	1.1
  +++ mod_rewrite.c	1999/02/07 06:29:55	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -501,6 +501,12 @@
           else if (strcmp(a2+4, "toupper") == 0) {
               new->func = rewrite_mapfunc_toupper;
           }
  +        else if (strcmp(a2+4, "escape") == 0) {
  +            new->func = rewrite_mapfunc_escape;
  +        }
  +        else if (strcmp(a2+4, "unescape") == 0) {
  +            new->func = rewrite_mapfunc_unescape;
  +        }
           else if (sconf->state == ENGINE_ENABLED) {
               return ap_pstrcat(cmd->pool, "RewriteMap: internal map not found:",
                                 a2+4, NULL);
  @@ -708,6 +714,7 @@
       char *a3;
       char *cp;
       const char *err;
  +    int mode;
   
       sconf = (rewrite_server_conf *)
               ap_get_module_config(cmd->server->module_config, &rewrite_module);
  @@ -726,16 +733,32 @@
                             "'\n", NULL);
       }
   
  +    /* arg3: optional flags field */
  +    new->forced_mimetype     = NULL;
  +    new->forced_responsecode = HTTP_MOVED_TEMPORARILY;
  +    new->flags  = RULEFLAG_NONE;
  +    new->env[0] = NULL;
  +    new->skip   = 0;
  +    if (a3 != NULL) {
  +        if ((err = cmd_rewriterule_parseflagfield(cmd->pool, new,
  +                                                  a3)) != NULL) {
  +            return err;
  +        }
  +    }
  +
       /*  arg1: the pattern
        *  try to compile the regexp to test if is ok
        */
  -    new->flags = RULEFLAG_NONE;
       cp = a1;
       if (cp[0] == '!') {
           new->flags |= RULEFLAG_NOTMATCH;
           cp++;
       }
  -    if ((regexp = ap_pregcomp(cmd->pool, cp, REG_EXTENDED)) == NULL) {
  +    mode = REG_EXTENDED;
  +    if (new->flags & RULEFLAG_NOCASE) {
  +        mode |= REG_ICASE;
  +    }
  +    if ((regexp = ap_pregcomp(cmd->pool, cp, mode)) == NULL) {
           return ap_pstrcat(cmd->pool,
                             "RewriteRule: cannot compile regular expression '",
                             a1, "'\n", NULL);
  @@ -749,18 +772,6 @@
        */
       new->output = ap_pstrdup(cmd->pool, a2);
   
  -    /* arg3: optional flags field */
  -    new->forced_mimetype = NULL;
  -    new->forced_responsecode = HTTP_MOVED_TEMPORARILY;
  -    new->env[0] = NULL;
  -    new->skip = 0;
  -    if (a3 != NULL) {
  -        if ((err = cmd_rewriterule_parseflagfield(cmd->pool, new,
  -                                                  a3)) != NULL) {
  -            return err;
  -        }
  -    }
  -
       /* now, if the server or per-dir config holds an
        * array of RewriteCond entries, we take it for us
        * and clear the array
  @@ -917,6 +928,10 @@
                || strcasecmp(key, "QSA") == 0   ) {
           cfg->flags |= RULEFLAG_QSAPPEND;
       }
  +    else if (   strcasecmp(key, "nocase") == 0
  +             || strcasecmp(key, "NC") == 0    ) {
  +        cfg->flags |= RULEFLAG_NOCASE;
  +    }
       else {
           return ap_pstrcat(p, "RewriteRule: unknown flag '", key, "'\n", NULL);
       }
  @@ -1145,7 +1160,7 @@
                   ;
               if (*cp != '\0') {
                   rewritelog(r, 1, "escaping %s for redirect", r->filename);
  -                cp2 = escape_uri(r->pool, cp);
  +                cp2 = ap_escape_uri(r->pool, cp);
                   *cp = '\0';
                   r->filename = ap_pstrcat(r->pool, r->filename, cp2, NULL);
               }
  @@ -1434,7 +1449,7 @@
               if (*cp != '\0') {
                   rewritelog(r, 1, "[per-dir %s] escaping %s for redirect",
                              dconf->directory, r->filename);
  -                cp2 = escape_uri(r->pool, cp);
  +                cp2 = ap_escape_uri(r->pool, cp);
                   *cp = '\0';
                   r->filename = ap_pstrcat(r->pool, r->filename, cp2, NULL);
               }
  @@ -2877,12 +2892,13 @@
       char buf[MAX_STRING_LEN];
   
       dbmkey.dptr  = key;
  -    dbmkey.dsize = (strlen(key) < sizeof(buf) - 1 ?
  -                    strlen(key) : sizeof(buf)-1);
  +    dbmkey.dsize = strlen(key);
       if ((dbmfp = dbm_open(file, O_RDONLY, 0666)) != NULL) {
           dbmval = dbm_fetch(dbmfp, dbmkey);
           if (dbmval.dptr != NULL) {
  -            memcpy(buf, dbmval.dptr, dbmval.dsize);
  +            memcpy(buf, dbmval.dptr, 
  +                   dbmval.dsize < sizeof(buf)-1 ? 
  +                   dbmval.dsize : sizeof(buf)-1  );
               buf[dbmval.dsize] = '\0';
               value = ap_pstrdup(r->pool, buf);
           }
  @@ -2963,6 +2979,23 @@
            cp++) {
           *cp = ap_tolower(*cp);
       }
  +    return value;
  +}
  +
  +static char *rewrite_mapfunc_escape(request_rec *r, char *key)
  +{
  +    char *value;
  +
  +    value = ap_escape_uri(r->pool, key);
  +    return value;
  +}
  +
  +static char *rewrite_mapfunc_unescape(request_rec *r, char *key)
  +{
  +    char *value;
  +
  +    value = ap_pstrdup(r->pool, key);
  +    ap_unescape_url(value);
       return value;
   }
   
  
  
  
  1.2       +5 -2      apache-apr/pthreads/src/modules/standard/mod_rewrite.h
  
  Index: mod_rewrite.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_rewrite.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_rewrite.h	1999/01/21 23:08:38	1.1
  +++ mod_rewrite.h	1999/02/07 06:29:55	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -127,7 +127,7 @@
        */
   #ifndef NO_DBM_REWRITEMAP
   #include <ndbm.h>
  -#if (__FreeBSD__)
  +#if defined(__FreeBSD__) || (defined(DB_LOCK) && defined(DB_SHMEM))
   #define NDBM_FILE_SUFFIX ".db"
   #else
   #define NDBM_FILE_SUFFIX ".pag"
  @@ -202,6 +202,7 @@
   #define RULEFLAG_FORBIDDEN          1<<9
   #define RULEFLAG_GONE               1<<10
   #define RULEFLAG_QSAPPEND           1<<11
  +#define RULEFLAG_NOCASE             1<<12
   
   #define MAPTYPE_TXT                 1<<0
   #define MAPTYPE_DBM                 1<<1
  @@ -427,6 +428,8 @@
                                    char *key);
   static char *rewrite_mapfunc_toupper(request_rec *r, char *key);
   static char *rewrite_mapfunc_tolower(request_rec *r, char *key);
  +static char *rewrite_mapfunc_escape(request_rec *r, char *key);
  +static char *rewrite_mapfunc_unescape(request_rec *r, char *key);
   static char *select_random_value_part(request_rec *r, char *value);
   static void  rewrite_rand_init(void);
   static int   rewrite_rand(int l, int h);
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_setenvif.c
  
  Index: mod_setenvif.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_setenvif.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_setenvif.c	1999/01/21 23:08:38	1.1
  +++ mod_setenvif.c	1999/02/07 06:29:55	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +16 -11    apache-apr/pthreads/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_so.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_so.c	1999/01/21 23:08:38	1.1
  +++ mod_so.c	1999/02/07 06:29:55	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -125,6 +125,7 @@
    */
   
   
  +#define CORE_PRIVATE
   #include "httpd.h"
   #include "http_config.h"
   #include "http_log.h"
  @@ -246,13 +247,23 @@
        * symbol name.
        */
       if (!(modp = (module *)(ap_os_dso_sym(modhandle, modname)))) {
  -	return ap_pstrcat(cmd->pool, "Can't find module ", modname,
  -		       " in file ", filename, ":", ap_os_dso_error(), NULL);
  +	return ap_pstrcat(cmd->pool, "Can't locate API module structure `", modname,
  +		       "' in file ", szModuleFile, ": ", ap_os_dso_error(), NULL);
       }
       modi->modp = modp;
       modp->dynamic_load_handle = modhandle;
   
       /* 
  +     * Make sure the found module structure is really a module structure
  +     * 
  +     */
  +    if (modp->magic != MODULE_MAGIC_COOKIE) {
  +        return ap_pstrcat(cmd->pool, "API module structure `", modname,
  +                          "' in file ", szModuleFile, " is garbled -"
  +                          " perhaps this is not an Apache module DSO?", NULL);
  +    }
  +
  +    /* 
        * Add this module to the Apache core structures
        */
       ap_add_loaded_module(modp);
  @@ -266,15 +277,9 @@
   		     (void (*)(void*))unload_module, ap_null_cleanup);
   
       /* 
  -     * Finally we need to run the configuration functions 
  -     * in new modules now.
  +     * Finally we need to run the configuration process for the module
        */
  -    if (modp->create_server_config)
  -      ((void**)cmd->server->module_config)[modp->module_index] =
  -	(*modp->create_server_config)(cmd->pool, cmd->server);
  -    if (modp->create_dir_config)
  -      ((void**)cmd->server->lookup_defaults)[modp->module_index] =
  -	(*modp->create_dir_config)(cmd->pool, NULL);
  +    ap_single_module_configure(cmd->pool, cmd->server, modp);
   
       return NULL;
   }
  
  
  
  1.2       +49 -31    apache-apr/pthreads/src/modules/standard/mod_speling.c
  
  Index: mod_speling.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_speling.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_speling.c	1999/01/21 23:08:38	1.1
  +++ mod_speling.c	1999/02/07 06:29:55	1.2
  @@ -1,6 +1,6 @@
   #define WANT_BASENAME_MATCH
   /* ====================================================================
  - * Copyright (c) 1996-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1996-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -428,10 +428,13 @@
            * returned.
            */
           else {
  -            char *t;
               pool *p;
               table *notes;
  +	    pool *sub_pool;
  +	    array_header *t;
  +	    array_header *v;
   
  +
               if (r->main == NULL) {
                   p = r->pool;
                   notes = r->notes;
  @@ -441,33 +444,47 @@
                   notes = r->main->notes;
               }
   
  +	    sub_pool = ap_make_sub_pool(p);
  +	    t = ap_make_array(sub_pool, candidates->nelts * 8 + 8,
  +			      sizeof(char *));
  +	    v = ap_make_array(sub_pool, candidates->nelts * 5,
  +			      sizeof(char *));
  +
               /* Generate the response text. */
  -            /*
  -	     * Since the text is expanded by repeated calls of
  -             * t = pstrcat(p, t, ".."), we can avoid a little waste
  -             * of memory by adding the header AFTER building the list.
  -             * XXX: FIXME: find a way to build a string concatenation
  -             *             without repeatedly requesting new memory
  -             * XXX: FIXME: Limit the list to a maximum number of entries
  -             */
  -            t = "";
   
  +	    *(const char **)ap_push_array(t) =
  +			  "The document name you requested (<code>";
  +	    *(const char **)ap_push_array(t) = r->uri;
  +	    *(const char **)ap_push_array(t) =
  +			   "</code>) could not be found on this server.\n"
  +			   "However, we found documents with names similar "
  +			   "to the one you requested.<p>"
  +			   "Available documents:\n<ul>\n";
  +
               for (i = 0; i < candidates->nelts; ++i) {
   		char *vuri;
   		const char *reason;
   
   		reason = sp_reason_str[(int) (variant[i].quality)];
                   /* The format isn't very neat... */
  -		vuri = ap_pstrcat(p, url, variant[i].name, r->path_info,
  +		vuri = ap_pstrcat(sub_pool, url, variant[i].name, r->path_info,
   				  (r->parsed_uri.query != NULL) ? "?" : "",
   				  (r->parsed_uri.query != NULL)
   				      ? r->parsed_uri.query : "",
   				  NULL);
  -		ap_table_mergen(r->subprocess_env, "VARIANTS",
  -				ap_pstrcat(p, "\"", vuri, "\";\"",
  -					   reason, "\"", NULL));
  -                t = ap_pstrcat(p, t, "<li><a href=\"", vuri,
  -			       "\">", vuri, "</a> (", reason, ")\n", NULL);
  +		*(const char **)ap_push_array(v) = "\"";
  +		*(const char **)ap_push_array(v) = vuri;
  +		*(const char **)ap_push_array(v) = "\";\"";
  +		*(const char **)ap_push_array(v) = reason;
  +		*(const char **)ap_push_array(v) = "\"";
  +
  +		*(const char **)ap_push_array(t) = "<li><a href=\"";
  +		*(const char **)ap_push_array(t) = vuri;
  +		*(const char **)ap_push_array(t) = "\">";
  +		*(const char **)ap_push_array(t) = vuri;
  +		*(const char **)ap_push_array(t) = "</a> (";
  +		*(const char **)ap_push_array(t) = reason;
  +		*(const char **)ap_push_array(t) = ")\n";
   
                   /*
                    * when we have printed the "close matches" and there are
  @@ -479,30 +496,31 @@
                   if (i > 0 && i < candidates->nelts - 1
                       && variant[i].quality != SP_VERYDIFFERENT
                       && variant[i + 1].quality == SP_VERYDIFFERENT) {
  -                    t = ap_pstrcat(p, t, 
  +		    *(const char **)ap_push_array(t) = 
   				   "</ul>\nFurthermore, the following related "
  -				   "documents were found:\n<ul>\n", NULL);
  +				   "documents were found:\n<ul>\n";
                   }
               }
  -            t = ap_pstrcat(p, "The document name you requested (<code>",
  -			   r->uri,
  -			   "</code>) could not be found on this server.\n"
  -			   "However, we found documents with names similar "
  -			   "to the one you requested.<p>"
  -			   "Available documents:\n<ul>\n", t, "</ul>\n", NULL);
  +	    *(const char **)ap_push_array(t) = "</ul>\n";
   
               /* If we know there was a referring page, add a note: */
               if (ref != NULL) {
  -                t = ap_pstrcat(p, t,
  +                *(const char **)ap_push_array(t) =
   			       "Please consider informing the owner of the "
  -			       "<a href=\"", ref, 
  -			       "\">referring page</a> "
  -			       "about the broken link.\n",
  -			       NULL);
  +			       "<a href=\"";
  +                *(const char **)ap_push_array(t) = ref;
  +                *(const char **)ap_push_array(t) = "\">referring page</a> "
  +			       "about the broken link.\n";
   	    }
   
  +
               /* Pass our table to http_protocol.c (see mod_negotiation): */
  -            ap_table_setn(notes, "variant-list", t);
  +            ap_table_setn(notes, "variant-list", ap_array_pstrcat(p, t, 0));
  +
  +	    ap_table_mergen(r->subprocess_env, "VARIANTS",
  +			    ap_array_pstrcat(p, v, ','));
  +	  
  +	    ap_destroy_pool(sub_pool);
   
               ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_INFO, r,
   			 ref ? "Spelling fix: %s: %d candidates from %s"
  
  
  
  1.2       +32 -15    apache-apr/pthreads/src/modules/standard/mod_status.c
  
  Index: mod_status.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_status.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_status.c	1999/01/21 23:08:38	1.1
  +++ mod_status.c	1999/02/07 06:29:55	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -254,6 +254,7 @@
       char stat_buffer[HARD_SERVER_LIMIT];
       int pid_buffer[HARD_SERVER_LIMIT];
       clock_t tu, ts, tcu, tcs;
  +    server_rec *vhost;
   
       tu = ts = tcu = tcs = 0;
   
  @@ -349,6 +350,7 @@
   	ap_rvputs(r, "Restart Time: ",
   	  ap_ht_time(r->pool, ap_restart_time, DEFAULT_TIME_FORMAT, 0), 
   	  "<br>\n", NULL);
  +	ap_rprintf(r, "Parent Server Generation: %d <br>\n", (int) ap_my_generation);
   	ap_rputs("Server uptime: ", r);
   	show_time(r, up_time);
   	ap_rputs("<br>\n", r);
  @@ -484,6 +486,10 @@
   	for (i = 0; i < HARD_SERVER_LIMIT; ++i) {
   	    score_record = ap_scoreboard_image->servers[i];
   	    ps_record = ap_scoreboard_image->parent[i];
  +	    vhost = score_record.vhostrec;
  +	    if (ps_record.generation != ap_my_generation) {
  +		vhost = NULL;
  +	    }
   
   #if defined(NO_GETTIMEOFDAY)
   #ifndef NO_TIMES
  @@ -519,11 +525,16 @@
   		if (!short_report) {
   		    if (no_table_report) {
   			if (score_record.status == SERVER_DEAD)
  -			    ap_rprintf(r, "<b>Server %d</b> (-): %d|%lu|%lu [",
  -				    i, (int) conn_lres, my_lres, lres);
  +			    ap_rprintf(r,
  +				"<b>Server %d-%d</b> (-): %d|%lu|%lu [",
  +				i, (int) ps_record.generation, (int) conn_lres,
  +				my_lres, lres);
   			else
  -			    ap_rprintf(r, "<b>Server %d</b> (%d): %d|%lu|%lu [",
  -				    i, (int) ps_record.pid, (int) conn_lres, my_lres, lres);
  +			    ap_rprintf(r,
  +				"<b>Server %d-%d</b> (%d): %d|%lu|%lu [",
  +				i, (int) ps_record.generation,
  +				(int) ps_record.pid,
  +				(int) conn_lres, my_lres, lres);
   
   			switch (score_record.status) {
   			case SERVER_READY:
  @@ -580,17 +591,23 @@
   			ap_rputs("|", r);
   			format_byte_out(r, bytes);
   			ap_rputs(")\n", r);
  -			ap_rprintf(r, " <i>%s {%s}</i><br>\n\n",
  -				score_record.client,
  -				ap_escape_html(r->pool, score_record.request));
  +			ap_rprintf(r, " <i>%s {%s}</i> <b>[%s]</b><br>\n\n",
  +			    score_record.client,
  +			    ap_escape_html(r->pool, score_record.request),
  +			    vhost ? vhost->server_hostname : "(unavailable)");
   		    }
   		    else {		/* !no_table_report */
   			if (score_record.status == SERVER_DEAD)
  -			    ap_rprintf(r, "<tr><td><b>%d</b><td>-<td>%d/%lu/%lu",
  -				    i, (int) conn_lres, my_lres, lres);
  +			    ap_rprintf(r,
  +				"<tr><td><b>%d-%d</b><td>-<td>%d/%lu/%lu",
  +				i, (int) ps_record.generation,
  +				(int) conn_lres, my_lres, lres);
   			else
  -			    ap_rprintf(r, "<tr><td><b>%d</b><td>%d<td>%d/%lu/%lu",
  -				    i, (int) ps_record.pid, (int) conn_lres, my_lres, lres);
  +			    ap_rprintf(r,
  +				"<tr><td><b>%d-%d</b><td>%d<td>%d/%lu/%lu",
  +				i, (int) ps_record.generation,
  +				(int) ps_record.pid, (int) conn_lres,
  +				my_lres, lres);
   
   			switch (score_record.status) {
   			case SERVER_READY:
  @@ -650,7 +667,7 @@
   			    ap_rprintf(r,
   			     "<td>%s<td nowrap>%s<td nowrap>%s</tr>\n\n",
   			     score_record.client,
  -			     score_record.vhostrec->server_hostname,
  +			     vhost ? vhost->server_hostname : "(unavailable)",
   			     ap_escape_html(r->pool, score_record.request));
   		    }		/* no_table_report */
   		}			/* !short_report */
  @@ -662,7 +679,7 @@
   	    ap_rputs("</table>\n \
   <hr> \
   <table>\n \
  -<tr><th>Srv<td>Server number\n \
  +<tr><th>Srv<td>Child Server number - generation\n \
   <tr><th>PID<td>OS process ID\n \
   <tr><th>Acc<td>Number of accesses this connection / this child / this slot\n \
   <tr><th>M<td>Mode of operation\n \
  @@ -676,7 +693,7 @@
   	    ap_rputs("</table>\n \
   <hr> \
   <table>\n \
  -<tr><th>Srv<td>Server number\n \
  +<tr><th>Srv<td>Child Server number - generation\n \
   <tr><th>PID<td>OS process ID\n \
   <tr><th>Acc<td>Number of accesses this connection / this child / this slot\n \
   <tr><th>M<td>Mode of operation\n \
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_unique_id.c
  
  Index: mod_unique_id.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_unique_id.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_unique_id.c	1999/01/21 23:08:38	1.1
  +++ mod_unique_id.c	1999/02/07 06:29:56	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_userdir.c
  
  Index: mod_userdir.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_userdir.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_userdir.c	1999/01/21 23:08:38	1.1
  +++ mod_userdir.c	1999/02/07 06:29:56	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/standard/mod_usertrack.c
  
  Index: mod_usertrack.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_usertrack.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_usertrack.c	1999/01/21 23:08:38	1.1
  +++ mod_usertrack.c	1999/02/07 06:29:56	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/test/mod_rndchunk.c
  
  Index: mod_rndchunk.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/test/mod_rndchunk.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_rndchunk.c	1999/01/21 23:08:39	1.1
  +++ mod_rndchunk.c	1999/02/07 06:30:09	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/modules/test/mod_test_util_uri.c
  
  Index: mod_test_util_uri.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/test/mod_test_util_uri.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_test_util_uri.c	1999/01/21 23:08:39	1.1
  +++ mod_test_util_uri.c	1999/02/07 06:30:09	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +117 -65   apache-apr/pthreads/src/os/bs2000/bs2login.c
  
  Index: bs2login.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/bs2000/bs2login.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- bs2login.c	1999/01/21 23:08:39	1.1
  +++ bs2login.c	1999/02/07 06:30:10	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -66,6 +66,17 @@
   #define USER_LEN 8
   
   static const char *bs2000_account = NULL;
  +typedef enum
  +{
  +    bs2_unknown,     /* not initialized yet. */
  +    bs2_noFORK,      /* no fork() because -X flag was specified */
  +    bs2_FORK,        /* only fork() because uid != 0 */
  +    bs2_FORK_RINI,   /* prior to A17, regular fork() and _rini() was used. */
  +    bs2_RFORK_RINI,  /* for A17, use of _rfork() and _rini() was required */
  +    bs2_UFORK        /* As of A18, the new ufork() is used. */
  +} bs2_ForkType;
  +
  +static bs2_ForkType forktype = bs2_unknown;
   
   
   static void ap_pad(char *dest, size_t size, char ch)
  @@ -86,6 +97,75 @@
       }
   }
   
  +/* Determine the method for forking off a child in such a way as to
  + * set both the POSIX and BS2000 user id's to the unprivileged user.
  + */
  +static bs2_ForkType os_forktype(void)
  +{
  +    struct utsname os_version;
  +
  +    /* have we checked the OS version before? If yes return the previous
  +     * result - the OS release isn't going to change suddenly!
  +     */
  +    if (forktype != bs2_unknown) {
  +	return forktype;
  +    }
  +
  +    /* If the user is unprivileged, use the normal fork() only. */
  +    if (getuid() != 0) {
  +	return forktype = bs2_FORK;
  +    }
  +
  +    if (uname(&os_version) < 0)
  +    {
  +	ap_log_error(APLOG_MARK, APLOG_ALERT, NULL,
  +		     "uname() failed - aborting.");
  +	exit(APEXIT_CHILDFATAL);
  +    }
  +
  +    /*
  +     * Old BS2000/OSD versions (before XPG4 SPEC1170) don't work with Apache.
  +     * Anyway, simply return a fork().
  +     */
  +    if (strcmp(os_version.release, "01.0A") == 0 ||
  +	strcmp(os_version.release, "02.0A") == 0 ||
  +	strcmp(os_version.release, "02.1A") == 0)
  +    {
  +	ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, NULL,
  +		     "Error: unsupported OS version. "
  +		     "You may encounter problems.");
  +	forktype = bs2_FORK;
  +    }
  +
  +    /* The following versions are special:
  +     * OS versions before A17 needs regular fork() and _rini().
  +     * A17 requires _rfork() and _rini(),
  +     * and later versions need ufork().
  +     */
  +    else if (strcmp(os_version.release, "01.1A") == 0 ||
  +	     strcmp(os_version.release, "03.0A") == 0 ||
  +	     strcmp(os_version.release, "03.1A") == 0 ||
  +	     strcmp(os_version.release, "04.0A") == 0)
  +    {
  +        if (strcmp (os_version.version, "A18") >= 0)
  +            forktype = bs2_UFORK;
  +
  +	else if (strcmp (os_version.version, "A17") < 0)
  +            forktype = bs2_FORK_RINI;
  +
  +	else
  +	    forktype = bs2_RFORK_RINI;
  +    }
  +
  +    /* All later OS versions will hopefully use ufork() only  ;-) */
  +    else
  +        forktype = bs2_UFORK;
  +
  +    return forktype;
  +}
  +
  +
  +
   /* This routine is called by http_core for the BS2000Account directive */
   /* It stores the account name for later use */
   const char *os_set_account(pool *p, const char *account)
  @@ -113,6 +193,7 @@
       _rini_struct            inittask; 
       char                    username[USER_LEN+1];
       int                     save_errno;
  +    bs2_ForkType            type = os_forktype();
   
       /* We can be sure that no change to uid==0 is possible because of
        * the checks in http_core.c:set_user()
  @@ -121,6 +202,20 @@
       /* The _rini() function works only after a prior _rfork().
        * In the case of one_process, it would fail.
        */
  +    if (one_process) {
  +
  +	type = forktype = bs2_noFORK;
  +
  +	ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, server,
  +		     "The debug mode of Apache should only "
  +		     "be started by an unprivileged user!");
  +	return 0;
  +    }
  +
  +    /* If no _rini() is required, then return quickly. */
  +    if (type != bs2_RFORK_RINI && type != bs2_FORK_RINI)
  +	return 0;
  +
       /* An Account is required for _rini() */
       if (bs2000_account == NULL)
       {
  @@ -130,16 +225,6 @@
   	exit(APEXIT_CHILDFATAL);
       }
   
  -    /* The one_process test is placed _behind_ the BS2000Account test
  -     * because we never want the user to forget configuring an account.
  -     */
  -    if (one_process) {
  -	ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, server,
  -		     "The debug mode of Apache should only "
  -		     "be started by an unprivileged user!");
  -	return 0;
  -    }
  -
       ap_cpystrn(username, user_name, sizeof username);
   
       /* Make user name all upper case */
  @@ -153,34 +238,13 @@
       inittask.processor_name = "        ";
   
       /* Switch to the new logon user (setuid() and setgid() are done later) */
  -    /* Only the super use can switch identities. */
  +    /* Only the super user can switch identities. */
       if (_rini(&inittask) != 0) {
  -	save_errno = errno;
   
   	ap_log_error(APLOG_MARK, APLOG_ALERT, server,
   		     "_rini: BS2000 auth failed for user \"%s\" acct \"%s\"",
   		     inittask.username, inittask.account);
   
  -	if (save_errno == EAGAIN) {
  -	    /* This funny error code does NOT mean that the operation should
  -	     * be retried. Instead it means that authentication failed
  -	     * because of possibly incompatible `JOBCLASS'es between
  -	     * the calling (SYSROOT) and the target non-privileged user id.
  -	     * Help the administrator by logging a hint.
  -	     */
  -	    char *curr_user, curr_uid[L_cuserid];
  -
  -	    if ((curr_user = cuserid(curr_uid)) == NULL) {
  -		/* This *SHOULD* not occur. But if it does, deal with it. */
  -		ap_snprintf(curr_uid, sizeof curr_uid, "#%u", getuid());
  -		curr_user = curr_uid;
  -	    }
  -
  -	    ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, server,
  -		     "_rini: Hint: Possible reason: JOBCLASS of user %s "
  -		     "not compatible with that of user %s ?",
  -		     curr_user, inittask.username);
  -	}
   	exit(APEXIT_CHILDFATAL);
       }
   
  @@ -188,42 +252,30 @@
   }
   
   /* BS2000 requires a "special" version of fork() before a setuid()/_rini() call */
  -/* Additionally, there's an OS release dependency here :-((( */
  -/* I'm sorry, but there was no other way to make it work.  -Martin */
  -pid_t os_fork(void)
  +pid_t os_fork(const char *user)
   {
  -    struct utsname os_version;
  +    pid_t pid;
   
  -    if (uname(&os_version) >= 0)
  -    {
  -	/* Old versions (before XPG4 SPEC1170) don't work with Apache
  -	 * and they require a fork(), not a _rfork()
  -	 */
  -	if (strcmp(os_version.release, "01.0A") == 0 ||
  -	    strcmp(os_version.release, "02.0A") == 0 ||
  -	    strcmp(os_version.release, "02.1A") == 0)
  -	{
  -	    return fork();
  -	}
  -
  -	/* The following versions are special:
  -	 * OS versions before A17 work with regular fork() only,
  -	 * later versions with _rfork() only.
  -	 */
  -	if (strcmp(os_version.release, "01.1A") == 0 ||
  -	    strcmp(os_version.release, "03.0A") == 0 ||
  -	    strcmp(os_version.release, "03.1A") == 0 ||
  -	    strcmp(os_version.release, "04.0A") == 0)
  -	{
  -		return (strcmp (os_version.version, "A17") < 0)
  -			? fork() : _rfork();
  -	}
  +    switch (os_forktype()) {
  +      case bs2_FORK:
  +      case bs2_FORK_RINI:
  +	pid = fork();
  +	break;
  +
  +      case bs2_RFORK_RINI:
  +	pid = _rfork();
  +	break;
  +
  +      case bs2_UFORK:
  +	pid = ufork(user);
  +	break;
  +
  +      default:
  +	pid = 0;
  +	break;
       }
   
  -    /* All later OS versions will require _rfork()
  -     * to prepare for authorization with _rini()
  -     */
  -    return _rfork();
  +    return pid;
   }
   
   #else /* _OSD_POSIX */
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/os/bs2000/ebcdic.c
  
  Index: ebcdic.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/bs2000/ebcdic.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ebcdic.c	1999/01/21 23:08:39	1.1
  +++ ebcdic.c	1999/02/07 06:30:10	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/os/bs2000/os.c
  
  Index: os.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/bs2000/os.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- os.c	1999/01/21 23:08:39	1.1
  +++ os.c	1999/02/07 06:30:10	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +8 -1      apache-apr/pthreads/src/os/bs2000/os.h
  
  Index: os.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/bs2000/os.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- os.h	1999/01/21 23:08:39	1.1
  +++ os.h	1999/02/07 06:30:10	1.2
  @@ -16,6 +16,9 @@
    * part of the header
    */
   #define INLINE extern ap_inline
  +
  +INLINE int ap_os_is_path_absolute(const char *file);
  +
   #include "os-inline.c"
   #endif
   
  @@ -23,8 +26,12 @@
   /* Compiler does not support inline, so prototype the inlineable functions
    * as normal
    */
  -extern int ap_os_is_path_absolute(const char *f);
  +extern int ap_os_is_path_absolute(const char *file);
   #endif
  +
  +/* Other ap_os_ routines not used by this platform */
  +
  +#define ap_os_is_filename_valid(f)          (1)
   
   /* Sorry if this is ugly, but the include order doesn't allow me
    * to use request_rec here... */
  
  
  
  1.2       +7 -1      apache-apr/pthreads/src/os/os2/os.h
  
  Index: os.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/os2/os.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- os.h	1999/01/21 23:08:40	1.1
  +++ os.h	1999/02/07 06:30:11	1.2
  @@ -15,6 +15,9 @@
    * part of the header
    */
   #define INLINE extern __inline__
  +
  +INLINE int ap_os_is_path_absolute(const char *file);
  +
   #include "os-inline.c"
   #endif
   
  @@ -22,8 +25,11 @@
   /* Compiler does not support inline, so prototype the inlineable functions
    * as normal
    */
  -extern int ap_os_is_path_absolute(const char *f);
  +extern int ap_os_is_path_absolute(const char *file);
   #endif
  +
  +/* FIXME: the following should be implemented on this platform */
  +#define ap_os_is_filename_valid(f)         (1)
   
   /* OS/2 doesn't have symlinks so S_ISLNK is always false */
   #define S_ISLNK(m) 0
  
  
  
  1.2       +3 -22     apache-apr/pthreads/src/os/tpf/TPFExport
  
  Index: TPFExport
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/tpf/TPFExport,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- TPFExport	1999/01/21 23:08:40	1.1
  +++ TPFExport	1999/02/07 06:30:12	1.2
  @@ -1,26 +1,7 @@
   #!/bin/sh
   echo " Setting TPF/c89 environment variables"
  -TZ=EST5EDT
  -PATH="$PATH:/usr/sbin:/usr/share/lib/terminfo/:.:/etc:$HOME"
  -NLSPATH=/usr/lpp/tcpip/usr/lib/nls/msg/%L:/usr/lib/nls/msg/%L/%N
  -LIBPATH=/usr/lib
  -LANG=C
  -export TZ PATH NLSPATH LANG
  -# Commands Reference
  -# umask g=rx,o=x
  -umask 022
  -    export _C89_CCMODE=1
  -    export _C89_CVERSION="0x21040000"
  -    export _C89_PVERSION="0x11080000"
  -    export _C89_CNAME="CBCDRVR"
  -    export _C89_PNAME="EDCPRLK"
  -    export _C89_PMSGS="EDCPMSGE"
  -    export _C89_CLIB_PREFIX="TSCTEST.OSV2R4M0"
  -    export _C89_PLIB_PREFIX="SHARE.CEE180"
  -    export _C89_INCDIRS="/u/tpf41/currentmaint/include /u/tpf41/currentmaint/include/oco //DD:SYSLIB //'SHARE.CEE180.SCEEH.NET.H' //'SHARE.CEE180.SCEEH.H' //'SHARE.CEE180.SCEEH.NETINET.H'" 
  -    export _C89_SSYSLIB=SHARE.CEE180.SCEEMAC
  -    export _C89_WORK_UNIT="VIO"
  -export _BPX_SHAREAS=YES
  -export PATH NLSPATH LIBPATH
  +export _C89_CCMODE=1
  +# replace the following with the location of your TPF include files
  +export _C89_INCDIRS="/u/tpf41/currentmaint/include /u/tpf41/currentmaint/include/oco" 
   export TPF=YES
   echo "Done"
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/os/tpf/ebcdic.c
  
  Index: ebcdic.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/tpf/ebcdic.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ebcdic.c	1999/01/21 23:08:40	1.1
  +++ ebcdic.c	1999/02/07 06:30:12	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/os/tpf/os.c
  
  Index: os.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/tpf/os.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- os.c	1999/01/21 23:08:40	1.1
  +++ os.c	1999/02/07 06:30:12	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +10 -3     apache-apr/pthreads/src/os/tpf/os.h
  
  Index: os.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/tpf/os.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- os.h	1999/01/21 23:08:40	1.1
  +++ os.h	1999/02/07 06:30:12	1.2
  @@ -20,6 +20,9 @@
    * part of the header
    */
   #define INLINE extern ap_inline
  +
  +INLINE int ap_os_is_path_absolute(const char *file);
  +
   #include "os-inline.c"
   #endif
   
  @@ -27,9 +30,13 @@
   /* Compiler does not support inline, so prototype the inlineable functions
    * as normal
    */
  -extern int ap_os_is_path_absolute(const char *f);
  +extern int ap_os_is_path_absolute(const char *file);
   #endif
   
  +/* Other ap_os_ routines not used by this platform */
  +
  +#define ap_os_is_filename_valid(f)          (1)
  +
   /* Sorry if this is ugly, but the include order doesn't allow me
    * to use request_rec here... */
   struct request_rec;
  @@ -45,7 +52,7 @@
   #undef __FD_MASK 
   #endif
   
  -typedef int __FD_MASK;
  +typedef long __FD_MASK;
   
   #ifdef __NBBY
   #undef __NBBY 
  @@ -69,7 +76,7 @@
   
   #define  FD_SET(n, p)((p)->fds_bits[(n)/__NFDBITS] |= (1 <<((n) % __NFDBITS)))
   
  -#define  FD_CLR(n, p)((p)->fds_bits[(n)/__NFDBITS] &= ~(1 \ << ((n) % __NFDBITS)))
  +#define  FD_CLR(n, p)((p)->fds_bits[(n)/__NFDBITS] &= ~(1 << ((n) % __NFDBITS)))
   
   #define  FD_ISSET(n, p)((p)->fds_bits[(n)/__NFDBITS] & (1 <<((n) % __NFDBITS)))
   
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/os/unix/os-aix-dso.c
  
  Index: os-aix-dso.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/unix/os-aix-dso.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- os-aix-dso.c	1999/01/21 23:08:40	1.1
  +++ os-aix-dso.c	1999/02/07 06:30:14	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.3       +12 -4     apache-apr/pthreads/src/os/unix/os.h
  
  Index: os.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/unix/os.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- os.h	1999/02/04 20:31:23	1.2
  +++ os.h	1999/02/07 06:30:14	1.3
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -73,6 +73,9 @@
    * part of the header
    */
   #define INLINE extern ap_inline
  +
  +INLINE int ap_os_is_path_absolute(const char *file);
  +
   #include "os-inline.c"
   
   #else
  @@ -80,9 +83,13 @@
   /* Compiler does not support inline, so prototype the inlineable functions
    * as normal
    */
  -extern int ap_os_is_path_absolute(const char *f);
  +extern int ap_os_is_path_absolute(const char *file);
   #endif
   
  +/* Other ap_os_ routines not used by this platform */
  +
  +#define ap_os_is_filename_valid(f)          (1)
  +
   /*
    *  Abstraction layer for loading
    *  Apache modules under run-time via 
  @@ -127,8 +134,9 @@
   #define RTLD_GLOBAL 0
   #endif
   
  -#if (defined(__FreeBSD__) && !defined(__ELF__)) || \
  -    defined(__OpenBSD__) || defined(__NetBSD__)
  +#if (defined(__FreeBSD__) ||\
  +     defined(__OpenBSD__) ||\
  +     defined(__NetBSD__)     ) && !defined(__ELF__)
   #define DLSYM_NEEDS_UNDERSCORE
   #endif
   
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/os/win32/mod_dll.c
  
  Index: mod_dll.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/win32/mod_dll.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_dll.c	1999/01/21 23:08:41	1.1
  +++ mod_dll.c	1999/02/07 06:30:15	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  
  
  
  1.2       +2 -2      apache-apr/pthreads/src/os/win32/mod_isapi.c
  
  Index: mod_isapi.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/win32/mod_isapi.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- mod_isapi.c	1999/01/21 23:08:41	1.1
  +++ mod_isapi.c	1999/02/07 06:30:15	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -463,7 +463,7 @@
   	    while (*value && ap_isspace(*value)) ++value;
   
   	    /* Check all the special-case headers. Similar to what
  -	     * scan_script_header() does (see that function for
  +	     * ap_scan_script_header_err() does (see that function for
   	     * more detail)
   	     */
   
  
  
  
  1.3       +4 -0      apache-apr/pthreads/src/os/win32/os.h
  
  Index: os.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/win32/os.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- os.h	1999/02/04 20:31:25	1.2
  +++ os.h	1999/02/07 06:30:15	1.3
  @@ -108,6 +108,10 @@
   #define spawnle				    os_spawnle
   API_EXPORT(int) os_spawnle(int mode,const char *cmdname,...);
   
  +/* OS-dependent filename routines in util_win32.c */
  +
  +API_EXPORT(int) ap_os_is_filename_valid(const char *file);
  +
   /* Abstractions for dealing with shared object files (DLLs on Win32).
    * These are used by mod_so.c
    */
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/os/win32/registry.c
  
  Index: registry.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/win32/registry.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- registry.c	1999/01/21 23:08:41	1.1
  +++ registry.c	1999/02/07 06:30:15	1.2
  @@ -28,7 +28,7 @@
   
   #define VENDOR   "Apache Group"
   #define SOFTWARE "Apache"
  -#define VERSION  "1.3.4 dev"
  +#define VERSION  "1.3.5 dev"
   
   #define REGKEY "SOFTWARE\\" VENDOR "\\" SOFTWARE "\\" VERSION
   
  
  
  
  1.2       +141 -0    apache-apr/pthreads/src/os/win32/util_win32.c
  
  Index: util_win32.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/win32/util_win32.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- util_win32.c	1999/01/21 23:08:41	1.1
  +++ util_win32.c	1999/02/07 06:30:15	1.2
  @@ -534,3 +534,144 @@
       }
       return return_value;
   }
  +
  +/*
  + * ap_os_is_filename_valid is given a filename, and returns 0 if the filename
  + * is not valid for use on this system. On Windows, this means it fails any
  + * of the tests below. Otherwise returns 1.
  + *
  + * Test for filename validity on Win32. This is of tests come in part from
  + * the MSDN article at "Technical Articles, Windows Platform, Base Services,
  + * Guidelines, Making Room for Long Filenames" although the information
  + * in MSDN about filename testing is incomplete or conflicting. There is a
  + * similar set of tests in "Technical Articles, Windows Platform, Base Services,
  + * Guidelines, Moving Unix Applications to Windows NT".
  + *
  + * The tests are:
  + *
  + * 1) total path length greater than MAX_PATH
  + *
  + * 2) anything using the octets 0-31 or characters " < > | :
  + *    (these are reserved for Windows use in filenames. In addition
  + *     each file system has its own additional characters that are
  + *     invalid. See KB article Q100108 for more details).
  + *
  + * 3) anything ending in "." (no matter how many)
  + *    (filename doc, doc. and doc... all refer to the same file)
  + *
  + * 4) any segment in which the basename (before first period) matches
  + *    one of the DOS device names
  + *    (the list comes from KB article Q100108 although some people
  + *     reports that additional names such as "COM5" are also special
  + *     devices).
  + *
  + * If the path fails ANY of these tests, the result must be to deny access.
  + */
  +
  +API_EXPORT(int) ap_os_is_filename_valid(const char *file)
  +{
  +    const char *segstart;
  +    unsigned int seglength;
  +    const char *pos;
  +    static const char * const invalid_characters = "?\"<>*|:";
  +    static const char * const invalid_filenames[] = { 
  +	"CON", "AUX", "COM1", "COM2", "COM3", 
  +	"COM4", "LPT1", "LPT2", "LPT3", "PRN", "NUL", NULL 
  +    };
  +
  +    /* Test 1 */
  +    if (strlen(file) > MAX_PATH) {
  +	/* Path too long for Windows. Note that this test is not valid
  +	 * if the path starts with //?/ or \\?\. */
  +	return 0;
  +    }
  +
  +    pos = file;
  +
  +    /* Skip any leading non-path components. This can be either a
  +     * drive letter such as C:, or a UNC path such as \\SERVER\SHARE\.
  +     * We continue and check the rest of the path based on the rules above.
  +     * This means we could eliminate valid filenames from servers which
  +     * are not running NT (such as Samba).
  +     */
  +
  +    if (pos[0] && pos[1] == ':') {
  +	/* Skip leading drive letter */
  +	pos += 2;
  +    }
  +    else {
  +	if ((pos[0] == '\\' || pos[0] == '/') &&
  +	    (pos[1] == '\\' || pos[1] == '/')) {
  +	    /* Is a UNC, so skip the server name and share name */
  +	    pos += 2;
  +	    while (*pos && *pos != '/' && *pos != '\\')
  +		pos++;
  +	    if (!*pos) {
  +		/* No share name */
  +		return 0;
  +	    }
  +	    pos++;	/* Move to start of share name */
  +	    while (*pos && *pos != '/' && *pos != '\\')
  +		pos++;
  +	    if (!*pos) {
  +		/* No path information */
  +		return 0;
  +	    }
  +	}
  +    }
  +
  +    while (*pos) {
  +	unsigned int idx;
  +	unsigned int baselength;
  +
  +	while (*pos == '/' || *pos == '\\') {
  +    	    pos++;
  +	}
  +	if (*pos == '\0') {
  +	    break;
  +	}
  +	segstart = pos;	/* start of segment */
  +	while (*pos && *pos != '/' && *pos != '\\') {
  +	    pos++;
  +	}
  +	seglength = pos - segstart;
  +	/* 
  +	 * Now we have a segment of the path, starting at position "segstart"
  +	 * and length "seglength"
  +	 */
  +
  +	/* Test 2 */
  +	for (idx = 0; idx < seglength; idx++) {
  +	    if (segstart[idx] < 32 ||
  +		strchr(invalid_characters, segstart[idx])) {
  +		return 0;
  +	    }
  +	}
  +
  +	/* Test 3 */
  +	if (segstart[seglength-1] == '.') {
  +	    return 0;
  +	}
  +
  +	/* Test 4 */
  +	for (baselength = 0; baselength < seglength; baselength++) {
  +	    if (segstart[baselength] == '.') {
  +		break;
  +	    }
  +	}
  +
  +	/* baselength is the number of characters in the base path of
  +	 * the segment (which could be the same as the whole segment length,
  +	 * if it does not include any dot characters). */
  +	if (baselength == 3 || baselength == 4) {
  +	    for (idx = 0; invalid_filenames[idx]; idx++) {
  +		if (strlen(invalid_filenames[idx]) == baselength &&
  +		    !strnicmp(invalid_filenames[idx], segstart, baselength)) {
  +		    return 0;
  +		}
  +	    }
  +	}
  +    }
  +
  +    return 1;
  +}
  
  
  
  1.2       +231 -161  apache-apr/pthreads/src/os/win32/installer/apache.iwz
  
  Index: apache.iwz
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/os/win32/installer/apache.iwz,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- apache.iwz	1999/01/21 23:08:41	1.1
  +++ apache.iwz	1999/02/07 06:30:17	1.2
  @@ -4,34 +4,34 @@
   iTime=1
   Flag=fe000000
   ISX.EXE Size=630784
  -ISX.EXE Date=11:43:52  24/2/1998
  +ISX.EXE Date=10:43:52  24/2/1998
   ISX.EXE Ver=2.0.0.143
   SETUP.EXE Size=45312
  -SETUP.EXE Date=10:53:32  18/1/1997
  +SETUP.EXE Date=9:53:32  18/1/1997
   SETUP.EXE Ver=3.0.111.0
   SETUP.INS Size=70160
  -SETUP.INS Date=14:16:56  11/2/1998
  +SETUP.INS Date=13:16:56  11/2/1998
   SETUP.INS Ver=Not available
   _INST16.EX_ Size=282766
  -_INST16.EX_ Date=10:56:04  18/1/1997
  +_INST16.EX_ Date=9:56:04  18/1/1997
   _INST16.EX_ Ver=Not available
   _INST32I.EX_ Size=320411
  -_INST32I.EX_ Date=11:04:08  18/1/1997
  +_INST32I.EX_ Date=10:04:08  18/1/1997
   _INST32I.EX_ Ver=Not available
   ISDEPEND.INI Size=320411
  -ISDEPEND.INI Date=11:04:08  18/1/1997
  +ISDEPEND.INI Date=10:04:08  18/1/1997
   ISDEPEND.INI Ver=Not available
   SWDEPEND.INI Size=320411
  -SWDEPEND.INI Date=11:04:08  18/1/1997
  +SWDEPEND.INI Date=10:04:08  18/1/1997
   SWDEPEND.INI Ver=Not available
   ICOMP.EXE Size=119808
  -ICOMP.EXE Date=15:05:10  15/1/1996
  +ICOMP.EXE Date=14:05:10  15/1/1996
   ICOMP.EXE Ver=3.00.062
   SPLIT.EXE Size=90624
  -SPLIT.EXE Date=15:09:36  15/1/1996
  +SPLIT.EXE Date=14:09:36  15/1/1996
   SPLIT.EXE Ver=3.00.060
   PACKLIST.EXE Size=87552
  -PACKLIST.EXE Date=15:10:30  15/1/1996
  +PACKLIST.EXE Date=14:10:30  15/1/1996
   PACKLIST.EXE Ver=3.00.060
   Version=2.02
   DevTool=Generic Windows
  @@ -46,9 +46,9 @@
   AppName=Apache
   AppExe=
   AppExeFile=
  -Version=1.3.3
  +Version=1.3.5 dev
   Company=Apache Group
  -Title=Apache Web Server 1.3.3
  +Title=Apache Web Server 1.3.5 dev
   TitleType=1
   BackgrndBmp=
   BackgrndAlign=4
  @@ -62,10 +62,10 @@
   Types=3
   Type1Components=6
   Type1Name=Custom
  -Type1ComponentList=1 2 3 4 5 6 
  +Type1ComponentList=1 3 4 6 5 2 
   Type2Components=5
   Type2Name=Typical
  -Type2ComponentList=1 3 4 5 6 
  +Type2ComponentList=1 3 4 6 5 
   Type3Components=2
   Type3Name=Compact
   Type3ComponentList=1 6 
  @@ -76,10 +76,10 @@
   Component1Name=Application Files
   Component1Description=Application files needed to run the application
   Component1GroupList=1 3 24 25 4 
  -Component2Groups=14
  +Component2Groups=17
   Component2Name=Source Code
   Component2Description=Source code for Apache and support tools
  -Component2GroupList=10 11 12 13 14 15 16 17 18 19 20 21 22 23 
  +Component2GroupList=10 11 12 13 14 15 16 17 18 19 20 21 22 23 31 32 34 
   Component3Groups=5
   Component3Name=Apache Manual
   Component3Description=Apache documentation
  @@ -88,18 +88,18 @@
   Component4Name=Additional Modules
   Component4Description=Apache modules to extend the server
   Component4GroupList=2 
  -Component5Groups=1
  +Component5Groups=2
   Component5Name=Icons
   Component5Description=Icons for directory indexes
  -Component5GroupList=27 
  +Component5GroupList=27 33 
   Component6Groups=4
   Component6Name=Required Directories
   Component6Description=
   Component6GroupList=26 28 29 30 
   
   [Groups]
  -Groups=30
  -Group1Size=328050
  +Groups=34
  +Group1Size=513790
   Group1Files=9
   Group1Name=Program Executables
   Group1Dir=<INSTALLDIR>
  @@ -114,7 +114,7 @@
   Group1File7=C:\Apache\README
   Group1File8=C:\apache\Makefile.tmpl
   Group1File9=C:\apache\README-NT.TXT
  -Group2Size=135680
  +Group2Size=265216
   Group2Files=10
   Group2Name=Additional Modules
   Group2Dir=<INSTALLDIR>\modules
  @@ -130,7 +130,7 @@
   Group2File8=C:\Apache\modules\ApacheModuleStatus.dll
   Group2File9=C:\Apache\modules\ApacheModuleUserTrack.dll
   Group2File10=C:\apache\modules\ApacheModuleRewrite.dll
  -Group3Size=38714
  +Group3Size=49843
   Group3Files=6
   Group3Name=Configuration Files
   Group3Dir=<INSTALLDIR>\.tmp
  @@ -150,8 +150,8 @@
   Group4TargetOS=-1
   Group4File1=C:\Apache\htdocs\index.html
   Group4File2=C:\apache\htdocs\apache_pb.gif
  -Group5Size=253396
  -Group5Files=31
  +Group5Size=284610
  +Group5Files=34
   Group5Name=Manual
   Group5Dir=<INSTALLDIR>\htdocs\manual
   Group5Update=0
  @@ -187,6 +187,9 @@
   Group5File29=C:\apache\htdocs\manual\upgrading_to_1_3.html
   Group5File30=C:\apache\htdocs\manual\windows.html
   Group5File31=C:\apache\htdocs\manual\bind.html
  +Group5File32=C:\apache\htdocs\manual\suexec_1_2.html
  +Group5File33=C:\apache\htdocs\manual\install-tpf.html
  +Group5File34=C:\apache\htdocs\manual\readme-tpf.html
   Group6Size=42478
   Group6Files=8
   Group6Name=images
  @@ -201,7 +204,7 @@
   Group6File6=C:\apache\htdocs\manual\images\mod_rewrite_fig1.gif
   Group6File7=C:\apache\htdocs\manual\images\mod_rewrite_fig2.fig
   Group6File8=C:\apache\htdocs\manual\images\mod_rewrite_fig2.gif
  -Group7Size=321048
  +Group7Size=323537
   Group7Files=22
   Group7Name=misc
   Group7Dir=[Manual]\misc
  @@ -229,7 +232,7 @@
   Group7File20=C:\Apache\htdocs\manual\misc\vif-info.html
   Group7File21=C:\Apache\htdocs\manual\misc\windoz_keepalive.html
   Group7File22=C:\apache\htdocs\manual\misc\HTTP_Features.tsv
  -Group8Size=531149
  +Group8Size=540126
   Group8Files=48
   Group8Name=mod
   Group8Dir=[Manual]\mod
  @@ -283,8 +286,8 @@
   Group8File46=C:\Apache\htdocs\manual\mod\mod_userdir.html
   Group8File47=C:\Apache\htdocs\manual\mod\mod_usertrack.html
   Group8File48=C:\apache\htdocs\manual\mod\mod_mmap_static.html
  -Group9Size=97112
  -Group9Files=12
  +Group9Size=109856
  +Group9Files=13
   Group9Name=vhosts
   Group9Dir=[Manual]\vhosts
   Group9Update=0
  @@ -301,8 +304,9 @@
   Group9File10=C:\Apache\htdocs\manual\vhosts\name-based.html
   Group9File11=C:\Apache\htdocs\manual\vhosts\vhosts-in-depth.html
   Group9File12=C:\Apache\htdocs\manual\vhosts\virtual-host.html
  -Group10Size=463830
  -Group10Files=17
  +Group9File13=C:\apache\htdocs\manual\vhosts\mass.html
  +Group10Size=509499
  +Group10Files=19
   Group10Name=src
   Group10Dir=<INSTALLDIR>\src
   Group10Update=0
  @@ -324,7 +328,9 @@
   Group10File15=C:\Apache\src\README
   Group10File16=C:\Apache\src\README.EBCDIC
   Group10File17=C:\apache\src\BUILD.NOTES
  -Group11Size=68859
  +Group10File18=C:\apache\src\Makefile_win32.txt
  +Group10File19=C:\apache\src\Makefile_win32_debug.txt
  +Group11Size=88267
   Group11Files=10
   Group11Name=ap
   Group11Dir=[src]\ap
  @@ -338,10 +344,10 @@
   Group11File6=C:\Apache\src\ap\ap_slack.c
   Group11File7=C:\Apache\src\ap\ap_snprintf.c
   Group11File8=C:\Apache\src\ap\Makefile.tmpl
  -Group11File9=C:\apache\src\ap\.indent.pro
  -Group11File10=C:\apache\src\ap\ap_fnmatch.c
  -Group12Size=246696
  -Group12Files=30
  +Group11File9=C:\apache\src\ap\ap_fnmatch.c
  +Group11File10=C:\apache\src\ap\ap_md5c.c
  +Group12Size=253660
  +Group12Files=29
   Group12Name=include
   Group12Dir=[src]\include
   Group12Update=0
  @@ -374,38 +380,35 @@
   Group12File26=C:\apache\src\include\ap_compat.h
   Group12File27=C:\apache\src\include\ap_config.h
   Group12File28=C:\apache\src\include\ap_ctype.h
  -Group12File29=C:\apache\src\include\.indent.pro
  -Group12File30=C:\apache\src\include\ap_mmn.h
  -Group13Size=771650
  -Group13Files=24
  +Group12File29=C:\apache\src\include\ap_mmn.h
  +Group13Size=772778
  +Group13Files=22
   Group13Name=main
   Group13Dir=[src]\main
   Group13Update=0
   Group13TargetOS=-1
  -Group13File1=C:\apache\src\main\.indent.pro
  -Group13File2=C:\apache\src\main\alloc.c
  -Group13File3=C:\apache\src\main\buff.c
  -Group13File4=C:\apache\src\main\gen_test_char.c
  -Group13File5=C:\apache\src\main\gen_test_char.dsp
  -Group13File6=C:\apache\src\main\gen_test_char.mak
  -Group13File7=C:\apache\src\main\gen_uri_delims.c
  -Group13File8=C:\apache\src\main\gen_uri_delims.dsp
  -Group13File9=C:\apache\src\main\gen_uri_delims.mak
  -Group13File10=C:\apache\src\main\http_config.c
  -Group13File11=C:\apache\src\main\http_core.c
  -Group13File12=C:\apache\src\main\http_log.c
  -Group13File13=C:\apache\src\main\http_main.c
  -Group13File14=C:\apache\src\main\http_protocol.c
  -Group13File15=C:\apache\src\main\http_request.c
  -Group13File16=C:\apache\src\main\http_vhost.c
  -Group13File17=C:\apache\src\main\Makefile.tmpl
  -Group13File18=C:\apache\src\main\md5c.c
  -Group13File19=C:\apache\src\main\rfc1413.c
  -Group13File20=C:\apache\src\main\util.c
  -Group13File21=C:\apache\src\main\util_date.c
  -Group13File22=C:\apache\src\main\util_md5.c
  -Group13File23=C:\apache\src\main\util_script.c
  -Group13File24=C:\apache\src\main\util_uri.c
  +Group13File1=C:\apache\src\main\alloc.c
  +Group13File2=C:\apache\src\main\buff.c
  +Group13File3=C:\apache\src\main\gen_test_char.c
  +Group13File4=C:\apache\src\main\gen_test_char.dsp
  +Group13File5=C:\apache\src\main\gen_test_char.mak
  +Group13File6=C:\apache\src\main\gen_uri_delims.c
  +Group13File7=C:\apache\src\main\gen_uri_delims.dsp
  +Group13File8=C:\apache\src\main\gen_uri_delims.mak
  +Group13File9=C:\apache\src\main\http_config.c
  +Group13File10=C:\apache\src\main\http_core.c
  +Group13File11=C:\apache\src\main\http_log.c
  +Group13File12=C:\apache\src\main\http_main.c
  +Group13File13=C:\apache\src\main\http_protocol.c
  +Group13File14=C:\apache\src\main\http_request.c
  +Group13File15=C:\apache\src\main\http_vhost.c
  +Group13File16=C:\apache\src\main\Makefile.tmpl
  +Group13File17=C:\apache\src\main\rfc1413.c
  +Group13File18=C:\apache\src\main\util.c
  +Group13File19=C:\apache\src\main\util_date.c
  +Group13File20=C:\apache\src\main\util_md5.c
  +Group13File21=C:\apache\src\main\util_script.c
  +Group13File22=C:\apache\src\main\util_uri.c
   Group14Size=895
   Group14Files=1
   Group14Name=modules
  @@ -413,8 +416,8 @@
   Group14Update=0
   Group14TargetOS=-1
   Group14File1=C:\Apache\src\modules\README
  -Group15Size=49171
  -Group15Files=4
  +Group15Size=48416
  +Group15Files=3
   Group15Name=example
   Group15Dir=[modules]\example
   Group15Update=0
  @@ -422,86 +425,81 @@
   Group15File1=C:\Apache\src\modules\example\Makefile.tmpl
   Group15File2=C:\Apache\src\modules\example\mod_example.c
   Group15File3=C:\Apache\src\modules\example\README
  -Group15File4=C:\apache\src\modules\example\.indent.pro
  -Group16Size=13944
  -Group16Files=3
  +Group16Size=13194
  +Group16Files=2
   Group16Name=experimental
   Group16Dir=[modules]\experimental
   Group16Update=0
   Group16TargetOS=-1
   Group16File1=C:\Apache\src\modules\experimental\Makefile.tmpl
   Group16File2=C:\Apache\src\modules\experimental\mod_mmap_static.c
  -Group16File3=C:\apache\src\modules\experimental\.indent.pro
  -Group17Size=824
  -Group17Files=2
  +Group17Size=69
  +Group17Files=1
   Group17Name=extra
   Group17Dir=[modules]\extra
   Group17Update=0
   Group17TargetOS=-1
   Group17File1=C:\Apache\src\modules\extra\Makefile.tmpl
  -Group17File2=C:\apache\src\modules\extra\.indent.pro
  -Group18Size=205432
  -Group18Files=12
  +Group18Size=204884
  +Group18Files=11
   Group18Name=proxy
   Group18Dir=[modules]\proxy
   Group18Update=0
   Group18TargetOS=-1
  -Group18File1=C:\apache\src\modules\proxy\.indent.pro
  -Group18File2=C:\apache\src\modules\proxy\ApacheModuleProxy.dsp
  -Group18File3=C:\apache\src\modules\proxy\ApacheModuleProxy.mak
  -Group18File4=C:\apache\src\modules\proxy\Makefile.libdir
  -Group18File5=C:\apache\src\modules\proxy\Makefile.tmpl
  -Group18File6=C:\apache\src\modules\proxy\mod_proxy.c
  -Group18File7=C:\apache\src\modules\proxy\mod_proxy.h
  -Group18File8=C:\apache\src\modules\proxy\proxy_cache.c
  -Group18File9=C:\apache\src\modules\proxy\proxy_connect.c
  -Group18File10=C:\apache\src\modules\proxy\proxy_ftp.c
  -Group18File11=C:\apache\src\modules\proxy\proxy_http.c
  -Group18File12=C:\apache\src\modules\proxy\proxy_util.c
  -Group19Size=831125
  -Group19Files=37
  +Group18File1=C:\apache\src\modules\proxy\ApacheModuleProxy.dsp
  +Group18File2=C:\apache\src\modules\proxy\ApacheModuleProxy.mak
  +Group18File3=C:\apache\src\modules\proxy\Makefile.libdir
  +Group18File4=C:\apache\src\modules\proxy\Makefile.tmpl
  +Group18File5=C:\apache\src\modules\proxy\mod_proxy.c
  +Group18File6=C:\apache\src\modules\proxy\mod_proxy.h
  +Group18File7=C:\apache\src\modules\proxy\proxy_cache.c
  +Group18File8=C:\apache\src\modules\proxy\proxy_connect.c
  +Group18File9=C:\apache\src\modules\proxy\proxy_ftp.c
  +Group18File10=C:\apache\src\modules\proxy\proxy_http.c
  +Group18File11=C:\apache\src\modules\proxy\proxy_util.c
  +Group19Size=861166
  +Group19Files=36
   Group19Name=standard
   Group19Dir=[modules]\standard
   Group19Update=0
   Group19TargetOS=-1
  -Group19File1=C:\apache\src\modules\standard\.indent.pro
  -Group19File2=C:\apache\src\modules\standard\Makefile.tmpl
  -Group19File3=C:\apache\src\modules\standard\mod_access.c
  -Group19File4=C:\apache\src\modules\standard\mod_actions.c
  -Group19File5=C:\apache\src\modules\standard\mod_alias.c
  -Group19File6=C:\apache\src\modules\standard\mod_asis.c
  -Group19File7=C:\apache\src\modules\standard\mod_auth.c
  -Group19File8=C:\apache\src\modules\standard\mod_auth_anon.c
  -Group19File9=C:\apache\src\modules\standard\mod_auth_db.c
  -Group19File10=C:\apache\src\modules\standard\mod_auth_db.module
  -Group19File11=C:\apache\src\modules\standard\mod_auth_dbm.c
  -Group19File12=C:\apache\src\modules\standard\mod_autoindex.c
  -Group19File13=C:\apache\src\modules\standard\mod_cern_meta.c
  -Group19File14=C:\apache\src\modules\standard\mod_cgi.c
  -Group19File15=C:\apache\src\modules\standard\mod_digest.c
  -Group19File16=C:\apache\src\modules\standard\mod_dir.c
  -Group19File17=C:\apache\src\modules\standard\mod_env.c
  -Group19File18=C:\apache\src\modules\standard\mod_expires.c
  -Group19File19=C:\apache\src\modules\standard\mod_headers.c
  -Group19File20=C:\apache\src\modules\standard\mod_imap.c
  -Group19File21=C:\apache\src\modules\standard\mod_include.c
  -Group19File22=C:\apache\src\modules\standard\mod_info.c
  -Group19File23=C:\apache\src\modules\standard\mod_log_agent.c
  -Group19File24=C:\apache\src\modules\standard\mod_log_config.c
  -Group19File25=C:\apache\src\modules\standard\mod_log_referer.c
  -Group19File26=C:\apache\src\modules\standard\mod_mime.c
  -Group19File27=C:\apache\src\modules\standard\mod_mime_magic.c
  -Group19File28=C:\apache\src\modules\standard\mod_negotiation.c
  -Group19File29=C:\apache\src\modules\standard\mod_rewrite.c
  -Group19File30=C:\apache\src\modules\standard\mod_rewrite.h
  -Group19File31=C:\apache\src\modules\standard\mod_setenvif.c
  -Group19File32=C:\apache\src\modules\standard\mod_so.c
  -Group19File33=C:\apache\src\modules\standard\mod_speling.c
  -Group19File34=C:\apache\src\modules\standard\mod_status.c
  -Group19File35=C:\apache\src\modules\standard\mod_unique_id.c
  -Group19File36=C:\apache\src\modules\standard\mod_userdir.c
  -Group19File37=C:\apache\src\modules\standard\mod_usertrack.c
  -Group20Size=170813
  +Group19File1=C:\apache\src\modules\standard\Makefile.tmpl
  +Group19File2=C:\apache\src\modules\standard\mod_access.c
  +Group19File3=C:\apache\src\modules\standard\mod_actions.c
  +Group19File4=C:\apache\src\modules\standard\mod_alias.c
  +Group19File5=C:\apache\src\modules\standard\mod_asis.c
  +Group19File6=C:\apache\src\modules\standard\mod_auth.c
  +Group19File7=C:\apache\src\modules\standard\mod_auth_anon.c
  +Group19File8=C:\apache\src\modules\standard\mod_auth_db.c
  +Group19File9=C:\apache\src\modules\standard\mod_auth_db.module
  +Group19File10=C:\apache\src\modules\standard\mod_auth_dbm.c
  +Group19File11=C:\apache\src\modules\standard\mod_autoindex.c
  +Group19File12=C:\apache\src\modules\standard\mod_cern_meta.c
  +Group19File13=C:\apache\src\modules\standard\mod_cgi.c
  +Group19File14=C:\apache\src\modules\standard\mod_digest.c
  +Group19File15=C:\apache\src\modules\standard\mod_dir.c
  +Group19File16=C:\apache\src\modules\standard\mod_env.c
  +Group19File17=C:\apache\src\modules\standard\mod_expires.c
  +Group19File18=C:\apache\src\modules\standard\mod_headers.c
  +Group19File19=C:\apache\src\modules\standard\mod_imap.c
  +Group19File20=C:\apache\src\modules\standard\mod_include.c
  +Group19File21=C:\apache\src\modules\standard\mod_info.c
  +Group19File22=C:\apache\src\modules\standard\mod_log_agent.c
  +Group19File23=C:\apache\src\modules\standard\mod_log_config.c
  +Group19File24=C:\apache\src\modules\standard\mod_log_referer.c
  +Group19File25=C:\apache\src\modules\standard\mod_mime.c
  +Group19File26=C:\apache\src\modules\standard\mod_mime_magic.c
  +Group19File27=C:\apache\src\modules\standard\mod_negotiation.c
  +Group19File28=C:\apache\src\modules\standard\mod_rewrite.c
  +Group19File29=C:\apache\src\modules\standard\mod_rewrite.h
  +Group19File30=C:\apache\src\modules\standard\mod_setenvif.c
  +Group19File31=C:\apache\src\modules\standard\mod_so.c
  +Group19File32=C:\apache\src\modules\standard\mod_speling.c
  +Group19File33=C:\apache\src\modules\standard\mod_status.c
  +Group19File34=C:\apache\src\modules\standard\mod_unique_id.c
  +Group19File35=C:\apache\src\modules\standard\mod_userdir.c
  +Group19File36=C:\apache\src\modules\standard\mod_usertrack.c
  +Group20Size=170796
   Group20Files=25
   Group20Name=regex
   Group20Dir=[src]\regex
  @@ -532,46 +530,47 @@
   Group20File23=C:\Apache\src\regex\tests
   Group20File24=C:\Apache\src\regex\utils.h
   Group20File25=C:\Apache\src\regex\WHATSNEW
  -Group21Size=182644
  -Group21Files=27
  +Group21Size=195047
  +Group21Files=28
   Group21Name=support
   Group21Dir=[src]\support
   Group21Update=0
   Group21TargetOS=-1
  -Group21File1=C:\apache\src\support\.indent.pro
  -Group21File2=C:\apache\src\support\ab.1
  -Group21File3=C:\apache\src\support\ab.c
  -Group21File4=C:\apache\src\support\apachectl
  -Group21File5=C:\apache\src\support\apachectl.1
  -Group21File6=C:\apache\src\support\apxs.8
  -Group21File7=C:\apache\src\support\apxs.pl
  -Group21File8=C:\apache\src\support\dbmmanage
  -Group21File9=C:\apache\src\support\dbmmanage.1
  -Group21File10=C:\apache\src\support\htdigest.1
  -Group21File11=C:\apache\src\support\htdigest.c
  -Group21File12=C:\apache\src\support\htpasswd.1
  -Group21File13=C:\apache\src\support\htpasswd.c
  -Group21File14=C:\apache\src\support\httpd.8
  -Group21File15=C:\apache\src\support\log_server_status
  -Group21File16=C:\apache\src\support\logresolve.8
  -Group21File17=C:\apache\src\support\logresolve.c
  -Group21File18=C:\apache\src\support\logresolve.pl
  -Group21File19=C:\apache\src\support\Makefile.tmpl
  -Group21File20=C:\apache\src\support\phf_abuse_log.cgi
  -Group21File21=C:\apache\src\support\rotatelogs.8
  -Group21File22=C:\apache\src\support\rotatelogs.c
  -Group21File23=C:\apache\src\support\split-logfile
  -Group21File24=C:\apache\src\support\suexec.8
  -Group21File25=C:\apache\src\support\suexec.c
  -Group21File26=C:\apache\src\support\suexec.h
  -Group21File27=C:\apache\src\support\httpd.exp
  +Group21File1=C:\apache\src\support\ab.1
  +Group21File2=C:\apache\src\support\ab.c
  +Group21File3=C:\apache\src\support\apachectl
  +Group21File4=C:\apache\src\support\apachectl.1
  +Group21File5=C:\apache\src\support\apxs.8
  +Group21File6=C:\apache\src\support\apxs.pl
  +Group21File7=C:\apache\src\support\dbmmanage
  +Group21File8=C:\apache\src\support\dbmmanage.1
  +Group21File9=C:\apache\src\support\htdigest.1
  +Group21File10=C:\apache\src\support\htdigest.c
  +Group21File11=C:\apache\src\support\htpasswd.1
  +Group21File12=C:\apache\src\support\htpasswd.c
  +Group21File13=C:\apache\src\support\httpd.8
  +Group21File14=C:\apache\src\support\log_server_status
  +Group21File15=C:\apache\src\support\logresolve.8
  +Group21File16=C:\apache\src\support\logresolve.c
  +Group21File17=C:\apache\src\support\logresolve.pl
  +Group21File18=C:\apache\src\support\Makefile.tmpl
  +Group21File19=C:\apache\src\support\phf_abuse_log.cgi
  +Group21File20=C:\apache\src\support\rotatelogs.8
  +Group21File21=C:\apache\src\support\rotatelogs.c
  +Group21File22=C:\apache\src\support\split-logfile
  +Group21File23=C:\apache\src\support\suexec.8
  +Group21File24=C:\apache\src\support\suexec.c
  +Group21File25=C:\apache\src\support\suexec.h
  +Group21File26=C:\apache\src\support\httpd.exp
  +Group21File27=C:\apache\src\support\htpasswd.dsp
  +Group21File28=C:\apache\src\support\htpasswd.mak
   Group22Size=0
   Group22Files=0
   Group22Name=os
   Group22Dir=[src]\os
   Group22Update=0
   Group22TargetOS=-1
  -Group23Size=199605
  +Group23Size=207380
   Group23Files=43
   Group23Name=win32
   Group23Dir=[os]\win32
  @@ -627,7 +626,7 @@
   Group24Update=0
   Group24TargetOS=-1
   Group24File1=C:\Apache\install.dll
  -Group25Size=280576
  +Group25Size=254005
   Group25Files=1
   Group25Name=Shared DLLs
   Group25Dir=<WINSYSDIR>
  @@ -640,7 +639,7 @@
   Group26Dir=<INSTALLDIR>\logs
   Group26Update=0
   Group26TargetOS=-1
  -Group27Size=37074
  +Group27Size=37127
   Group27Files=76
   Group27Name=icons
   Group27Dir=<INSTALLDIR>\icons
  @@ -741,6 +740,77 @@
   Group30Dir=<INSTALLDIR>\cgi-bin
   Group30Update=0
   Group30TargetOS=-1
  +Group31Size=35569
  +Group31Files=2
  +Group31Name=installer
  +Group31Dir=[win32]\installer
  +Group31Update=0
  +Group31TargetOS=-1
  +Group31File1=C:\apache\src\os\win32\installer\apache.iwz
  +Group31File2=C:\apache\src\os\win32\installer\README.TXT
  +Group32Size=24684
  +Group32Files=4
  +Group32Name=installdll
  +Group32Dir=[installer]\installdll
  +Group32Update=0
  +Group32TargetOS=-1
  +Group32File1=C:\apache\src\os\win32\installer\installdll\install.c
  +Group32File2=C:\apache\src\os\win32\installer\installdll\install.def
  +Group32File3=C:\apache\src\os\win32\installer\installdll\install.dsp
  +Group32File4=C:\apache\src\os\win32\installer\installdll\install.mak
  +Group33Size=8247
  +Group33Files=33
  +Group33Name=small
  +Group33Dir=[icons]\small
  +Group33Update=0
  +Group33TargetOS=-1
  +Group33File1=C:\apache\icons\small\back.gif
  +Group33File2=C:\apache\icons\small\binary.gif
  +Group33File3=C:\apache\icons\small\binhex.gif
  +Group33File4=C:\apache\icons\small\blank.gif
  +Group33File5=C:\apache\icons\small\broken.gif
  +Group33File6=C:\apache\icons\small\burst.gif
  +Group33File7=C:\apache\icons\small\comp1.gif
  +Group33File8=C:\apache\icons\small\comp2.gif
  +Group33File9=C:\apache\icons\small\compressed.gif
  +Group33File10=C:\apache\icons\small\continued.gif
  +Group33File11=C:\apache\icons\small\dir.gif
  +Group33File12=C:\apache\icons\small\dir2.gif
  +Group33File13=C:\apache\icons\small\forward.gif
  +Group33File14=C:\apache\icons\small\generic.gif
  +Group33File15=C:\apache\icons\small\generic2.gif
  +Group33File16=C:\apache\icons\small\generic3.gif
  +Group33File17=C:\apache\icons\small\image.gif
  +Group33File18=C:\apache\icons\small\image2.gif
  +Group33File19=C:\apache\icons\small\index.gif
  +Group33File20=C:\apache\icons\small\movie.gif
  +Group33File21=C:\apache\icons\small\rainbow.gif
  +Group33File22=C:\apache\icons\small\README.txt
  +Group33File23=C:\apache\icons\small\sound.gif
  +Group33File24=C:\apache\icons\small\sound2.gif
  +Group33File25=C:\apache\icons\small\tar.gif
  +Group33File26=C:\apache\icons\small\text.gif
  +Group33File27=C:\apache\icons\small\transfer.gif
  +Group33File28=C:\apache\icons\small\unknown.gif
  +Group33File29=C:\apache\icons\small\uu.gif
  +Group33File30=C:\apache\icons\small\key.gif
  +Group33File31=C:\apache\icons\small\patch.gif
  +Group33File32=C:\apache\icons\small\ps.gif
  +Group33File33=C:\apache\icons\small\doc.gif
  +Group34Size=17312
  +Group34Files=8
  +Group34Name=test
  +Group34Dir=[installdll]\test
  +Group34Update=0
  +Group34TargetOS=-1
  +Group34File1=C:\apache\src\os\win32\installer\installdll\test\resource.h
  +Group34File2=C:\apache\src\os\win32\installer\installdll\test\test.c
  +Group34File3=C:\apache\src\os\win32\installer\installdll\test\test.def
  +Group34File4=C:\apache\src\os\win32\installer\installdll\test\test.dsp
  +Group34File5=C:\apache\src\os\win32\installer\installdll\test\test.h
  +Group34File6=C:\apache\src\os\win32\installer\installdll\test\test.ico
  +Group34File7=C:\apache\src\os\win32\installer\installdll\test\test.mak
  +Group34File8=C:\apache\src\os\win32\installer\installdll\test\test.rc
   
   [Sequence]
   DestinationLocationDir=<ProgramFilesDir>\Apache Group\Apache
  @@ -805,7 +875,7 @@
   Reg9Val1Name=(Default)
   Reg9Val1Data=(value not set)
   Reg9Vals=1
  -Reg10Path=HKEY_LOCAL_MACHINE\SOFTWARE\Apache Group\Apache\1.3.3
  +Reg10Path=HKEY_LOCAL_MACHINE\SOFTWARE\Apache Group\Apache\1.3.5 dev
   Reg10Val1Type=0
   Reg10Val1Name=(Default)
   Reg10Val1Data=(value not set)
  @@ -819,8 +889,8 @@
   Reg1Path=HKEY_LOCAL_MACHINE\SOFTWARE
   Reg2Path=HKEY_LOCAL_MACHINE\SOFTWARE\Apache Group
   Reg3Path=HKEY_LOCAL_MACHINE\SOFTWARE\Apache Group\Apache
  -Reg4Path=HKEY_LOCAL_MACHINE\SOFTWARE\Apache Group\Apache\1.3.3
  -Reg5Path=HKEY_LOCAL_MACHINE\SOFTWARE\Apache Group\Apache\1.3.3
  +Reg4Path=HKEY_LOCAL_MACHINE\SOFTWARE\Apache Group\Apache\1.3.5 dev
  +Reg5Path=HKEY_LOCAL_MACHINE\SOFTWARE\Apache Group\Apache\1.3.5 dev
   Reg5ValName=ServerRoot
   Reg5ValType=0
   Reg5ValData=<INSTALLDIR>
  
  
  
  1.2       +2 -1      apache-apr/pthreads/src/support/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/Makefile.tmpl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- Makefile.tmpl	1999/01/21 23:08:43	1.1
  +++ Makefile.tmpl	1999/02/07 06:30:18	1.2
  @@ -30,6 +30,7 @@
   
   apxs: apxs.pl
   	sed <apxs.pl >apxs \
  +	    -e 's%@TARGET@%$(TARGET)%g' \
   	    -e 's%@CC@%$(CC)%g' \
   	    -e 's%@CFLAGS@%$(CFLAGS)%g' \
   	    -e 's%@CFLAGS_SHLIB@%$(CFLAGS_SHLIB)%g' \
  @@ -67,7 +68,7 @@
    $(OSDIR)/os.h $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h
   htdigest.o: htdigest.c $(INCDIR)/ap_config.h \
    $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(INCDIR)/ap_ctype.h \
  - $(INCDIR)/hsregex.h ../main/md5c.c $(INCDIR)/ap_md5.h
  + $(INCDIR)/hsregex.h $(INCDIR)/ap_md5.h
   htpasswd.o: htpasswd.c $(INCDIR)/ap_config.h \
    $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(INCDIR)/ap_ctype.h \
    $(INCDIR)/hsregex.h
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/ab.1
  
  Index: ab.1
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/ab.1,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ab.1	1999/01/21 23:08:43	1.1
  +++ ab.1	1999/02/07 06:30:18	1.2
  @@ -1,5 +1,5 @@
   .TH ab 1 "March 1998"
  -.\" Copyright (c) 1998 The Apache Group. All rights reserved.
  +.\" Copyright (c) 1998-1999 The Apache Group. All rights reserved.
   .\"
   .\" Redistribution and use in source and binary forms, with or without
   .\" modification, are permitted provided that the following conditions
  
  
  
  1.2       +9 -9      apache-apr/pthreads/src/support/ab.c
  
  Index: ab.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/ab.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- ab.c	1999/01/21 23:08:43	1.1
  +++ ab.c	1999/02/07 06:30:18	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -155,8 +155,8 @@
       int time;                   /* time in ms for connection */
   };
   
  -#define min(a,b) ((a)<(b))?(a):(b)
  -#define max(a,b) ((a)>(b))?(a):(b)
  +#define ap_min(a,b) ((a)<(b))?(a):(b)
  +#define ap_max(a,b) ((a)>(b))?(a):(b)
   
   /* --------------------- GLOBALS ---------------------------- */
   
  @@ -320,10 +320,10 @@
   
           for (i = 0; i < requests; i++) {
               struct data s = stats[i];
  -            mincon = min(mincon, s.ctime);
  -            mintot = min(mintot, s.time);
  -            maxcon = max(maxcon, s.ctime);
  -            maxtot = max(maxtot, s.time);
  +            mincon = ap_min(mincon, s.ctime);
  +            mintot = ap_min(mintot, s.time);
  +            maxcon = ap_max(maxcon, s.ctime);
  +            maxtot = ap_max(maxtot, s.time);
               totalcon += s.ctime;
               total += s.time;
           }
  @@ -339,7 +339,7 @@
   
   /* --------------------------------------------------------- */
   
  -/* start asnchronous non-blocking connection */
  +/* start asynchronous non-blocking connection */
   
   static void start_connect(struct connection *c)
   {
  @@ -688,7 +688,7 @@
   {
       printf("This is ApacheBench, Version %s\n", VERSION);
       printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
  -    printf("Copyright (c) 1998 The Apache Group, http://www.apache.org/\n");
  +    printf("Copyright (c) 1998-1999 The Apache Group, http://www.apache.org/\n");
       printf("\n");
   }
   
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/apachectl
  
  Index: apachectl
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/apachectl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- apachectl	1999/01/21 23:08:43	1.1
  +++ apachectl	1999/02/07 06:30:18	1.2
  @@ -173,7 +173,7 @@
   exit $ERROR
   
   # ====================================================================
  -# Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  +# Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
   # 
   # Redistribution and use in source and binary forms, with or without
   # modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/apachectl.1
  
  Index: apachectl.1
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/apachectl.1,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- apachectl.1	1999/01/21 23:08:43	1.1
  +++ apachectl.1	1999/02/07 06:30:18	1.2
  @@ -1,5 +1,5 @@
   .TH apachectl 1 "September 1997"
  -.\" Copyright (c) 1997-1998 The Apache Group. All rights reserved.
  +.\" Copyright (c) 1997-1999 The Apache Group. All rights reserved.
   .\"
   .\" Redistribution and use in source and binary forms, with or without
   .\" modification, are permitted provided that the following conditions
  
  
  
  1.2       +25 -6     apache-apr/pthreads/src/support/apxs.8
  
  Index: apxs.8
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/apxs.8,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- apxs.8	1999/01/21 23:08:43	1.1
  +++ apxs.8	1999/02/07 06:30:18	1.2
  @@ -1,5 +1,5 @@
   .TH apxs 8 "April 1998"
  -.\" Copyright (c) 1998 The Apache Group. All rights reserved.
  +.\" Copyright (c) 1998-1999 The Apache Group. All rights reserved.
   .\"
   .\" Redistribution and use in source and binary forms, with or without
   .\" modification, are permitted provided that the following conditions
  @@ -79,6 +79,12 @@
   [
   .BI \-l " libname"
   ]
  +[
  +.BI \-Wc, "compiler-flags"
  +]
  +[
  +.BI \-Wl, "linker-flags"
  +]
   .IR files " ..."
   
   .B apxs
  @@ -199,11 +205,12 @@
   .I query
   parameters can be one or more of the following strings:
   .nf
  -  CC             PREFIX     
  -  LD             SBINDIR    
  -  CFLAGS         INCLUDEDIR     
  -  CFLAGS_SHLIB   LIBEXECDIR 
  -  LDFLAGS_SHLIB  SYSCONFDIR 
  +  CC              TARGET
  +  CFLAGS          SBINDIR    
  +  CFLAGS_SHLIB    INCLUDEDIR 
  +  LD_SHLIB        LIBEXECDIR 
  +  LDFLAGS_SHLIB   SYSCONFDIR 
  +  LIBS_SHLIB
   .fi
   Use this for manually determining settings. For instance use
   .nf
  @@ -269,6 +276,18 @@
   .BI \-l " libname"
   This option is directly passed through to the linker command.
   Use this to add your own libraries to search to the build process.
  +.TP 12
  +.BI \-Wc, "compiler-flags"
  +This option passes 
  +.I compiler-flags
  +as additional flags to the compiler command.
  +Use this to add local compiler-specific options.
  +.TP 12
  +.BI \-Wl, "linker-flags"
  +This option passes 
  +.I linker-flags
  +as additional flags to the linker command.
  +Use this to add local linker-specific options.
   .PP
   DSO installation options:
   .TP 12
  
  
  
  1.2       +34 -23    apache-apr/pthreads/src/support/apxs.pl
  
  Index: apxs.pl
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/apxs.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- apxs.pl	1999/01/21 23:08:43	1.1
  +++ apxs.pl	1999/02/07 06:30:18	1.2
  @@ -1,6 +1,6 @@
   #!/usr/local/bin/perl
   ## ====================================================================
  -## Copyright (c) 1998 The Apache Group.  All rights reserved.
  +## Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
   ##
   ## Redistribution and use in source and binary forms, with or without
   ## modification, are permitted provided that the following conditions
  @@ -68,6 +68,7 @@
   ##  Configuration
   ##
   
  +my $CFG_TARGET        = '@TARGET@';        # substituted via Makefile.tmpl 
   my $CFG_CC            = '@CC@';            # substituted via Makefile.tmpl
   my $CFG_CFLAGS        = '@CFLAGS@';        # substituted via Makefile.tmpl
   my $CFG_CFLAGS_SHLIB  = '@CFLAGS_SHLIB@';  # substituted via Makefile.tmpl
  @@ -90,11 +91,11 @@
   ##
   ##  Initial shared object support check
   ##
  -if (not grep(/mod_so/, `$CFG_SBINDIR/httpd -l`)) {
  +if (not grep(/mod_so/, `$CFG_SBINDIR/$CFG_TARGET -l`)) {
       print STDERR "apxs:Error: Sorry, no shared object support for Apache\n";
       print STDERR "apxs:Error: available under your platform. Make sure\n";
       print STDERR "apxs:Error: the Apache module mod_so is compiled into\n";
  -    print STDERR "apxs:Error: your server binary `$CFG_SBINDIR/httpd'.\n";
  +    print STDERR "apxs:Error: your server binary `$CFG_SBINDIR/$CFG_TARGET'.\n";
       exit(1);
   }
   
  @@ -111,6 +112,7 @@
   my @opt_I = ();
   my @opt_L = ();
   my @opt_l = ();
  +my @opt_W = ();
   my $opt_i = 0;
   my $opt_a = 0;
   my $opt_A = 0;
  @@ -185,14 +187,15 @@
       print STDERR "Usage: apxs -g -n <modname>\n";
       print STDERR "       apxs -q <query> ...\n";
       print STDERR "       apxs -c [-o <dsofile>] [-D <name>[=<value>]] [-I <incdir>]\n";
  -    print STDERR "               [-L <libdir>] [-l <libname>] <files> ...\n";
  -    print STDERR "       apxs -i [-a] [-n <modname>] <dsofile> ...\n";
  +    print STDERR "               [-L <libdir>] [-l <libname>] [-Wc,<flags>] [-Wl,<flags>]\n";
  +    print STDERR "               <files> ...\n";
  +    print STDERR "       apxs -i [-a] [-A] [-n <modname>] <dsofile> ...\n";
       exit(1);
   }
   
   #   option handling
   my $rc;
  -($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+iaA", @ARGV);
  +($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+W+iaA", @ARGV);
   &usage if ($rc == 0);
   &usage if ($#ARGV == -1 and not $opt_g);
   &usage if (not $opt_q and not ($opt_g and $opt_n) and not $opt_i and not $opt_c);
  @@ -234,6 +237,7 @@
   
       my $data = join('', <DATA>);
       $data =~ s|%NAME%|$name|sg;
  +    $data =~ s|%TARGET%|$CFG_TARGET|sg;
   
       my ($mkf, $src) = ($data =~ m|^(.+)-=#=-\n(.+)|s);
   
  @@ -263,7 +267,7 @@
           my $ok = 0;
           my $name;
           foreach $name (qw(
  -            CC LD_SHLIB CFLAGS CFLAGS_SHLIB LDFLAGS_SHLIB 
  +            TARGET CC CFLAGS CFLAGS_SHLIB LD_SHLIB LDFLAGS_SHLIB LIBS_SHLIB
               PREFIX SBINDIR INCLUDEDIR LIBEXECDIR SYSCONFDIR
           )) {
               if ($arg eq $name or $arg eq lc($name)) {
  @@ -322,7 +326,10 @@
       #   create compilation commands
       my @cmds = ();
       my $opt = '';
  -    my ($opt_I, $opt_D);
  +    my ($opt_Wc, $opt_I, $opt_D);
  +    foreach $opt_Wc (@opt_W) {
  +        $opt .= "$1 " if ($opt_Wc =~ m|^\s*c,(.*)$|);
  +    }
       foreach $opt_I (@opt_I) {
           $opt .= "-I$opt_I ";
       }
  @@ -345,7 +352,10 @@
           $cmd .= " $o";
       }
       $opt = '';
  -    my ($opt_L, $opt_l);
  +    my ($opt_Wl, $opt_L, $opt_l);
  +    foreach $opt_Wl (@opt_W) {
  +        $opt .= " $1" if ($opt_Wl =~ m|^\s*l,(.*)$|);
  +    }
       foreach $opt_L (@opt_L) {
           $opt .= " -L$opt_L";
       }
  @@ -430,17 +440,17 @@
   
       #   activate module via LoadModule/AddModule directive
       if ($opt_a or $opt_A) {
  -        if (not -f "$CFG_SYSCONFDIR/httpd.conf") {
  -            print "apxs:Error: Config file $CFG_SYSCONFDIR/httpd.conf not found\n";
  +        if (not -f "$CFG_SYSCONFDIR/$CFG_TARGET.conf") {
  +            print "apxs:Error: Config file $CFG_SYSCONFDIR/$CFG_TARGET.conf not found\n";
               exit(1);
           }
   
  -        open(FP, "<$CFG_SYSCONFDIR/httpd.conf") || die;
  +        open(FP, "<$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die;
           my $content = join('', <FP>);
           close(FP);
   
           if ($content !~ m|\n#?\s*LoadModule\s+|) {
  -            print STDERR "apxs:Error: Activation failed for custom $CFG_SYSCONFDIR/httpd.conf file.\n";
  +            print STDERR "apxs:Error: Activation failed for custom $CFG_SYSCONFDIR/$CFG_TARGET.conf file.\n";
               print STDERR "apxs:Error: At least one `LoadModule' directive already has to exist.\n";
               exit(1);
           }
  @@ -455,7 +465,7 @@
                    $update = 1;
                    $lmd =~ m|LoadModule\s+(.+?)_module.*|;
                    my $what = $opt_A ? "preparing" : "activating";
  -                 print STDERR "[$what module `$1' in $CFG_SYSCONFDIR/httpd.conf]\n";
  +                 print STDERR "[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]\n";
               }
           }
           my $amd;
  @@ -468,12 +478,12 @@
               }
           }
           if ($update) {
  -            open(FP, ">$CFG_SYSCONFDIR/httpd.conf.new") || die;
  +            open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new") || die;
               print FP $content;
               close(FP);
  -            system("cp $CFG_SYSCONFDIR/httpd.conf $CFG_SYSCONFDIR/httpd.conf.bak && " .
  -                   "cp $CFG_SYSCONFDIR/httpd.conf.new $CFG_SYSCONFDIR/httpd.conf && " .
  -                   "rm $CFG_SYSCONFDIR/httpd.conf.new");
  +            system("cp $CFG_SYSCONFDIR/$CFG_TARGET.conf $CFG_SYSCONFDIR/$CFG_TARGET.conf.bak && " .
  +                   "cp $CFG_SYSCONFDIR/$CFG_TARGET.conf.new $CFG_SYSCONFDIR/$CFG_TARGET.conf && " .
  +                   "rm $CFG_SYSCONFDIR/$CFG_TARGET.conf.new");
           }
       }
   }
  @@ -481,7 +491,7 @@
   ##EOF##
   __DATA__
   ##
  -##  Makefile -- Apache for sample %NAME% module
  +##  Makefile -- Build procedure for sample %NAME% Apache module
   ##  Autogenerated via ``apxs -n %NAME% -g''.
   ##
   
  @@ -537,10 +547,10 @@
   **
   **    $ apxs -c -i mod_%NAME%.c
   **
  -**  Then activate it in Apache's httpd.conf file for instance
  +**  Then activate it in Apache's %TARGET%.conf file for instance
   **  for the URL /%NAME% in as follows:
   **
  -**    #   httpd.conf
  +**    #   %TARGET%.conf
   **    LoadModule %NAME%_module libexec/mod_%NAME%.so
   **    <Location /%NAME%>
   **    SetHandler %NAME%
  @@ -559,7 +569,7 @@
   **
   **    HTTP/1.1 200 OK
   **    Date: Tue, 31 Mar 1998 14:42:22 GMT
  -**    Server: Apache/1.3b6-dev
  +**    Server: Apache/1.3.4 (Unix)
   **    Connection: close
   **    Content-Type: text/html
   **  
  @@ -568,7 +578,8 @@
   
   #include "httpd.h"
   #include "http_config.h"
  -#include "conf.h"
  +#include "http_protocol.h"
  +#include "ap_config.h"
   
   /* The sample content handler */
   static int %NAME%_handler(request_rec *r)
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/dbmmanage
  
  Index: dbmmanage
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/dbmmanage,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- dbmmanage	1999/01/21 23:08:43	1.1
  +++ dbmmanage	1999/02/07 06:30:19	1.2
  @@ -1,7 +1,7 @@
   #!/usr/local/bin/perl
   
   # ====================================================================
  -# Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  +# Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
   #
   # Redistribution and use in source and binary forms, with or without
   # modification, are permitted provided that the following conditions
  
  
  
  1.2       +8 -2      apache-apr/pthreads/src/support/dbmmanage.1
  
  Index: dbmmanage.1
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/dbmmanage.1,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- dbmmanage.1	1999/01/21 23:08:43	1.1
  +++ dbmmanage.1	1999/02/07 06:30:19	1.2
  @@ -1,5 +1,5 @@
   .TH dbmmanage 1 "March 1998"
  -.\" Copyright (c) 1998 The Apache Group. All rights reserved.
  +.\" Copyright (c) 1998-1999 The Apache Group. All rights reserved.
   .\"
   .\" Redistribution and use in source and binary forms, with or without
   .\" modification, are permitted provided that the following conditions
  @@ -60,7 +60,9 @@
   .I command
   ] [
   .I username
  -]
  +[
  +.I encpasswd
  +] ]
   .PP
   .SH DESCRIPTION
   .B dbmmanage
  @@ -87,6 +89,10 @@
   The filename of the DBM format file. Usually without the extension .pag or .dir.
   .IP \fB\fIcommand\fP
   This selects the operation to perform:
  +.TP 12
  +.B add
  +Adds an entry for \fIusername\fP to \fIfilename\fP using the encrypted
  +password \fIencpassword\fP.
   .TP 12
   .B adduser
   Asks for a password and then adds an entry for \fIusername\fP to
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/htdigest.1
  
  Index: htdigest.1
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/htdigest.1,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- htdigest.1	1999/01/21 23:08:43	1.1
  +++ htdigest.1	1999/02/07 06:30:19	1.2
  @@ -1,5 +1,5 @@
   .TH htdigest 1 "March 1998"
  -.\" Copyright (c) 1997-1998 The Apache Group. All rights reserved.
  +.\" Copyright (c) 1997-1999 The Apache Group. All rights reserved.
   .\"
   .\" Redistribution and use in source and binary forms, with or without
   .\" modification, are permitted provided that the following conditions
  
  
  
  1.2       +2 -4      apache-apr/pthreads/src/support/htdigest.c
  
  Index: htdigest.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/htdigest.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- htdigest.c	1999/01/21 23:08:43	1.1
  +++ htdigest.c	1999/02/07 06:30:19	1.2
  @@ -12,14 +12,12 @@
   
   #include "ap_config.h"
   #include <sys/types.h>
  -#ifdef MPE
  +#if defined(MPE) || defined(QNX)
   #include <signal.h>
   #else
   #include <sys/signal.h>
   #endif
  -
  -/* This is probably the easiest way to do it */
  -#include "../main/md5c.c"
  +#include "ap_md5.h"
   
   #define LF 10
   #define CR 13
  
  
  
  1.2       +4 -1      apache-apr/pthreads/src/support/htpasswd.1
  
  Index: htpasswd.1
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/htpasswd.1,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- htpasswd.1	1999/01/21 23:08:44	1.1
  +++ htpasswd.1	1999/02/07 06:30:19	1.2
  @@ -1,5 +1,5 @@
   .TH htpasswd 1 "February 1997"
  -.\" Copyright (c) 1997-1998 The Apache Group. All rights reserved.
  +.\" Copyright (c) 1997-1999 The Apache Group. All rights reserved.
   .\"
   .\" Redistribution and use in source and binary forms, with or without
   .\" modification, are permitted provided that the following conditions
  @@ -85,6 +85,9 @@
   .IP \-c 
   Create the \fIpasswdfile\fP. If \fIpasswdfile\fP already exists, it
   is deleted first. 
  +.IP \-m 
  +Use MD5 encryption for passwords.  On Windows, this is the only format 
  +supported.
   .IP \fB\fIpasswdfile\fP
   Name of the file to contain the user name and password. If \-c
   is given, this file is created if it does not already exist,
  
  
  
  1.2       +132 -42   apache-apr/pthreads/src/support/htpasswd.c
  
  Index: htpasswd.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/htpasswd.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- htpasswd.c	1999/01/21 23:08:44	1.1
  +++ htpasswd.c	1999/02/07 06:30:19	1.2
  @@ -13,7 +13,15 @@
   #include "ap_config.h"
   #include <sys/types.h>
   #include <signal.h>
  +#include "ap.h"
  +#include "ap_md5.h"
   
  +#ifdef WIN32
  +#include <conio.h>
  +#include "../os/win32/getopt.h"
  +#define unlink _unlink
  +#endif
  +
   #ifndef CHARSET_EBCDIC
   #define LF 10
   #define CR 13
  @@ -39,15 +47,18 @@
   {
       int x = 0, y;
   
  -    for (x = 0; ((line[x]) && (line[x] != stop)); x++)
  +    for (x = 0; ((line[x]) && (line[x] != stop)); x++) {
   	word[x] = line[x];
  +    }
   
       word[x] = '\0';
  -    if (line[x])
  +    if (line[x]) {
   	++x;
  +    }
       y = 0;
   
  -    while ((line[y++] = line[x++]));
  +    while ((line[y++] = line[x++]))
  +	;
   }
   
   static int getline(char *s, int n, FILE *f)
  @@ -57,8 +68,9 @@
       while (1) {
   	s[i] = (char) fgetc(f);
   
  -	if (s[i] == CR)
  +	if (s[i] == CR) {
   	    s[i] = fgetc(f);
  +	}
   
   	if ((s[i] == 0x4) || (s[i] == LF) || (i == (n - 1))) {
   	    s[i] = '\0';
  @@ -72,8 +84,9 @@
   {
       int x;
   
  -    for (x = 0; l[x]; x++)
  +    for (x = 0; l[x]; x++) {
   	fputc(l[x], f);
  +    }
       fputc('\n', f);
   }
   
  @@ -97,7 +110,6 @@
   
   static char *getpass(const char *prompt)
   {
  -
       static char password[81];
   
       fputs(prompt, stderr);
  @@ -111,38 +123,82 @@
   }
   
   #endif
  +
  +#ifdef WIN32
  +/* Windows lacks getpass().  So we'll re-implement it here.
  + */
   
  -static void add_password(char *user, FILE *f)
  +static char *getpass(const char *prompt)
   {
  -    char *pw, *cpw, salt[3];
  +    static char password[81];
  +    int n = 0;
   
  +    fputs(prompt, stderr);
  +    
  +    while ((password[n] = _getch()) != '\r') {
  +        if (password[n] >= ' ' && password[n] <= '~') {
  +            n++;
  +            printf("*");
  +        }
  +	else {
  +            printf("\n");
  +            fputs(prompt, stderr);
  +            n = 0;
  +        }
  +    }
  + 
  +    password[n] = '\0';
  +    printf("\n");
  +
  +    if (n > 8) {
  +        password[8] = '\0';
  +    }
  +
  +    return (char *) &password;
  +}
  +#endif
  +
  +static void add_password(char *user, FILE *f, int use_md5)
  +{
  +    char *pw, cpw[120], salt[9];
  +
       pw = strd((char *) getpass("New password:"));
       if (strcmp(pw, (char *) getpass("Re-type new password:"))) {
   	fprintf(stderr, "They don't match, sorry.\n");
  -	if (tn)
  +	if (tn) {
   	    unlink(tn);
  +	}
   	exit(1);
       }
       (void) srand((int) time((time_t *) NULL));
  -    to64(&salt[0], rand(), 2);
  -    salt[2] = '\0';
  -    cpw = (char *)crypt(pw, salt);
  +    to64(&salt[0], rand(), 8);
  +    salt[8] = '\0';
  +
  +    if (use_md5) {
  +        ap_MD5Encode(pw, salt, cpw, sizeof(cpw));
  +    }
  +    else {
  +	ap_cpystrn(cpw, (char *)crypt(pw, salt), sizeof(cpw) - 1);
  +    }
       free(pw);
       fprintf(f, "%s:%s\n", user, cpw);
   }
   
   static void usage(void)
   {
  -    fprintf(stderr, "Usage: htpasswd [-c] passwordfile username\n");
  +    fprintf(stderr, "Usage: htpasswd [-cm] passwordfile username\n");
       fprintf(stderr, "The -c flag creates a new file.\n");
  +    fprintf(stderr, "The -m flag creates a md5 encrypted file.\n");
  +    fprintf(stderr, "On Windows systems the -m flag is used by default.\n");
       exit(1);
   }
   
   static void interrupted(void)
   {
       fprintf(stderr, "Interrupted.\n");
  -    if (tn)
  +    if (tn) {
   	unlink(tn);
  +    }
       exit(1);
   }
   
  @@ -154,26 +210,59 @@
       char l[MAX_STRING_LEN];
       char w[MAX_STRING_LEN];
       char command[MAX_STRING_LEN];
  +    char filename[MAX_STRING_LEN];
       int found;
  +    int use_md5 = 0;
  +    int newfile = 0;
   
       tn = NULL;
  -    signal(SIGINT, (void (*)()) interrupted);
  -    if (argc == 4) {
  -	if (strcmp(argv[1], "-c"))
  +    signal(SIGINT, (void (*)(int)) interrupted);
  +
  +    /* preliminary check to make sure they provided at least
  +     * three arguments, we'll do better argument checking as 
  +     * we parse the command line.
  +     */
  +    if (argc < 3) {
   	    usage();
  -      if (!(tfp = fopen(argv[2], "w+"))) {
  -	    fprintf(stderr, "Could not open passwd file %s for writing.\n",
  -		    argv[2]);
  +    }
  +    else {
  +        strcpy(filename, argv[argc - 2]);
  +    }
  +
  +    /* I would rather use getopt, but Windows and UNIX seem to handle getopt
  +     * differently, so I am doing the argument checking by hand.
  +     */
  +    
  +    if (!strcmp(argv[1],"-c") || !strcmp(argv[2],"-c")) {
  +        newfile = 1;
  +    }
  +    if (!strcmp(argv[1],"-m") || !strcmp(argv[2],"-m")) {
  +        use_md5 = 1;
  +    }
  +
  +    if (!strcmp(argv[1], "-cm") || !strcmp(argv[2], "-mc")) {
  +        use_md5 = 1;
  +        newfile = 1;
  +    }
  +
  +#ifdef WIN32
  +    if (!use_md5) {
  +	use_md5 = 1;
  +	fprintf(stderr,"Automatically using md5 format on Windows.\n");
  +    }
  +#endif
  +    if (newfile) {
  +        if (!(tfp = fopen(filename, "w+"))) {
  +            fprintf(stderr, "Could not open password file %s for writing.\n",
  +                    filename);
   	    perror("fopen");
   	    exit(1);
   	}
  -	printf("Adding password for %s.\n", argv[3]);
  -	add_password(argv[3], tfp);
  +	printf("Adding password for %s.\n", argv[argc-1]);
  +	add_password(argv[argc - 1], tfp, use_md5);
   	fclose(tfp);
  -	exit(0);
  +	return(0);
       }
  -    else if (argc != 3)
  -	usage();
   
       tn = tmpnam(NULL);
       if (!(tfp = fopen(tn, "w+"))) {
  @@ -181,13 +270,15 @@
   	exit(1);
       }
   
  -    if (!(f = fopen(argv[1], "r+"))) {
  -	fprintf(stderr,
  -		"Could not open passwd file %s for reading.\n", argv[1]);
  -	fprintf(stderr, "Use -c option to create new one.\n");
  +    if (!(f = fopen(argv[argc - 2], "r+"))) {
  +        fprintf(stderr, "Could not open password file %s for reading.\n",
  +                argv[argc - 2]);
  +        fprintf(stderr, "Use -c option to create a new one\n");
  +	fclose(tfp);
  +	unlink(tn);
   	exit(1);
       }
  -    strcpy(user, argv[2]);
  +    strcpy(user, argv[argc - 1]);
   
       found = 0;
       while (!(getline(line, MAX_STRING_LEN, f))) {
  @@ -200,29 +291,28 @@
   	if (strcmp(user, w)) {
   	    putline(tfp, line);
   	    continue;
  -	}
  +        }
   	else {
   	    printf("Changing password for user %s\n", user);
  -	    add_password(user, tfp);
  +            add_password(user, tfp, use_md5);
   	    found = 1;
   	}
       }
       if (!found) {
   	printf("Adding user %s\n", user);
  -	add_password(user, tfp);
  +        add_password(user, tfp, use_md5);
       }
   /*
  -* make a copy from the tmp file to the actual file
  -*/  
  -        rewind(f);
  -        rewind(tfp);
  -        while ( fgets(command,MAX_STRING_LEN,tfp) != NULL)
  -        {
  -                fputs(command,f);
  -        } 
  + * make a copy from the tmp file to the actual file
  + */  
  +    f = fopen(filename, "w+");
  +    rewind(tfp);
  +    while (fgets(command, MAX_STRING_LEN, tfp) != NULL) {
  +	fputs(command, f);
  +    }
   
       fclose(f);
       fclose(tfp);
       unlink(tn);
  -    exit(0);
  +    return(0);
   }
  
  
  
  1.2       +11 -13    apache-apr/pthreads/src/support/httpd.8
  
  Index: httpd.8
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/httpd.8,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- httpd.8	1999/01/21 23:08:44	1.1
  +++ httpd.8	1999/02/07 06:30:19	1.2
  @@ -1,6 +1,6 @@
   .TH httpd 8 "February 1997"
   .\" Copyright (c) 1995-1997 David Robinson. All rights reserved.
  -.\" Copyright (c) 1997-1998 The Apache Group. All rights reserved.
  +.\" Copyright (c) 1997-1999 The Apache Group. All rights reserved.
   .\"
   .\" Redistribution and use in source and binary forms, with or without
   .\" modification, are permitted provided that the following conditions
  @@ -60,7 +60,7 @@
   [
   .B \-X
   ] [
  -.BI \-L " libexecdir"
  +.BI \-R " libexecdir"
   ] [
   .BI \-d " serverroot"
   ] [
  @@ -81,6 +81,9 @@
   .B \-l
   ] 
   [
  +.B \-L
  +] 
  +[
   .B \-v
   ] 
   [
  @@ -89,9 +92,6 @@
   [
   .B \-S
   ] 
  -[
  -.B \-?
  -] 
   
   .SH DESCRIPTION
   .B httpd
  @@ -115,7 +115,7 @@
   .B httpd.
   .SH OPTIONS
   .TP 12
  -.BI \-L " libexecdir"
  +.BI \-R " libexecdir"
   This option is only available if Apache was built with
   the 
   .I SHARED_CORE
  @@ -146,12 +146,15 @@
   to conditionally skip or process commands.
   .TP
   .B \-h
  -Output a list of directives together with expected arguments and
  -places where the directive is valid.
  +Output a short summary of available command line options.
   .TP
   .B \-l
   Output a list of modules compiled into the server.
   .TP
  +.B \-L
  +Output a list of directives together with expected arguments and
  +places where the directive is valid.
  +.TP
   .B \-S
   Show the settings as parsed from the config file (currently only shows the
   virtualhost settings).
  @@ -175,11 +178,6 @@
   Print the version and build parameters of 
   .B httpd
   , and then exit.
  -.TP
  -.B \-?
  -Print a list of the 
  -.B httpd 
  -options, and then exit.
   .SH FILES
   .PD 0
   .B /usr/local/apache/conf/httpd.conf
  
  
  
  1.2       +11 -0     apache-apr/pthreads/src/support/httpd.exp
  
  Index: httpd.exp
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/httpd.exp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- httpd.exp	1999/01/21 23:08:44	1.1
  +++ httpd.exp	1999/02/07 06:30:20	1.2
  @@ -1,4 +1,5 @@
   #!
  +ap_MD5Encode
   ap_MD5Final
   ap_MD5Init
   ap_MD5Update
  @@ -14,6 +15,7 @@
   ap_allow_overrides
   ap_append_arrays
   ap_array_cat
  +ap_array_pstrcat
   ap_auth_name
   ap_auth_type
   ap_basic_http_header
  @@ -96,6 +98,7 @@
   ap_escape_quotes
   ap_escape_shell_cmd
   ap_excess_requests_per_child
  +ap_exists_config_define
   ap_exists_scoreboard_image
   ap_extended_status
   ap_finalize_request_protocol
  @@ -105,6 +108,7 @@
   ap_find_last_token
   ap_find_linked_module
   ap_find_module_name
  +ap_find_opaque_token
   ap_find_path_info
   ap_find_token
   ap_find_types
  @@ -174,6 +178,7 @@
   ap_make_dirstr
   ap_make_dirstr_parent
   ap_make_dirstr_prefix
  +ap_make_etag
   ap_make_full_path
   ap_make_sub_pool
   ap_make_table
  @@ -184,7 +189,9 @@
   ap_md5digest
   ap_meets_conditions
   ap_merge_per_dir_configs
  +ap_method_number_of
   ap_month_snames
  +ap_my_generation
   ap_no2slash
   ap_note_auth_failure
   ap_note_basic_auth_failure
  @@ -197,6 +204,7 @@
   ap_open_logs
   ap_open_piped_log
   ap_os_escape_path
  +ap_os_is_filename_valid
   ap_os_is_path_absolute
   ap_overlay_tables
   ap_overlap_tables
  @@ -299,6 +307,8 @@
   ap_show_directives
   ap_show_modules
   ap_signal
  +ap_single_module_configure
  +ap_single_module_init
   ap_slack
   ap_snprintf
   ap_soft_timeout
  @@ -340,6 +350,7 @@
   ap_util_init
   ap_util_uri_init
   ap_uudecode
  +ap_validate_password
   ap_vbprintf
   ap_vformatter
   ap_vsnprintf
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/log_server_status
  
  Index: log_server_status
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/log_server_status,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- log_server_status	1999/01/21 23:08:44	1.1
  +++ log_server_status	1999/02/07 06:30:20	1.2
  @@ -1,7 +1,7 @@
   #!/usr/local/bin/perl
   
   # ====================================================================
  -# Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  +# Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
   #
   # Redistribution and use in source and binary forms, with or without
   # modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/logresolve.8
  
  Index: logresolve.8
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/logresolve.8,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- logresolve.8	1999/01/21 23:08:44	1.1
  +++ logresolve.8	1999/02/07 06:30:20	1.2
  @@ -1,5 +1,5 @@
   .TH logresolve 8 "March 1998"
  -.\" Copyright (c) 1998 The Apache Group. All rights reserved.
  +.\" Copyright (c) 1998-1999 The Apache Group. All rights reserved.
   .\"
   .\" Redistribution and use in source and binary forms, with or without
   .\" modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/logresolve.pl
  
  Index: logresolve.pl
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/logresolve.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- logresolve.pl	1999/01/21 23:08:44	1.1
  +++ logresolve.pl	1999/02/07 06:30:20	1.2
  @@ -1,7 +1,7 @@
   #!/usr/local/bin/perl
   
   # ====================================================================
  -# Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  +# Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
   #
   # Redistribution and use in source and binary forms, with or without
   # modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/rotatelogs.8
  
  Index: rotatelogs.8
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/rotatelogs.8,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- rotatelogs.8	1999/01/21 23:08:44	1.1
  +++ rotatelogs.8	1999/02/07 06:30:20	1.2
  @@ -1,5 +1,5 @@
   .TH rotatelogs 8 "March 1998"
  -.\" Copyright (c) 1998 The Apache Group. All rights reserved.
  +.\" Copyright (c) 1998-1999 The Apache Group. All rights reserved.
   .\"
   .\" Redistribution and use in source and binary forms, with or without
   .\" modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/split-logfile
  
  Index: split-logfile
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/split-logfile,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- split-logfile	1999/01/21 23:08:44	1.1
  +++ split-logfile	1999/02/07 06:30:20	1.2
  @@ -1,7 +1,7 @@
   #!/usr/local/bin/perl
   #
   # ====================================================================
  -# Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  +# Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
   #
   # Redistribution and use in source and binary forms, with or without
   # modification, are permitted provided that the following conditions
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/support/suexec.8
  
  Index: suexec.8
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/suexec.8,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- suexec.8	1999/01/21 23:08:44	1.1
  +++ suexec.8	1999/02/07 06:30:20	1.2
  @@ -1,5 +1,5 @@
   .TH suexec 8 "March 1998"
  -.\" Copyright (c) 1998 The Apache Group. All rights reserved.
  +.\" Copyright (c) 1998-1999 The Apache Group. All rights reserved.
   .\"
   .\" Redistribution and use in source and binary forms, with or without
   .\" modification, are permitted provided that the following conditions
  
  
  
  1.2       +12 -6     apache-apr/pthreads/src/support/suexec.c
  
  Index: suexec.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/suexec.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- suexec.c	1999/01/21 23:08:44	1.1
  +++ suexec.c	1999/02/07 06:30:20	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -109,7 +109,7 @@
   #define AP_ENVBUF 256
   
   extern char **environ;
  -static FILE *log;
  +static FILE *log = NULL;
   
   char *safe_env_lst[] =
   {
  @@ -500,10 +500,16 @@
       /* 
        * Be sure to close the log file so the CGI can't
        * mess with it.  If the exec fails, it will be reopened 
  -     * automatically when log_err is called.
  -     */
  -    fclose(log);
  -    log = NULL;
  +     * automatically when log_err is called.  Note that the log
  +     * might not actually be open if LOG_EXEC isn't defined.
  +     * However, the "log" cell isn't ifdef'd so let's be defensive
  +     * and assume someone might have done something with it
  +     * outside an ifdef'd LOG_EXEC block.
  +     */
  +    if (log != NULL) {
  +	fclose(log);
  +	log = NULL;
  +    }
   
       /*
        * Execute the command, replacing our image with its own.
  
  
  
  1.2       +2 -1      apache-apr/pthreads/src/support/suexec.h
  
  Index: suexec.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/support/suexec.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- suexec.h	1999/01/21 23:08:44	1.1
  +++ suexec.h	1999/02/07 06:30:21	1.2
  @@ -1,5 +1,5 @@
   /* ====================================================================
  - * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ -57,6 +57,7 @@
   
   /*
    * suexec.h -- user-definable variables for the suexec wrapper code.
  + *             (See README.configure on how to customize these variables.)
    */