]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_version_for_2.0.x branch:
authorAndré Malo <nd@apache.org>
Tue, 31 May 2005 18:30:56 +0000 (18:30 +0000)
committerAndré Malo <nd@apache.org>
Tue, 31 May 2005 18:30:56 +0000 (18:30 +0000)
* Merge r170801 to 179253 from branches/2.0.x

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/mod_version_for_2.0.x@179256 13f79535-47bb-0310-9956-ffa450edef68

28 files changed:
CHANGES
STATUS
configure.in
docs/conf/httpd-std.conf.in
docs/error/HTTP_NOT_ACCEPTABLE.html.var [deleted file]
docs/manual/install.html.de
docs/manual/install.html.en
docs/manual/install.html.es
docs/manual/install.xml
docs/manual/install.xml.de
docs/manual/install.xml.es
docs/manual/install.xml.ja
docs/manual/install.xml.ko
docs/manual/install.xml.meta
docs/manual/install.xml.ru
docs/manual/mod/mod_auth_dbm.html.en
docs/manual/mod/mod_auth_dbm.xml
docs/manual/mod/quickreference.html.de
docs/manual/mod/quickreference.html.en
docs/manual/mod/quickreference.html.es
docs/manual/mod/quickreference.html.ja.euc-jp
docs/manual/mod/quickreference.html.ko.euc-kr
docs/manual/mod/quickreference.html.ru.koi8-r
modules/experimental/util_ldap.c
modules/loggers/mod_log_config.h
modules/mappers/mod_rewrite.c
modules/proxy/proxy_http.c
server/mpm/worker/worker.c

diff --git a/CHANGES b/CHANGES
index 2195550bc68822318dd38461b934a94656e64951..234e15a147f870a541744de4cb3eafd0e6a6aa9d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,17 @@ Changes with Apache 2.0.55
      accompanying ap_version_t structure (minor MMN bump).
      [André Malo]
 
+  *) worker mpm: don't take down the whole server for a transient
+     thread creation failure. PR 34514 [Greg Ames]
+  
+  *) mod_rewrite: use buffered I/O to improve performance with large
+     RewriteMap txt: files.  [Greg Ames]
+
+  *) proxy HTTP: Rework the handling of request bodies to handle
+     chunked input and input filters which modify content length, and
+     avoid spooling arbitrary-sized request bodies in memory.
+     PR 15859.  [Jeff Trawick]
+
 Changes with Apache 2.0.54
 
   *) mod_cache: Add CacheIgnoreHeaders directive.  PR 30399.
diff --git a/STATUS b/STATUS
index 0f5725292050fc12ba06422354ba880b0c1e7e6a..c0533dac208ac4fac7b52ea563272d60faef3a72 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -106,9 +106,11 @@ PATCHES TO BACKPORT FROM TRUNK:
     *) Prevent hang writing to piped logger at graceful restart time.
        PR: 26467
          http://svn.apache.org/viewcvs?rev=170281&view=rev
+         http://svn.apache.org/viewcvs.cgi?rev=171093&view=rev
        +1: trawick, jorton
        -0: pquerna: This adds a new public function.  It should be either a 
            minor MMN bump, or be put under CORE_PRIVATE.
+           trawick: I resolved this via second commit above.  Thanks!
 
     *) Fix fd leak in piped logging code, fix error handling, and remove
        dead errno handling.
@@ -183,24 +185,6 @@ PATCHES TO BACKPORT FROM TRUNK:
                     have already.  *shrug*  Regardless, patch looks okay...
        +1: nd, jerenkrantz
 
-    * Rewrite how proxy sends its request to allow input bodies to 
-      morph the request bodies.  Previously, if an input filter
-      changed the request body, the original C-L would be sent which
-      would be incorrect.
-
-      Due to HTTP compliance, we must either send the body T-E: chunked
-      or include a C-L for the request body.  Connection: Close is not
-      an option. 
-
-      A newer version of this fix that acts even better (spools to disk) has
-      been committed to trunk.  The equivalent patch for 2.0.x is at:
-         http://www.apache.org/~trawick/20reqbody.txt
-
-      +1: trawick, jerenkrantz, +1
-     Previous votes (before trawick's recent 2.1 commits):
-      +1: stoddard, striker, jim
-      -1: brianp (we need a more robust solution than what's in 2.1 right now),
-
     * support/check_forensic: Fix tempfile usage
       svn rev 125495, 126224
       jerenkrantz says: r126224 fixes brokenness with r125495 on Solaris.
@@ -220,7 +204,7 @@ PATCHES TO BACKPORT FROM TRUNK:
 
     * mod_version: New Module, Backport from trunk. Requires Minor MMN Bump.
       http://svn.apache.org/repos/asf/httpd/httpd/branches/mod_version_for_2.0.x
-      +1: pquerna 
+      +1: pquerna, nd
       Votes from before the integration branch:
           +1: jerenkrantz, wrowe (trivial, would even be cool in 1.3)
 
@@ -254,21 +238,24 @@ PATCHES TO BACKPORT FROM TRUNK:
      *) mod_userdir: fix to palloc(sizeof struct) not palloc(sizeof pointer)
         http://svn.apache.org/viewcvs?rev=165151&view=rev
         PR: 34588
-        +1: jorton, trawick (isn't it worth a CHANGES entry for a storage
+        +1: jorton, bnicholes, trawick (isn't it worth a CHANGES entry for a storage
             corruption fix?)
-           
-     *) mod_ldap: Change the LDAP connection timeout to per-connection rather
-        than global. Fixes PR: 34618
-       http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=164919&r1=164918&r2=164919&view=diff
-       or 2.0 view patch
-       http://issues.apache.org/bugzilla/attachment.cgi?id=14873
-       +1: bnicholes, minfrin, pquerna
-       
-     *) Have configure refuse to build with doomed combinations of
-        internal/external APR/APR-util.
-          http://svn.apache.org/viewcvs?rev=170029&view=rev
-        +1: jorton, nd, trawick, pquerna
 
+     *) fix z/OS annoyance with pathname on debug messages in error log
+        http://svn.apache.org/viewcvs?rev=178299&view=rev
+        +1: trawick
+
+     *) EBCDIC: Handle chunked input from client or, with proxy, origin
+        server.
+        http://svn.apache.org/viewcvs?rev=178262&view=rev
+        (With 2.0.x it is the same code in the same function, but in 
+        a different source file.)
+        +1: trawick
+
+     *) Support the suppress-error-charset setting, as with Apache 1.3.x.
+        PR 31274. (current docs say it works with Apache from 2.0.40 ;) )
+        http://svn.apache.org/viewcvs?rev=170354&view=rev
+        +1: trawick
 
 PATCHES TO BACKPORT THAT ARE ON HOLD OR NOT GOING ANYWHERE SOON:
 
index fffc863f4d8094a3c483e4067b84cd94879b294a..f1cccd46ea04260402a10f2c73b6f8573ad9a664 100644 (file)
@@ -94,6 +94,16 @@ if test "$apu_found" = "no"; then
   AC_MSG_ERROR([APR-util not found.  Please read the documentation.])
 fi
 
+# Catch some misconfigurations:
+case ${apr_found}.${apu_found} in
+reconfig.yes)
+  AC_MSG_ERROR([Cannot use an external APR-util with the bundled APR])
+  ;;
+yes.reconfig)
+  AC_MSG_ERROR([Cannot use an external APR with the bundled APR-util])
+  ;;
+esac  
+
 if test "$apu_found" = "reconfig"; then
   APR_SUBDIR_CONFIG(srclib/apr-util,
                     [--with-apr=../apr --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir],
index 2a37a6bb6a5a859bd9b0185b52cd28dd1b1ab60b..2c15753b9061cf953d8d7e7abfa0a8b13ca36d06 100644 (file)
@@ -930,7 +930,6 @@ AddHandler type-map var
 #    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
 #    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
 #    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
-#    ErrorDocument 406 /error/HTTP_NOT_ACCEPTABLE.html.var
 #    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
 #    ErrorDocument 410 /error/HTTP_GONE.html.var
 #    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
diff --git a/docs/error/HTTP_NOT_ACCEPTABLE.html.var b/docs/error/HTTP_NOT_ACCEPTABLE.html.var
deleted file mode 100644 (file)
index 28e9982..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-Content-language: cs
-Content-type: text/html; charset=ISO-8859-2
-Body:----------cs--
-<!--#set var="CONTENT_LANGUAGE" value="cs"
---><!--#set var="CHARACTER_ENCODING" value="ISO-8859-2"
---><!--#set var="TITLE" value="Nenalezen ¾ádný akceptovatelný objekt!"
---><!--#include virtual="include/top.html" -->
-
-    Adekvátní reprezentace po¾adoveného zdroje
-    nebyla na tomto serveru nalezena.
-
-<!--#include virtual="include/bottom.html" -->
-----------cs--
-
-Content-language: de
-Content-type: text/html; charset=ISO-8859-1
-Body:----------de--
-<!--#set var="CONTENT_LANGUAGE" value="de"
---><!--#set var="TITLE" value="Kein passendes Objekt gefunden!"
---><!--#include virtual="include/top.html" -->
-
-    Unter dem angeforderten URL konnte kein geeignetes Objekt
-    auf dem Server gefunden werden, das dem vom Browser
-    geforderten Format entsprechen w&uuml;rde. 
-
-<!--#include virtual="include/bottom.html" -->
-----------de--
-
-Content-language: en
-Content-type: text/html; charset=ISO-8859-1
-Body:----------en--
-<!--#set var="TITLE" value="No acceptable object found!"
---><!--#include virtual="include/top.html" -->
-
-    An appropriate representation of the requested resource
-    could not be found on this server.
-
-<!--#include virtual="include/bottom.html" -->
-----------en--
-
-Content-language: es
-Content-type: text/html; charset=ISO-8859-1
-Body:----------es--
-<!--#set var="CONTENT_LANGUAGE" value="es"
---><!--#set var="TITLE" value="&iexcl;No se encontr&oacute; ning&uacute; objeto aceptable!"
---><!--#include virtual="include/top.html" -->
-
-       Una representaci&oacute;n apropiada de los recursos 
-       solicitados no ha podido ser localizada en 
-       este servidor.
-
-<!--#include virtual="include/bottom.html" -->
-----------es--
-
-Content-language: fr
-Content-type: text/html; charset=ISO-8859-1
-Body:----------fr--
-<!--#set var="CONTENT_LANGUAGE" value="fr"
---><!--#set var="TITLE" value="L'objet trouv&eacute; n'est pas acceptable!"
---><!--#include virtual="include/top.html" -->
-
-    Une repr&eacute;sentation appropri&eacute;e de la ressource requise
-    n'a pu &ecirc;tre trouv&eacute;e sur ce serveur.
-
-<!--#include virtual="include/bottom.html" -->  
-----------fr--
-
-Content-language: it
-Content-type: text/html; charset=ISO-8859-1
-Body:----------it--
-<!--#set var="CONTENT_LANGUAGE" value="it"
---><!--#set var="TITLE" value="Nessun oggetto accettabile!"
---><!--#include virtual="include/top.html" -->
-
-    Questo server non riesce a trovare una rappresentazione
-    appropriata per la risorsa richiesta.
-
-<!--#include virtual="include/bottom.html" -->
-----------it--
-
-Content-language: ja
-Content-type: text/html; charset=ISO-2022-JP
-Body:----------ja--
-<!--#set var="CONTENT_LANGUAGE" value="ja"
---><!--#set var="CHARACTER_ENCODING" value="iso-2022-jp"
---><!--#set var="TITLE" value="No acceptable object found!"
---><!--#include virtual="include/top.html" -->
-
-    \e$BMW5a$5$l$?%j%=!<%9$NE,@Z$JI=8=$O!"\e(B
-    \e$BK\%5!<%P$K$O8+$D$+$j$^$;$s$G$7$?!#\e(B
-
-<!--#include virtual="include/bottom.html" -->
-----------ja--
-
-Content-language: ko
-Content-type: text/html; charset=EUC-KR
-Body:----------ko--
-<!--#set var="CONTENT_LANGUAGE" value="ko"
---><!--#set var="TITLE" value="Àû´çÇÑ °´Ã¼ ¾øÀ½!"
---><!--#set var="CHARACTER_ENCODING" value="EUC-KR"
---><!--#include virtual="include/top.html" -->
-
-    ¿äûÇÑ °´Ã¼ÀÇ Àû´çÇÑ ÇüŸ¦ ÀÌ ¼­¹ö¿¡¼­ Ã£À» ¼ö ¾ø½À´Ï´Ù.
-
-<!--#include virtual="include/bottom.html" -->
-----------ko--
-
-Content-language: nl
-Content-type: text/html; charset=ISO-8859-1
-Body:----------nl--
-<!--#set var="CONTENT_LANGUAGE" value="nl"
---><!--#set var="TITLE" value="Geen acceptabel object gevonden!"
---><!--#include virtual="include/top.html" -->
-
-    Een toereikende representatie van het gevraagde object
-    kon niet gevonden worden op deze server.
-
-<!--#include virtual="include/bottom.html" -->
-----------nl--
-
-Content-language: pl
-Content-type: text/html; charset=ISO-8859-2
-Body:----------pl--
-<!--#set var="CONTENT_LANGUAGE" value="pl"
---><!--#set var="TITLE" value="Brak akceptowalnego obiektu!"
---><!--#set var="CHARACTER_ENCODING" value="ISO-8859-2"
---><!--#include virtual="include/top.html" -->
-
-    Nie znaleziono akceptowalnego obiektu reprezentuj±cego
-    ¿±dany zasób.
-
-<!--#include virtual="include/bottom.html" -->
-----------pl--
-
-Content-language: pt-br
-Content-type: text/html; charset=ISO-8859-1
-Body:-------pt-br--
-<!--#set var="CONTENT_LANGUAGE" value="pt-br"
---><!--#set var="TITLE" value="Objeto apropriado n&atilde;o encontrado!"
---><!--#include virtual="include/top.html" -->
-
-    N&atilde;o existe uma representa&ccedil;&atilde;o apropriada
-    para o recurso requisitado neste servidor.
-
-<!--#include virtual="include/bottom.html" -->
--------pt-br--
-
-Content-language: ro
-Content-type: text/html; charset=ISO-8859-1
-Body:----------ro--
-<!--#set var="CONTENT_LANGUAGE" value="ro"
---><!--#set var="TITLE" value="Nici un obiect acceptabil gasit!"
---><!--#include virtual="include/top.html" -->
-
-    Nici o reprezentare potrivita a resursei cerute
-    nu a putut fi gasita pe acest server.
-
-<!--#include virtual="include/bottom.html" -->
-----------ro--
-
-Content-language: sv
-Content-type: text/html; charset=ISO-8859-1
-Body:----------sv--
-<!--#set var="CONTENT_LANGUAGE" value="sv"
---><!--#set var="TITLE" value="Inget acceptabelt objekt hittat!"
---><!--#include virtual="include/top.html" -->
-
-    En l&auml;mplig representation av den efterfr&aring;gade
-    resursen kunde inte hittas p&aring; denna server.
-
-<!--#include virtual="include/bottom.html" -->
-----------sv--
-
-Content-language: tr
-Content-type: text/html; charset=ISO-8859-9
-Body:----------tr--
-<!--#set var="CONTENT_LANGUAGE" value="tr"
---><!--#set var="CHARACTER_ENCODING" value="ISO-8859-9"
---><!--#set var="TITLE" value="No acceptable object found!"
---><!--#include virtual="include/top.html" -->
-
-    Sunucu üzerinde, talep etti&#287;iniz kayna&#287;&#305;n
-    uygun bir kar&#351;&#305;l&#305;&#287;&#305; bulunamad&#305;.
-
-<!--#include virtual="include/bottom.html" -->
-----------tr--
index 5660acc2bfb3b73cc5e85fdab998e26364dbf364..757042f6a62d00fe83d29baf02873a1807bd6067 100644 (file)
@@ -25,6 +25,9 @@
 <a href="./ko/install.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
 <a href="./ru/install.html" hreflang="ru" rel="alternate" title="Russian">&nbsp;ru&nbsp;</a></p>
 </div>
+<div class="outofdate">Diese Übersetzung ist möglicherweise
+            nicht mehr aktuell. Bitte prüfen Sie die englische Version auf
+            die neuesten Änderungen.</div>
 
     <p>Dieses Dokument umfaßt nur die Kompilierung und Installation des
     Apache auf Unix und Unix-ähnlichen Systemen. Für die
index 4ac48432bb776525e4276a153ac8902c634099a9..af5d95e021c412674d9c01925604322ec2885174 100644 (file)
@@ -345,14 +345,15 @@ $ tar xvf httpd-2_0_<em>NN</em>.tar
     work.  (This is only valid for versions after 2.0.41; earlier
     versions have incompatible changes.)</p>
 
-    <p>If you kept the source tree from your last installation,
-    upgrading is even easier.  The file <code>config.nice</code> in
-    the root of the old source tree contains the exact
-    <code class="program"><a href="./programs/configure.html">configure</a></code> command line that you used to configure the
-    source tree.  Then to upgrade from one version to the next, you
-    need only copy the <code>config.nice</code> file to the source
-    tree of the new version, edit it to make any desired changes, and
-    then run:</p>
+    <p>To upgrade across minor versions, start by finding the file
+    <code>config.nice</code> in the <code>build</code> directory of
+    your installed server or at the root of the source tree for your
+    old install.  This will contain the exact
+    <code class="program"><a href="./programs/configure.html">configure</a></code> command line that you used to
+    configure the source tree.  Then to upgrade from one version to
+    the next, you need only copy the <code>config.nice</code> file to
+    the source tree of the new version, edit it to make any desired
+    changes, and then run:</p>
 
     <div class="example"><p><code>
     $ ./config.nice<br />
index 38b44fb4a26aaec12abf9178764a896f432f1e28..51709732741234217d6bd511a5de429d482a82ca 100644 (file)
 <a href="./ko/install.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
 <a href="./ru/install.html" hreflang="ru" rel="alternate" title="Russian">&nbsp;ru&nbsp;</a></p>
 </div>
+<div class="outofdate">Esta traducción podría estar
+            obsoleta. Consulte la versión en inglés de la
+            documentación para comprobar si se han producido cambios
+            recientemente.</div>
 
 
     <p>Este documento explica cómo compilar e instalar Apache en
index 6cff66f2d4c5e85c38f1a3f2ba74579c294f703f..5bf0484350213787dc6dcb4e25ae84974061dc25 100644 (file)
@@ -353,14 +353,15 @@ $ tar xvf httpd-2_0_<em>NN</em>.tar
     work.  (This is only valid for versions after 2.0.41; earlier
     versions have incompatible changes.)</p>
 
-    <p>If you kept the source tree from your last installation,
-    upgrading is even easier.  The file <code>config.nice</code> in
-    the root of the old source tree contains the exact
-    <program>configure</program> command line that you used to configure the
-    source tree.  Then to upgrade from one version to the next, you
-    need only copy the <code>config.nice</code> file to the source
-    tree of the new version, edit it to make any desired changes, and
-    then run:</p>
+    <p>To upgrade across minor versions, start by finding the file
+    <code>config.nice</code> in the <code>build</code> directory of
+    your installed server or at the root of the source tree for your
+    old install.  This will contain the exact
+    <program>configure</program> command line that you used to
+    configure the source tree.  Then to upgrade from one version to
+    the next, you need only copy the <code>config.nice</code> file to
+    the source tree of the new version, edit it to make any desired
+    changes, and then run:</p>
 
     <example>
     $ ./config.nice<br />
index 899535bd099ae575d31c94bd3ce8644a33f47bad..372c54a2f87142bc85ccae0784f32eb5c82942a8 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='UTF-8' ?>
 <!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="./style/manual.de.xsl"?>
-<!-- English Revision: 151405 -->
+<!-- English Revision: 151405:178522 (outdated) -->
 
 <!--
  Copyright 2002-2004 The Apache Software Foundation
index 26135acc874ef06538c5c1bfcb41b1987b5742c1..65aff6c4467b9af91e2d37bd698b8b0f8783f7b3 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='UTF-8' ?>
 <!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="./style/manual.es.xsl"?>
-<!-- English Revision: 151405 -->
+<!-- English Revision: 151405:178522 (outdated) -->
 
 <!--
  Copyright 2004-2005 The Apache Software Foundation
index a423c63e61db7feee87ba3f1d78d0cfd55139f34..c51dd90ed9acc10e4078c039a0a8b2c92b571204 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='iso-2022-jp' ?>
 <!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="./style/manual.ja.xsl"?>
-<!-- English Revision: 106090:151405 (outdated) -->
+<!-- English Revision: 106090:178522 (outdated) -->
 
 <!--
  Copyright 2002-2004 The Apache Software Foundation
index f82dc098652caa5ba78b980783524cfbd7693e7c..bfe70879ee54b2b7aedd8b9d460c904ba9851b95 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='EUC-KR' ?>
 <!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="./style/manual.ko.xsl"?>
-<!-- English Revision: 106090:151405 (outdated) -->
+<!-- English Revision: 106090:178522 (outdated) -->
 
 <!--
  Copyright 2003-2004 The Apache Software Foundation
index edd8099f4a02fd92e8ce1e691b6435683ad2c451..e0e35e7b9eafeb7fe419b70f94f700e1fa393fa5 100644 (file)
@@ -6,9 +6,9 @@
   <relpath>.</relpath>
 
   <variants>
-    <variant>de</variant>
+    <variant outdated="yes">de</variant>
     <variant>en</variant>
-    <variant>es</variant>
+    <variant outdated="yes">es</variant>
     <variant outdated="yes">ja</variant>
     <variant outdated="yes">ko</variant>
     <variant outdated="yes">ru</variant>
index 73615219f056566412e7a0a6d65a0f565afde288..706a30c9f2ac873fae8c00109dd26bd81d4a2d12 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='KOI8-R' ?>
 <!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="./style/manual.ru.xsl"?>
-<!-- English Revision: 97974:151405 (outdated) -->
+<!-- English Revision: 97974:178522 (outdated) -->
 
 <!--
  Copyright 2002-2004 The Apache Software Foundation
index f2391dfefbee660cd6d4898e09c163659e38204f..5426e15ad38f8b19b5916f13c83f769522140ce1 100644 (file)
@@ -55,7 +55,7 @@
 <div class="directive-section"><h2><a name="AuthDBMAuthoritative" id="AuthDBMAuthoritative">AuthDBMAuthoritative</a> <a name="authdbmauthoritative" id="authdbmauthoritative">Directive</a></h2>
 <table class="directive">
 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets whether authentication and authorization will be
-passwed on to lower level modules</td></tr>
+passed on to lower level modules</td></tr>
 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDBMAuthoritative On|Off</code></td></tr>
 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDBMAuthoritative On</code></td></tr>
 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
index d30d176daeefd42ee5dcbee8605ec17bd2dcea3a..c33dc2a5b8baef7540c7a1433f6d722dbe20aab1 100644 (file)
@@ -165,7 +165,7 @@ store passwords</description>
 <directivesynopsis>
 <name>AuthDBMAuthoritative</name>
 <description>Sets whether authentication and authorization will be
-passwed on to lower level modules</description>
+passed on to lower level modules</description>
 <syntax>AuthDBMAuthoritative On|Off</syntax>
 <default>AuthDBMAuthoritative On</default>
 <contextlist><context>directory</context><context>.htaccess</context>
index a117b7df3a41d33b4e98ed0d911c5d11301795de..95944a28f127f5ca0028bc9746560a2c889cb779 100644 (file)
@@ -144,7 +144,7 @@ formatted email address</td></tr>
 <tr><td><a href="mod_auth.html#authauthoritative">AuthAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>B</td></tr><tr><td class="descr" colspan="4">Sets whether authorization and authentication are
 passed to lower level modules</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmauthoritative">AuthDBMAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets whether authentication and authorization will be
-passwed on to lower level modules</td></tr>
+passed on to lower level modules</td></tr>
 <tr><td><a href="mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile <var>file-path</var></a></td><td></td><td>dh</td><td>E</td></tr><tr><td class="descr" colspan="4">Sets the name of the database file containing the list
 of user groups for authentication</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmtype">AuthDBMType default|SDBM|GDBM|NDBM|DB</a></td><td> default </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets the type of database file that is used to
index 2568d71ce001239f72eca9eb2dcfbcfa6d8026d6..f1a6230da4e44bf939a5531ad499b256b3cc4094 100644 (file)
@@ -140,7 +140,7 @@ formatted email address</td></tr>
 <tr><td><a href="mod_auth.html#authauthoritative">AuthAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>B</td></tr><tr><td class="descr" colspan="4">Sets whether authorization and authentication are
 passed to lower level modules</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmauthoritative">AuthDBMAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets whether authentication and authorization will be
-passwed on to lower level modules</td></tr>
+passed on to lower level modules</td></tr>
 <tr><td><a href="mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile <var>file-path</var></a></td><td></td><td>dh</td><td>E</td></tr><tr><td class="descr" colspan="4">Sets the name of the database file containing the list
 of user groups for authentication</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmtype">AuthDBMType default|SDBM|GDBM|NDBM|DB</a></td><td> default </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets the type of database file that is used to
index 9560eb11cb8dc70f916ce82cde8804d03dad81c8..656f40a75186a9550101d44b40bd4f3a8c6fae40 100644 (file)
@@ -145,7 +145,7 @@ formatted email address</td></tr>
 <tr><td><a href="mod_auth.html#authauthoritative">AuthAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>B</td></tr><tr><td class="descr" colspan="4">Sets whether authorization and authentication are
 passed to lower level modules</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmauthoritative">AuthDBMAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets whether authentication and authorization will be
-passwed on to lower level modules</td></tr>
+passed on to lower level modules</td></tr>
 <tr><td><a href="mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile <var>file-path</var></a></td><td></td><td>dh</td><td>E</td></tr><tr><td class="descr" colspan="4">Sets the name of the database file containing the list
 of user groups for authentication</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmtype">AuthDBMType default|SDBM|GDBM|NDBM|DB</a></td><td> default </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets the type of database file that is used to
index dde07fbfb7d175926fbb22e9ab49c6924f8263c9..83f8d9c92e10d7b053222aa27b153b3f8e259336 100644 (file)
@@ -136,7 +136,7 @@ formatted email address</td></tr>
 <tr><td><a href="mod_auth.html#authauthoritative">AuthAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>B</td></tr><tr><td class="descr" colspan="4">ǧ¾Ú¤È¾µÇ§¥×¥í¥»¥¹¤ò¡¢
 ¤è¤êÄ㤤¥ì¥Ù¥ë¤Î¥â¥¸¥å¡¼¥ë¤Ë°Ü¹Ô¤µ¤»¤ë¤«¤É¤¦¤«¤òÀßÄꤹ¤ë</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmauthoritative">AuthDBMAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets whether authentication and authorization will be
-passwed on to lower level modules</td></tr>
+passed on to lower level modules</td></tr>
 <tr><td><a href="mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile <var>file-path</var></a></td><td></td><td>dh</td><td>E</td></tr><tr><td class="descr" colspan="4">Sets the name of the database file containing the list
 of user groups for authentication</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmtype">AuthDBMType default|SDBM|GDBM|NDBM|DB</a></td><td> default </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets the type of database file that is used to
index 1ddc407af45d5aefcfa99d88e51fa7b6018c7e33..3deb70e38b75025c98a2070199315bbeb7e3a290 100644 (file)
@@ -134,7 +134,7 @@ formatted email address</td></tr>
 <tr><td><a href="mod_auth.html#authauthoritative">AuthAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>B</td></tr><tr><td class="descr" colspan="4">Sets whether authorization and authentication are
 passed to lower level modules</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmauthoritative">AuthDBMAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets whether authentication and authorization will be
-passwed on to lower level modules</td></tr>
+passed on to lower level modules</td></tr>
 <tr><td><a href="mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile <var>file-path</var></a></td><td></td><td>dh</td><td>E</td></tr><tr><td class="descr" colspan="4">Sets the name of the database file containing the list
 of user groups for authentication</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmtype">AuthDBMType default|SDBM|GDBM|NDBM|DB</a></td><td> default </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets the type of database file that is used to
index d3a67f7e56d443ce45b5c1a0acead1ae7190dd3d..4e42f6c71a1633f19e4c1e7ff881207a2c2780d1 100644 (file)
@@ -142,7 +142,7 @@ formatted email address</td></tr>
 <tr><td><a href="mod_auth.html#authauthoritative">AuthAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>B</td></tr><tr><td class="descr" colspan="4">Sets whether authorization and authentication are
 passed to lower level modules</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmauthoritative">AuthDBMAuthoritative On|Off</a></td><td> On </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets whether authentication and authorization will be
-passwed on to lower level modules</td></tr>
+passed on to lower level modules</td></tr>
 <tr><td><a href="mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile <var>file-path</var></a></td><td></td><td>dh</td><td>E</td></tr><tr><td class="descr" colspan="4">Sets the name of the database file containing the list
 of user groups for authentication</td></tr>
 <tr class="odd"><td><a href="mod_auth_dbm.html#authdbmtype">AuthDBMType default|SDBM|GDBM|NDBM|DB</a></td><td> default </td><td>dh</td><td>E</td></tr><tr class="odd"><td class="descr" colspan="4">Sets the type of database file that is used to
index 6c76f69517a097a59c178f4a90b1042df9713cc4..3af630bca462d1750f01c4aa7ebd3cdd6eb3baef 100644 (file)
@@ -241,6 +241,8 @@ LDAP_DECLARE(int) util_ldap_connection_open(request_rec *r,
     int result = 0;
     int failures = 0;
     int version  = LDAP_VERSION3;
+    int rc = LDAP_SUCCESS;
+    struct timeval timeOut = {10,0};    /* 10 second connection timeout */
 
     util_ldap_state_t *st = (util_ldap_state_t *)ap_get_module_config(
                                 r->server->module_config, &ldap_module);
@@ -317,6 +319,19 @@ LDAP_DECLARE(int) util_ldap_connection_open(request_rec *r,
         /* always default to LDAP V3 */
         ldap_set_option(ldc->ldap, LDAP_OPT_PROTOCOL_VERSION, &version);
 
+#ifdef LDAP_OPT_NETWORK_TIMEOUT
+        if (st->connectionTimeout > 0) {
+            timeOut.tv_sec = st->connectionTimeout;
+        }
+
+        if (st->connectionTimeout >= 0) {
+            rc = ldap_set_option(NULL, LDAP_OPT_NETWORK_TIMEOUT, (void *)&timeOut);
+            if (APR_SUCCESS != rc) {
+                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
+                                 "LDAP: Could not set the connection timeout" );
+            }
+        }
+#endif
     }
 
 
@@ -1405,7 +1420,6 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
 
     void *data;
     const char *userdata_key = "util_ldap_init";
-    struct timeval timeOut = {10,0};    /* 10 second connection timeout */
 
     /* util_ldap_post_config() will be called twice. Don't bother
      * going through all of the initialization on the first call
@@ -1630,20 +1644,6 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
                          "LDAP: SSL support unavailable" );
     }
     
-#ifdef LDAP_OPT_NETWORK_TIMEOUT
-    if (st->connectionTimeout > 0) {
-        timeOut.tv_sec = st->connectionTimeout;
-    }
-
-    if (st->connectionTimeout >= 0) {
-        rc = ldap_set_option(NULL, LDAP_OPT_NETWORK_TIMEOUT, (void *)&timeOut);
-        if (APR_SUCCESS != rc) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
-                             "LDAP: Could not set the connection timeout" );
-        }
-    }
-#endif
-
     return(OK);
 }
 
index 0b3f270d8980b19b2abfe0c4184c9691344b0ab1..957d73325ffcaa122f6d71bc7888a84c35cc5640 100644 (file)
@@ -27,7 +27,7 @@
 typedef const char *ap_log_handler_fn_t(request_rec *r, char *a);
 
 /**
- * callback function prototype for a external writer initilization.
+ * callback function prototype for external writer initialization.
  */
 typedef void *ap_log_writer_init(apr_pool_t *p, server_rec *s, 
                                  const char *name);
index 62bfe1335b424ea776180967b781bdebe61dff06..563d97a39f9cda8c0953b808fe02338b72c0a21f 100644 (file)
@@ -3165,7 +3165,7 @@ static char *lookup_map_txtfile(request_rec *r, const char *file, char *key)
     char *curkey;
     char *curval;
 
-    rc = apr_file_open(&fp, file, APR_READ, APR_OS_DEFAULT, r->pool);
+    rc = apr_file_open(&fp, file, APR_READ|APR_BUFFERED, APR_OS_DEFAULT, r->pool);
     if (rc != APR_SUCCESS) {
        return NULL;
     }
index b89d74251392a6abed08271b050e9c613bc5a2f3..a26e5caca2e0737a889e36921bb6112a0e443099 100644 (file)
@@ -384,6 +384,480 @@ apr_status_t ap_proxy_http_create_connection(apr_pool_t *p, request_rec *r,
     return OK;
 }
 
+static void add_te_chunked(apr_pool_t *p,
+                           apr_bucket_alloc_t *bucket_alloc,
+                           apr_bucket_brigade *header_brigade)
+{
+    apr_bucket *e;
+    char *buf;
+    const char te_hdr[] = "Transfer-Encoding: chunked" CRLF;
+
+    buf = apr_pmemdup(p, te_hdr, sizeof(te_hdr)-1);
+    ap_xlate_proto_to_ascii(buf, sizeof(te_hdr)-1);
+
+    e = apr_bucket_pool_create(buf, sizeof(te_hdr)-1, p, bucket_alloc);
+    APR_BRIGADE_INSERT_TAIL(header_brigade, e);
+}
+
+static void add_cl(apr_pool_t *p,
+                   apr_bucket_alloc_t *bucket_alloc,
+                   apr_bucket_brigade *header_brigade,
+                   const char *cl_val)
+{
+    apr_bucket *e;
+    char *buf;
+
+    buf = apr_pstrcat(p, "Content-Length: ",
+                      cl_val,
+                      CRLF,
+                      NULL);
+    ap_xlate_proto_to_ascii(buf, strlen(buf));
+    e = apr_bucket_pool_create(buf, strlen(buf), p, bucket_alloc);
+    APR_BRIGADE_INSERT_TAIL(header_brigade, e);
+}
+
+#define ASCII_CRLF  "\015\012"
+#define ASCII_ZERO  "\060"
+
+static void terminate_headers(apr_bucket_alloc_t *bucket_alloc,
+                              apr_bucket_brigade *header_brigade)
+{
+    apr_bucket *e;
+
+    /* add empty line at the end of the headers */
+    e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc);
+    APR_BRIGADE_INSERT_TAIL(header_brigade, e);
+}
+
+static apr_status_t pass_brigade(apr_bucket_alloc_t *bucket_alloc,
+                                 request_rec *r, proxy_http_conn_t *p_conn,
+                                 conn_rec *origin, apr_bucket_brigade *b,
+                                 int flush)
+{
+    apr_status_t status;
+
+    if (flush) {
+        apr_bucket *e = apr_bucket_flush_create(bucket_alloc);
+        APR_BRIGADE_INSERT_TAIL(b, e);
+    }
+    status = ap_pass_brigade(origin->output_filters, b);
+    if (status != APR_SUCCESS) {
+        ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
+                     "proxy: pass request data failed to %pI (%s)",
+                     p_conn->addr, p_conn->name);
+        return status;
+    }
+    apr_brigade_cleanup(b);
+    return APR_SUCCESS;
+}
+
+static apr_status_t stream_reqbody_chunked(apr_pool_t *p,
+                                           request_rec *r,
+                                           proxy_http_conn_t *p_conn,
+                                           conn_rec *origin,
+                                           apr_bucket_brigade *header_brigade)
+{
+    int seen_eos = 0;
+    apr_size_t hdr_len;
+    apr_off_t bytes;
+    apr_status_t status;
+    apr_bucket_alloc_t *bucket_alloc = r->connection->bucket_alloc;
+    apr_bucket_brigade *b, *input_brigade;
+    apr_bucket *e;
+
+    input_brigade = apr_brigade_create(p, bucket_alloc);
+
+    do {
+        char chunk_hdr[20];  /* must be here due to transient bucket. */
+
+        status = ap_get_brigade(r->input_filters, input_brigade,
+                                AP_MODE_READBYTES, APR_BLOCK_READ,
+                                HUGE_STRING_LEN);
+
+        if (status != APR_SUCCESS) {
+            return status;
+        }
+
+        /* If this brigade contains EOS, either stop or remove it. */
+        if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))) {
+            seen_eos = 1;
+
+            /* As a shortcut, if this brigade is simply an EOS bucket,
+             * don't send anything down the filter chain.
+             */
+            if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(input_brigade))) {
+                break;
+            }
+
+            /* We can't pass this EOS to the output_filters. */
+            e = APR_BRIGADE_LAST(input_brigade);
+            apr_bucket_delete(e);
+        }
+
+        apr_brigade_length(input_brigade, 1, &bytes);
+
+        hdr_len = apr_snprintf(chunk_hdr, sizeof(chunk_hdr),
+                               "%" APR_UINT64_T_HEX_FMT CRLF, 
+                               (apr_uint64_t)bytes);
+        
+        ap_xlate_proto_to_ascii(chunk_hdr, hdr_len);
+        e = apr_bucket_transient_create(chunk_hdr, hdr_len,
+                                        bucket_alloc);
+        APR_BRIGADE_INSERT_HEAD(input_brigade, e);
+        
+        /*
+         * Append the end-of-chunk CRLF
+         */
+        e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc);
+        APR_BRIGADE_INSERT_TAIL(input_brigade, e);
+        
+        if (header_brigade) {
+            /* we never sent the header brigade, so go ahead and
+             * take care of that now
+             */
+            add_te_chunked(p, bucket_alloc, header_brigade);
+            terminate_headers(bucket_alloc, header_brigade);
+            b = header_brigade;
+            APR_BRIGADE_CONCAT(b, input_brigade);
+            header_brigade = NULL;
+        }
+        else {
+            b = input_brigade;
+        }
+        
+        status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 0);
+        if (status != APR_SUCCESS) {
+            return status;
+        }
+    } while (!seen_eos);
+
+    if (header_brigade) {
+        /* we never sent the header brigade because there was no request body;
+         * send it now without T-E
+         */
+        terminate_headers(bucket_alloc, header_brigade);
+        b = header_brigade;
+    }
+    else {
+        if (!APR_BRIGADE_EMPTY(input_brigade)) {
+            /* input brigade still has an EOS which we can't pass to the output_filters. */
+            e = APR_BRIGADE_LAST(input_brigade);
+            AP_DEBUG_ASSERT(APR_BUCKET_IS_EOS(e));
+            apr_bucket_delete(e);
+        }
+        e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF
+                                       /* <trailers> */
+                                       ASCII_CRLF,
+                                       5, bucket_alloc);
+        APR_BRIGADE_INSERT_TAIL(input_brigade, e);
+        b = input_brigade;
+    }
+    
+    status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 1);
+    return status;
+}
+
+static apr_status_t stream_reqbody_cl(apr_pool_t *p,
+                                      request_rec *r,
+                                      proxy_http_conn_t *p_conn,
+                                      conn_rec *origin,
+                                      apr_bucket_brigade *header_brigade,
+                                      const char *old_cl_val)
+{
+    int seen_eos = 0;
+    apr_status_t status;
+    apr_bucket_alloc_t *bucket_alloc = r->connection->bucket_alloc;
+    apr_bucket_brigade *b, *input_brigade;
+    apr_bucket *e;
+
+    input_brigade = apr_brigade_create(p, bucket_alloc);
+
+    do {
+        status = ap_get_brigade(r->input_filters, input_brigade,
+                                AP_MODE_READBYTES, APR_BLOCK_READ,
+                                HUGE_STRING_LEN);
+
+        if (status != APR_SUCCESS) {
+            return status;
+        }
+
+        /* If this brigade contains EOS, either stop or remove it. */
+        if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))) {
+            seen_eos = 1;
+
+            /* As a shortcut, if this brigade is simply an EOS bucket,
+             * don't send anything down the filter chain.
+             */
+            if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(input_brigade))) {
+                break;
+            }
+
+            /* We can't pass this EOS to the output_filters. */
+            e = APR_BRIGADE_LAST(input_brigade);
+            apr_bucket_delete(e);
+        }
+
+        if (header_brigade) {
+            /* we never sent the header brigade, so go ahead and
+             * take care of that now
+             */
+            add_cl(p, bucket_alloc, header_brigade, old_cl_val);
+            terminate_headers(bucket_alloc, header_brigade);
+            b = header_brigade;
+            APR_BRIGADE_CONCAT(b, input_brigade);
+            header_brigade = NULL;
+        }
+        else {
+            b = input_brigade;
+        }
+        
+        status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 0);
+        if (status != APR_SUCCESS) {
+            return status;
+        }
+    } while (!seen_eos);
+
+    if (header_brigade) {
+        /* we never sent the header brigade since there was no request
+         * body; send it now, and only specify C-L if client specified
+         * C-L: 0
+         */
+        if (!strcmp(old_cl_val, "0")) {
+            add_cl(p, bucket_alloc, header_brigade, old_cl_val);
+        }
+        terminate_headers(bucket_alloc, header_brigade);
+        b = header_brigade;
+    }
+    else {
+        /* need to flush any pending data */
+        b = input_brigade; /* empty now; pass_brigade() will add flush */
+    }
+    status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 1);
+    return status;
+}
+
+#define MAX_MEM_SPOOL 16384
+
+static apr_status_t spool_reqbody_cl(apr_pool_t *p,
+                                     request_rec *r,
+                                     proxy_http_conn_t *p_conn,
+                                     conn_rec *origin,
+                                     apr_bucket_brigade *header_brigade)
+{
+    int seen_eos = 0;
+    apr_status_t status;
+    apr_bucket_alloc_t *bucket_alloc = r->connection->bucket_alloc;
+    apr_bucket_brigade *body_brigade, *input_brigade;
+    apr_bucket *e;
+    apr_off_t bytes, bytes_spooled = 0, fsize = 0;
+    apr_file_t *tmpfile = NULL;
+
+    body_brigade = apr_brigade_create(p, bucket_alloc);
+    input_brigade = apr_brigade_create(p, bucket_alloc);
+
+    do {
+        status = ap_get_brigade(r->input_filters, input_brigade,
+                                AP_MODE_READBYTES, APR_BLOCK_READ,
+                                HUGE_STRING_LEN);
+
+        if (status != APR_SUCCESS) {
+            return status;
+        }
+
+        /* If this brigade contains EOS, either stop or remove it. */
+        if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))) {
+            seen_eos = 1;
+
+            /* As a shortcut, if this brigade is simply an EOS bucket,
+             * don't send anything down the filter chain.
+             */
+            if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(input_brigade))) {
+                break;
+            }
+
+            /* We can't pass this EOS to the output_filters. */
+            e = APR_BRIGADE_LAST(input_brigade);
+            apr_bucket_delete(e);
+        }
+
+        apr_brigade_length(input_brigade, 1, &bytes);
+
+        if (bytes_spooled + bytes > MAX_MEM_SPOOL) {
+            /* can't spool any more in memory; write latest brigade to disk */
+            if (tmpfile == NULL) {
+                const char *temp_dir;
+                char *template;
+
+                status = apr_temp_dir_get(&temp_dir, p);
+                if (status != APR_SUCCESS) {
+                    ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
+                                 "proxy: search for temporary directory failed");
+                    return status;
+                }
+                apr_filepath_merge(&template, temp_dir,
+                                   "modproxy.tmp.XXXXXX",
+                                   APR_FILEPATH_NATIVE, p);
+                status = apr_file_mktemp(&tmpfile, template, 0, p);
+                if (status != APR_SUCCESS) {
+                    ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
+                                 "proxy: creation of temporary file in directory %s failed",
+                                 temp_dir);
+                    return status;
+                }
+            }
+            for (e = APR_BRIGADE_FIRST(input_brigade);
+                 e != APR_BRIGADE_SENTINEL(input_brigade);
+                 e = APR_BUCKET_NEXT(e)) {
+                const char *data;
+                apr_size_t bytes_read, bytes_written;
+
+                apr_bucket_read(e, &data, &bytes_read, APR_BLOCK_READ);
+                status = apr_file_write_full(tmpfile, data, bytes_read, &bytes_written);
+                if (status != APR_SUCCESS) {
+                    const char *tmpfile_name;
+
+                    if (apr_file_name_get(&tmpfile_name, tmpfile) != APR_SUCCESS) {
+                        tmpfile_name = "(unknown)";
+                    }
+                    ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
+                                 "proxy: write to temporary file %s failed",
+                                 tmpfile_name);
+                    return status;
+                }
+                AP_DEBUG_ASSERT(bytes_read == bytes_written);
+                fsize += bytes_written;
+            }
+            apr_brigade_cleanup(input_brigade);
+        }
+        else {
+            APR_BRIGADE_CONCAT(body_brigade, input_brigade);
+        }
+        
+        bytes_spooled += bytes;
+
+    } while (!seen_eos);
+
+    if (bytes_spooled) {
+        add_cl(p, bucket_alloc, header_brigade, apr_off_t_toa(p, bytes_spooled));
+    }
+    terminate_headers(bucket_alloc, header_brigade);
+    APR_BRIGADE_CONCAT(header_brigade, body_brigade);
+    if (tmpfile) {
+        /* For platforms where the size of the file may be larger than
+         * that which can be stored in a single bucket (where the
+         * length field is an apr_size_t), split it into several
+         * buckets: */
+        if (sizeof(apr_off_t) > sizeof(apr_size_t)
+            && fsize > AP_MAX_SENDFILE) {
+            e = apr_bucket_file_create(tmpfile, 0, AP_MAX_SENDFILE, p,
+                                       bucket_alloc);
+            while (fsize > AP_MAX_SENDFILE) {
+                apr_bucket *ce;
+                apr_bucket_copy(e, &ce);
+                APR_BRIGADE_INSERT_TAIL(header_brigade, ce);
+                e->start += AP_MAX_SENDFILE;
+                fsize -= AP_MAX_SENDFILE;
+            }
+            e->length = (apr_size_t)fsize; /* Resize just the last bucket */
+        }
+        else {
+            e = apr_bucket_file_create(tmpfile, 0, (apr_size_t)fsize, p,
+                                       bucket_alloc);
+        }
+        APR_BRIGADE_INSERT_TAIL(header_brigade, e);
+    }
+    status = pass_brigade(bucket_alloc, r, p_conn, origin, header_brigade, 1);
+    return status;
+}
+
+static apr_status_t send_request_body(apr_pool_t *p,
+                                      request_rec *r,
+                                      proxy_http_conn_t *p_conn,
+                                      conn_rec *origin,
+                                      apr_bucket_brigade *header_brigade,
+                                      int force10)
+{
+    enum {RB_INIT, RB_STREAM_CL, RB_STREAM_CHUNKED, RB_SPOOL_CL} rb_method = RB_INIT;
+    const char *old_cl_val, *te_val;
+    int cl_zero; /* client sent "Content-Length: 0", which we forward on to server */
+    apr_status_t status;
+
+    /* send CL or use chunked encoding?
+     *
+     * . CL is the most friendly to the origin server since it is the
+     *   most widely supported
+     * . CL stinks if we don't know the length since we have to buffer
+     *   the data in memory or on disk until we get the entire data
+     *
+     * special cases to check for:
+     * . if we're using HTTP/1.0 to origin server, then we must send CL
+     * . if client sent C-L and there are no input resource filters, the
+     *   the body size can't change so we send the same CL and stream the
+     *   body
+     * . if client used chunked or proxy-sendchunks is set, we'll also
+     *   use chunked
+     *
+     * normal case:
+     *   we have to compute content length by reading the entire request
+     *   body; if request body is not small, we'll spool the remaining input
+     *   to a temporary file
+     *
+     * special envvars to override the normal decision:
+     * . proxy-sendchunks
+     *   use chunked encoding; not compatible with force-proxy-request-1.0
+     * . proxy-sendcl
+     *   spool the request body to compute C-L
+     * . proxy-sendunchangedcl
+     *   use C-L from client and spool the request body
+     */
+    old_cl_val = apr_table_get(r->headers_in, "Content-Length");
+    cl_zero = old_cl_val && !strcmp(old_cl_val, "0");
+
+    if (!force10
+        && !cl_zero
+        && apr_table_get(r->subprocess_env, "proxy-sendchunks")) {
+        rb_method = RB_STREAM_CHUNKED;
+    }
+    else if (!cl_zero
+             && apr_table_get(r->subprocess_env, "proxy-sendcl")) {
+        rb_method = RB_SPOOL_CL;
+    }
+    else {
+        if (old_cl_val &&
+            (r->input_filters == r->proto_input_filters
+             || cl_zero
+             || apr_table_get(r->subprocess_env, "proxy-sendunchangedcl"))) {
+            rb_method = RB_STREAM_CL;
+        }
+        else if (force10) {
+            rb_method = RB_SPOOL_CL;
+        }
+        else if ((te_val = apr_table_get(r->headers_in, "Transfer-Encoding"))
+                  && !strcasecmp(te_val, "chunked")) {
+            rb_method = RB_STREAM_CHUNKED;
+        }
+        else {
+            rb_method = RB_SPOOL_CL;
+        }
+    }
+
+    switch(rb_method) {
+    case RB_STREAM_CHUNKED:
+        status = stream_reqbody_chunked(p, r, p_conn, origin, header_brigade);
+        break;
+    case RB_STREAM_CL:
+        status = stream_reqbody_cl(p, r, p_conn, origin, header_brigade, old_cl_val);
+        break;
+    case RB_SPOOL_CL:
+        status = spool_reqbody_cl(p, r, p_conn, origin, header_brigade);
+        break;
+    default:
+        ap_assert(1 != 1);
+    }
+
+    return status;
+}
+
 static
 apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
                                    proxy_http_conn_t *p_conn, conn_rec *origin, 
@@ -396,8 +870,9 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
     apr_bucket *e;
     const apr_array_header_t *headers_in_array;
     const apr_table_entry_t *headers_in;
-    int counter, seen_eos;
+    int counter;
     apr_status_t status;
+    int force10;
 
     /*
      * Send the HTTP/1.1 request to the remote server
@@ -424,8 +899,10 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
 
     if ( apr_table_get(r->subprocess_env,"force-proxy-request-1.0")) {
         buf = apr_pstrcat(p, r->method, " ", url, " HTTP/1.0" CRLF, NULL);
+        force10 = 1;
     } else {
         buf = apr_pstrcat(p, r->method, " ", url, " HTTP/1.1" CRLF, NULL);
+        force10 = 0;
     }
     if ( apr_table_get(r->subprocess_env,"proxy-nokeepalive")) {
         apr_table_unset(r->headers_in, "Connection");
@@ -547,6 +1024,10 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
             || !apr_strnatcasecmp(headers_in[counter].key, "Transfer-Encoding")
             || !apr_strnatcasecmp(headers_in[counter].key, "Upgrade")
 
+            /* We'll add appropriate Content-Length later, if appropriate.
+             */
+            || !apr_strnatcasecmp(headers_in[counter].key, "Content-Length")
+
         /* XXX: @@@ FIXME: "Proxy-Authorization" should *only* be 
          * suppressed if THIS server requested the authentication,
          * not when a frontend proxy requested it!
@@ -599,18 +1080,8 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
         APR_BRIGADE_INSERT_TAIL(bb, e);
     }
 
-    /* add empty line at the end of the headers */
-#if APR_CHARSET_EBCDIC
-    e = apr_bucket_immortal_create("\015\012", 2, c->bucket_alloc);
-#else
-    e = apr_bucket_immortal_create(CRLF, sizeof(CRLF)-1, c->bucket_alloc);
-#endif
-    APR_BRIGADE_INSERT_TAIL(bb, e);
-    e = apr_bucket_flush_create(c->bucket_alloc);
-    APR_BRIGADE_INSERT_TAIL(bb, e);
-
-    status = ap_pass_brigade(origin->output_filters, bb);
-
+    /* send the request data, if any. */
+    status = send_request_body(p, r, p_conn, origin, bb, force10);
     if (status != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
                      "proxy: request failed to %pI (%s)",
@@ -618,44 +1089,6 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
         return status;
     }
 
-    /* send the request data, if any. */
-    seen_eos = 0;
-    do {
-        status = ap_get_brigade(r->input_filters, bb, AP_MODE_READBYTES,
-                                APR_BLOCK_READ, HUGE_STRING_LEN);
-
-        if (status != APR_SUCCESS) {
-            return status;
-        }
-
-        /* If this brigade contain EOS, either stop or remove it. */
-        if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
-            /* As a shortcut, if this brigade is simply an EOS bucket,
-             * don't send anything down the filter chain.
-             */
-            if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(bb))) {
-                break;
-            }
-
-            /* We can't pass this EOS to the output_filters. */
-            e = APR_BRIGADE_LAST(bb);
-            apr_bucket_delete(e);
-            seen_eos = 1;
-        }
-
-        e = apr_bucket_flush_create(c->bucket_alloc);
-        APR_BRIGADE_INSERT_TAIL(bb, e);
-
-        status = ap_pass_brigade(origin->output_filters, bb);
-        if (status != APR_SUCCESS) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
-                         "proxy: pass request data failed to %pI (%s)",
-                         p_conn->addr, p_conn->name);
-            return status;
-        }
-        apr_brigade_cleanup(bb);
-    } while (!seen_eos);
-
     return APR_SUCCESS;
 }
 
index 9fe8f5e5888bb5ac6ed0456b7341fa8adc60dfed..fe078ece5d840f21801fc443495511e5110254e6 100644 (file)
@@ -134,6 +134,7 @@ static int resource_shortage = 0;
 static fd_queue_t *worker_queue;
 static fd_queue_info_t *worker_queue_info;
 static int mpm_state = AP_MPMQ_STARTING;
+static int sick_child_detected;
 
 /* The structure used to pass unique initialization info to each thread */
 typedef struct {
@@ -872,14 +873,8 @@ static void create_listener_thread(thread_starter *ts)
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ALERT, rv, ap_server_conf,
                      "apr_thread_create: unable to create listener thread");
-        /* In case system resources are maxxed out, we don't want
-         * Apache running away with the CPU trying to fork over and
-         * over and over again if we exit.
-         * XXX Jeff doesn't see how Apache is going to try to fork again since
-         * the exit code is APEXIT_CHILDFATAL
-         */
-        apr_sleep(apr_time_from_sec(10));
-        clean_child_exit(APEXIT_CHILDFATAL);
+        /* let the parent decide how bad this really is */
+        clean_child_exit(APEXIT_CHILDSICK);
     }
     apr_os_thread_get(&listener_os_thread, ts->listener);
 }
@@ -956,11 +951,8 @@ static void * APR_THREAD_FUNC start_threads(apr_thread_t *thd, void *dummy)
             if (rv != APR_SUCCESS) {
                 ap_log_error(APLOG_MARK, APLOG_ALERT, rv, ap_server_conf,
                     "apr_thread_create: unable to create worker thread");
-                /* In case system resources are maxxed out, we don't want
-                   Apache running away with the CPU trying to fork over and
-                   over and over again if we exit. */
-                apr_sleep(apr_time_from_sec(10));
-                clean_child_exit(APEXIT_CHILDFATAL);
+                /* let the parent decide how bad this really is */
+                clean_child_exit(APEXIT_CHILDSICK);
             }
             threads_created++;
         }
@@ -1153,11 +1145,8 @@ static void child_main(int child_num_arg)
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ALERT, rv, ap_server_conf,
                      "apr_thread_create: unable to create worker thread");
-        /* In case system resources are maxxed out, we don't want
-           Apache running away with the CPU trying to fork over and
-           over and over again if we exit. */
-        apr_sleep(apr_time_from_sec(10));
-        clean_child_exit(APEXIT_CHILDFATAL);
+        /* let the parent decide how bad this really is */
+        clean_child_exit(APEXIT_CHILDSICK);
     }
 
     mpm_state = AP_MPMQ_RUNNING;
@@ -1345,6 +1334,7 @@ static void perform_idle_server_maintenance(void)
     int free_slots[MAX_SPAWN_RATE];
     int last_non_dead;
     int total_non_dead;
+    int active_thread_count = 0;
 
     /* initialize the free_list */
     free_length = 0;
@@ -1382,14 +1372,16 @@ static void perform_idle_server_maintenance(void)
              * So we hopefully won't need to fork more if we count it.
              * This depends on the ordering of SERVER_READY and SERVER_STARTING.
              */
-            if (status <= SERVER_READY && status != SERVER_DEAD &&
-                    !ps->quiescing &&
-                    ps->generation == ap_my_generation &&
-                 /* XXX the following shouldn't be necessary if we clean up 
-                  *     properly after seg faults, but we're not yet    GLA 
-                  */     
-                    ps->pid != 0) {
-                ++idle_thread_count;
+            if (ps->pid != 0) { /* XXX just set all_dead_threads in outer for
+                                   loop if no pid?  not much else matters */
+                if (status <= SERVER_READY && status != SERVER_DEAD &&
+                        !ps->quiescing &&
+                        ps->generation == ap_my_generation) {
+                    ++idle_thread_count;
+                }
+                if (status >= SERVER_READY && status < SERVER_GRACEFUL) {
+                    ++active_thread_count;
+                }
             }
         }
         if (any_dead_threads && totally_free_length < idle_spawn_rate
@@ -1420,6 +1412,28 @@ static void perform_idle_server_maintenance(void)
             ++total_non_dead;
         }
     }
+
+    if (sick_child_detected) {
+        if (active_thread_count > 0) {
+            /* some child processes appear to be working.  don't kill the
+             * whole server.
+             */
+            sick_child_detected = 0;
+        }
+        else {
+            /* looks like a basket case.  give up.  
+             */
+            shutdown_pending = 1;
+            child_fatal = 1;
+            ap_log_error(APLOG_MARK, APLOG_ALERT, 0,
+                         ap_server_conf,
+                         "No active workers found..."
+                         " Apache is exiting!");
+            /* the child already logged the failure details */
+            return;
+        }
+    }
+                                                    
     ap_max_daemons_limit = last_non_dead + 1;
 
     if (idle_thread_count > max_spare_threads) {
@@ -1493,6 +1507,12 @@ static void server_main_loop(int remaining_children_to_start)
                 child_fatal = 1;
                 return;
             }
+            else if (processed_status == APEXIT_CHILDSICK) {
+                /* tell perform_idle_server_maintenance to check into this
+                 * on the next timer pop
+                 */
+                sick_child_detected = 1;
+            }
             /* non-fatal death... note that it's gone in the scoreboard. */
             child_slot = find_child_by_pid(&pid);
             if (child_slot >= 0) {