summaryrefslogtreecommitdiff
path: root/docs/manual/developer
diff options
context:
space:
mode:
authorArno Töll <debian@toell.net>2012-01-08 22:53:17 +0100
committerArno Töll <debian@toell.net>2012-01-08 22:53:17 +0100
commite072a2dd866b7cb9f14319b80326a4e7fd16fcdf (patch)
treea49dfc56d94a26011fe157835ff6cbe14edbd8a9 /docs/manual/developer
parent0890390c00801651d08d3794e13b31a5dabbf5ef (diff)
downloadapache2-e072a2dd866b7cb9f14319b80326a4e7fd16fcdf.tar.gz
Imported Upstream version 2.3.16-beta
Diffstat (limited to 'docs/manual/developer')
-rw-r--r--docs/manual/developer/API.html.en12
-rw-r--r--docs/manual/developer/debugging.html.en177
-rw-r--r--docs/manual/developer/documenting.html.en6
-rw-r--r--docs/manual/developer/documenting.html.zh-cn4
-rw-r--r--docs/manual/developer/filters.html.en6
-rw-r--r--docs/manual/developer/hooks.html.en4
-rw-r--r--docs/manual/developer/index.html.en41
-rw-r--r--docs/manual/developer/index.html.zh-cn22
-rw-r--r--docs/manual/developer/modules.html.en20
-rw-r--r--docs/manual/developer/modules.html.ja.utf813
-rw-r--r--docs/manual/developer/new_api_2_4.html5
-rw-r--r--docs/manual/developer/new_api_2_4.html.en530
-rw-r--r--docs/manual/developer/output-filters.html5
-rw-r--r--docs/manual/developer/output-filters.html.en509
-rw-r--r--docs/manual/developer/request.html.en54
-rw-r--r--docs/manual/developer/thread_safety.html.en8
16 files changed, 1136 insertions, 280 deletions
diff --git a/docs/manual/developer/API.html.en b/docs/manual/developer/API.html.en
index b161019e..2553bd5f 100644
--- a/docs/manual/developer/API.html.en
+++ b/docs/manual/developer/API.html.en
@@ -12,11 +12,11 @@
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
-<p class="apache">Apache HTTP Server Version 2.2</p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Apache 1.3 API notes</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Apache 1.3 API notes</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/developer/API.html" title="English">&nbsp;en&nbsp;</a></p>
</div>
@@ -48,7 +48,7 @@
<ul>
<li>
- <a href="#basics">Basic concepts.</a>
+ <a href="#basics">Basic concepts.</a>
<ul>
<li><a href="#HMR">Handlers, Modules, and
@@ -60,7 +60,7 @@
</li>
<li>
- <a href="#handlers">How handlers work</a>
+ <a href="#handlers">How handlers work</a>
<ul>
<li><a href="#req_tour">A brief tour of the
@@ -87,7 +87,7 @@
pools</a></li>
<li>
- <a href="#config">Configuration, commands and the like</a>
+ <a href="#config">Configuration, commands and the like</a>
<ul>
<li><a href="#per-dir">Per-directory configuration
@@ -893,7 +893,7 @@ void *request_config; /* Notes on *this* request */</pre><p><code>
per-directory. Most things are per-directory, including in particular access
control and authorization information, but also information on how to
determine file types from suffixes, which can be modified by
- <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> and <code class="directive"><a href="../mod/core.html#defaulttype">DefaultType</a></code> directives, and so forth. In general,
+ <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> and <code class="directive"><a href="../mod/core.html#forcetype">ForceType</a></code> directives, and so forth. In general,
the governing philosophy is that anything which <em>can</em> be made
configurable by directory should be; per-server information is generally
used in the standard set of modules for information like
diff --git a/docs/manual/developer/debugging.html.en b/docs/manual/developer/debugging.html.en
index 1e218698..2519cd0e 100644
--- a/docs/manual/developer/debugging.html.en
+++ b/docs/manual/developer/debugging.html.en
@@ -10,185 +10,22 @@
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
-<body id="manual-page"><div id="page-header">
+<body id="manual-page" class="no-sidebar"><div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
-<p class="apache">Apache HTTP Server Version 2.2</p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Debugging Memory Allocation in APR</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Debugging Memory Allocation in APR</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/developer/debugging.html" title="English">&nbsp;en&nbsp;</a></p>
</div>
- <p>The allocation mechanisms within APR have a number of debugging modes
- that can be used to assist in finding memory problems. This document
- describes the modes available and gives instructions on activating
- them.</p>
+ <p>
+ This document has been removed.
+ </p>
+</div>
</div>
-<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#options">Available debugging options</a></li>
-<li><img alt="" src="../images/down.gif" /> <a href="#combo">Allowable Combinations</a></li>
-<li><img alt="" src="../images/down.gif" /> <a href="#howto">Activating Debugging Options</a></li>
-</ul></div>
-<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
-<div class="section">
-<h2><a name="options" id="options">Available debugging options</a></h2>
- <h3><a name="alloc_debug" id="alloc_debug">Allocation Debugging - ALLOC_DEBUG</a></h3>
-
-
- <div class="note">Debugging support: Define this to enable code which
- helps detect re-use of <code>free()</code>d memory and other such
- nonsense.</div>
-
- <p>The theory is simple. The <code>FILL_BYTE</code> (<code>0xa5</code>)
- is written over all <code>malloc</code>'d memory as we receive it, and
- is written over everything that we free up during a
- <code>clear_pool</code>. We check that blocks on the free list always
- have the <code>FILL_BYTE</code> in them, and we check during
- <code>palloc()</code> that the bytes still have <code>FILL_BYTE</code>
- in them. If you ever see garbage URLs or whatnot containing lots
- of <code>0xa5</code>s then you know something used data that's been
- freed or uninitialized.</p>
-
-
- <h3><a name="alloc_use_malloc" id="alloc_use_malloc">Malloc Support - ALLOC_USE_MALLOC</a></h3>
-
-
- <div class="note">If defined all allocations will be done with
- <code>malloc()</code> and <code>free()</code>d appropriately at the
- end.</div>
-
- <p>This is intended to be used with something like Electric
- Fence or Purify to help detect memory problems. Note that if
- you're using efence then you should also add in <code>ALLOC_DEBUG</code>.
- But don't add in <code>ALLOC_DEBUG</code> if you're using Purify because
- <code>ALLOC_DEBUG</code> would hide all the uninitialized read errors
- that Purify can diagnose.</p>
-
-
- <h3><a name="pool_debug" id="pool_debug">Pool Debugging - POOL_DEBUG</a></h3>
- <div class="note">This is intended to detect cases where the wrong pool is
- used when assigning data to an object in another pool.</div>
-
- <p>In particular, it causes the <code>table_{set,add,merge}n</code>
- routines to check that their arguments are safe for the
- <code>apr_table_t</code> they're being placed in. It currently only works
- with the unix multiprocess model, but could be extended to others.</p>
-
-
- <h3><a name="make_table_profile" id="make_table_profile">Table Debugging - MAKE_TABLE_PROFILE</a></h3>
-
-
- <div class="note">Provide diagnostic information about make_table() calls
- which are possibly too small.</div>
-
- <p>This requires a recent gcc which supports
- <code>__builtin_return_address()</code>. The error_log output will be a
- message such as:</p>
- <div class="example"><p><code>
- table_push: apr_table_t created by 0x804d874 hit limit of 10
- </code></p></div>
-
- <p>Use <code>l *0x804d874</code> to find the
- source that corresponds to. It indicates that a <code>apr_table_t</code>
- allocated by a call at that address has possibly too small an
- initial <code>apr_table_t</code> size guess.</p>
-
-
- <h3><a name="alloc_stats" id="alloc_stats">Allocation Statistics - ALLOC_STATS</a></h3>
-
-
- <div class="note">Provide some statistics on the cost of allocations.</div>
-
- <p>This requires a bit of an understanding of how <code>alloc.c</code>
- works.</p>
-
-</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
-<div class="section">
-<h2><a name="combo" id="combo">Allowable Combinations</a></h2>
-
- <p>Not all the options outlined above can be activated at the
- same time. the following table gives more information.</p>
-
- <table class="bordered"><tr class="header"><th />
- <th>ALLOC DEBUG</th>
- <th>ALLOC USE MALLOC</th>
- <th>POOL DEBUG</th>
- <th>MAKE TABLE PROFILE</th>
- <th>ALLOC STATS</th></tr>
-<tr><th>ALLOC DEBUG</th>
- <td>-</td><td>No</td><td>Yes</td><td>Yes</td><td>Yes</td></tr>
-<tr class="odd"><th>ALLOC USE MALLOC</th>
- <td>No</td><td>-</td><td>No</td><td>No</td><td>No</td></tr>
-<tr><th>POOL DEBUG</th>
- <td>Yes</td><td>No</td><td>-</td><td>Yes</td><td>Yes</td></tr>
-<tr class="odd"><th>MAKE TABLE PROFILE</th>
- <td>Yes</td><td>No</td><td>Yes</td><td>-</td><td>Yes</td></tr>
-<tr><th>ALLOC STATS</th>
- <td>Yes</td><td>No</td><td>Yes</td><td>Yes</td><td>-</td></tr>
-</table>
-
- <p>Additionally the debugging options are not suitable for
- multi-threaded versions of the server. When trying to debug
- with these options the server should be started in single
- process mode.</p>
-</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
-<div class="section">
-<h2><a name="howto" id="howto">Activating Debugging Options</a></h2>
-
- <p>The various options for debugging memory are now enabled in
- the <code>apr_general.h</code> header file in APR. The various options are
- enabled by uncommenting the define for the option you wish to
- use. The section of the code currently looks like this
- (<em>contained in srclib/apr/include/apr_pools.h</em>)</p>
-
- <div class="example"><p><code>
- /*<br />
- #define ALLOC_DEBUG<br />
- #define POOL_DEBUG<br />
- #define ALLOC_USE_MALLOC<br />
- #define MAKE_TABLE_PROFILE<br />
- #define ALLOC_STATS<br />
- */<br />
- <br />
- typedef struct ap_pool_t {<br />
- <span class="indent">
- union block_hdr *first;<br />
- union block_hdr *last;<br />
- struct cleanup *cleanups;<br />
- struct process_chain *subprocesses;<br />
- struct ap_pool_t *sub_pools;<br />
- struct ap_pool_t *sub_next;<br />
- struct ap_pool_t *sub_prev;<br />
- struct ap_pool_t *parent;<br />
- char *free_first_avail;<br />
- </span>
- #ifdef ALLOC_USE_MALLOC<br />
- <span class="indent">
- void *allocation_list;<br />
- </span>
- #endif<br />
- #ifdef POOL_DEBUG<br />
- <span class="indent">
- struct ap_pool_t *joined;<br />
- </span>
- #endif<br />
- <span class="indent">
- int (*apr_abort)(int retcode);<br />
- struct datastruct *prog_data;<br />
- </span>
- } ap_pool_t;
- </code></p></div>
-
- <p>To enable allocation debugging simply move the <code>#define
- ALLOC_DEBUG</code> above the start of the comments block and rebuild
- the server.</p>
-
- <div class="note"><h3>Note</h3>
- <p>In order to use the various options the server <strong>must</strong>
- be rebuilt after editing the header file.</p>
- </div>
-</div></div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/developer/debugging.html" title="English">&nbsp;en&nbsp;</a></p>
</div><div id="footer">
diff --git a/docs/manual/developer/documenting.html.en b/docs/manual/developer/documenting.html.en
index 82da5c0c..87516847 100644
--- a/docs/manual/developer/documenting.html.en
+++ b/docs/manual/developer/documenting.html.en
@@ -12,11 +12,11 @@
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page" class="no-sidebar"><div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
-<p class="apache">Apache HTTP Server Version 2.2</p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Documenting Apache 2.0</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Documenting Apache 2.0</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/developer/documenting.html" title="English">&nbsp;en&nbsp;</a> |
<a href="../zh-cn/developer/documenting.html" hreflang="zh-cn" rel="alternate" title="Simplified Chinese">&nbsp;zh-cn&nbsp;</a></p>
@@ -41,7 +41,7 @@
@return description<br />
@deffunc signature of the function<br />
</code></p></div>
-
+
<p>The <code>deffunc</code> is not always necessary. DoxyGen does not
have a full parser in it, so any prototype that use a macro in the
return type declaration is too complex for scandoc. Those functions
diff --git a/docs/manual/developer/documenting.html.zh-cn b/docs/manual/developer/documenting.html.zh-cn
index 72f496c3..ddfdc37c 100644
--- a/docs/manual/developer/documenting.html.zh-cn
+++ b/docs/manual/developer/documenting.html.zh-cn
@@ -12,11 +12,11 @@
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page" class="no-sidebar"><div id="page-header">
<p class="menu"><a href="../mod/">模块</a> | <a href="../mod/directives.html">指令</a> | <a href="../faq/">常见问题</a> | <a href="../glossary.html">术语</a> | <a href="../sitemap.html">网站导航</a></p>
-<p class="apache">Apache HTTP 服务器版本 2.2</p>
+<p class="apache">Apache HTTP 服务器版本 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP 服务器</a> &gt; <a href="http://httpd.apache.org/docs/">文档</a> &gt; <a href="../">版本 2.2</a> &gt; <a href="./">开发者文档</a></div><div id="page-content"><div id="preamble"><h1>Apache 2.0 文档</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP 服务器</a> &gt; <a href="http://httpd.apache.org/docs/">文档</a> &gt; <a href="../">版本 2.3</a> &gt; <a href="./">开发者文档</a></div><div id="page-content"><div id="preamble"><h1>Apache 2.0 文档</h1>
<div class="toplang">
<p><span>可用语言: </span><a href="../en/developer/documenting.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
<a href="../zh-cn/developer/documenting.html" title="Simplified Chinese">&nbsp;zh-cn&nbsp;</a></p>
diff --git a/docs/manual/developer/filters.html.en b/docs/manual/developer/filters.html.en
index 6b4637ab..113fa432 100644
--- a/docs/manual/developer/filters.html.en
+++ b/docs/manual/developer/filters.html.en
@@ -12,11 +12,11 @@
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
-<p class="apache">Apache HTTP Server Version 2.2</p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>How filters work in Apache 2.0</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>How filters work in Apache 2.0</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/developer/filters.html" title="English">&nbsp;en&nbsp;</a></p>
</div>
@@ -138,7 +138,7 @@ Default_handler --&gt; includes_filter --&gt; byterange --&gt; ...
data from that sub-request to go through the includes filter, because it
might not be SSI data. So, the subrequest adds the following:</p>
-<div class="example"><pre>
+<div class="example"><pre>
Default_handler --&gt; includes_filter -/-&gt; byterange --&gt; ...
/
Default_handler --&gt; sub_request_core
diff --git a/docs/manual/developer/hooks.html.en b/docs/manual/developer/hooks.html.en
index 13c90bda..2c2ef682 100644
--- a/docs/manual/developer/hooks.html.en
+++ b/docs/manual/developer/hooks.html.en
@@ -12,11 +12,11 @@
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
-<p class="apache">Apache HTTP Server Version 2.2</p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Apache 2.0 Hook Functions</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Apache 2.0 Hook Functions</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/developer/hooks.html" title="English">&nbsp;en&nbsp;</a></p>
</div>
diff --git a/docs/manual/developer/index.html.en b/docs/manual/developer/index.html.en
index ab2d0bc1..57753164 100644
--- a/docs/manual/developer/index.html.en
+++ b/docs/manual/developer/index.html.en
@@ -5,29 +5,30 @@
This file is generated from xml source: DO NOT EDIT
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-->
-<title>Developer Documentation for Apache 2.0 - Apache HTTP Server</title>
+<title>Developer Documentation for Apache 2.x - Apache HTTP Server</title>
<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
-<p class="apache">Apache HTTP Server Version 2.2</p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="../"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a></div><div id="page-content"><div id="preamble"><h1>Developer Documentation for Apache 2.0</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a></div><div id="page-content"><div id="preamble"><h1>Developer Documentation for Apache 2.x</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/developer/" title="English">&nbsp;en&nbsp;</a> |
<a href="../zh-cn/developer/" hreflang="zh-cn" rel="alternate" title="Simplified Chinese">&nbsp;zh-cn&nbsp;</a></p>
</div>
- <p>Many of the documents on these Developer pages are lifted
- from Apache 1.3's documentation. While they are all being
- updated to Apache 2.0, they are in different stages of
- progress. Please be patient, and point out any discrepancies or
+ <div class="warning"><h3>Warning</h3>
+ <p>Many of the documents listed here are in need of update.
+ They are in different stages of progress.
+ Please be patient, and point out any discrepancies or
errors on the developer/ pages directly to the
<a href="http://httpd.apache.org/lists.html#http-dev">dev@httpd.apache.org</a> mailing list.</p>
+ </div>
</div>
<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#topics">Topics</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#external">External Resources</a></li>
@@ -36,28 +37,20 @@
<div class="section">
<h2><a name="topics" id="topics">Topics</a></h2>
<ul>
- <li><a href="API.html">Apache 1.3 API Notes</a></li>
- <li><a href="hooks.html">Apache 2.0 Hook Functions</a></li>
- <li><a href="request.html">Request Processing in Apache 2.0</a></li>
- <li><a href="filters.html">How filters work in Apache 2.0</a></li>
- <li><a href="modules.html">Converting Modules from Apache 1.3 to Apache 2.0</a></li>
- <li><a href="debugging.html">Debugging Memory Allocation in APR</a></li>
- <li><a href="documenting.html">Documenting Apache 2.0</a></li>
- <li><a href="thread_safety.html">Apache 2.0 Thread Safety Issues</a></li>
+ <li><a href="new_api_2_4.html">API changes in Apache 2.3/2.4</a></li>
+ <li><a href="hooks.html">Apache 2.x Hook Functions</a></li>
+ <li><a href="request.html">Request Processing in Apache 2.x</a></li>
+ <li><a href="filters.html">How filters work in Apache 2.x</a></li>
+ <li><a href="output-filters.html">Guidelines for output filters in Apache 2.x</a></li>
+ <li><a href="modules.html">Converting Modules from Apache 1.3 to Apache 2.x</a></li>
+ <li><a href="documenting.html">Documenting Apache 2.x</a></li>
+ <li><a href="thread_safety.html">Apache 2.x Thread Safety Issues</a></li>
</ul>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="external" id="external">External Resources</a></h2>
<ul>
- <li>Module Development Tutorials by Kevin O'Donnell
- <ul>
- <li><a href="http://threebit.net/tutorials/apache2_modules/tut1/tutorial1.html">Integrating a module into the Apache build system</a></li>
-
- <li><a href="http://threebit.net/tutorials/apache2_modules/tut2/tutorial2.html">Handling configuration directives</a></li>
- </ul></li>
-
- <li><a href="http://www.onlamp.com/pub/ct/38">Some notes on
- Apache module development by Ryan Bloom</a></li>
+ <li><a href="http://ci.apache.org/projects/httpd/trunk/doxygen/">Autogenerated Apache HTTP Server (trunk) code documentation</a></li>
<li>Developer articles at <a href="http://www.apachetutor.org/">apachetutor</a> include:
<ul>
diff --git a/docs/manual/developer/index.html.zh-cn b/docs/manual/developer/index.html.zh-cn
index 9ea1aeeb..cdf357e9 100644
--- a/docs/manual/developer/index.html.zh-cn
+++ b/docs/manual/developer/index.html.zh-cn
@@ -12,17 +12,17 @@
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">模块</a> | <a href="../mod/directives.html">指令</a> | <a href="../faq/">常见问题</a> | <a href="../glossary.html">术语</a> | <a href="../sitemap.html">网站导航</a></p>
-<p class="apache">Apache HTTP 服务器版本 2.2</p>
+<p class="apache">Apache HTTP 服务器版本 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="../"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP 服务器</a> &gt; <a href="http://httpd.apache.org/docs/">文档</a> &gt; <a href="../">版本 2.2</a></div><div id="page-content"><div id="preamble"><h1>Apache 2.0 开发者文档</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP 服务器</a> &gt; <a href="http://httpd.apache.org/docs/">文档</a> &gt; <a href="../">版本 2.3</a></div><div id="page-content"><div id="preamble"><h1>Apache 2.0 开发者文档</h1>
<div class="toplang">
<p><span>可用语言: </span><a href="../en/developer/" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
<a href="../zh-cn/developer/" title="Simplified Chinese">&nbsp;zh-cn&nbsp;</a></p>
</div>
- <p>开发者页面的许多文档都来自于 Apache 1.3。当更新到 Apache 2.0
+ <p>开发者页面的许多文档都来自于 Apache 1.3。当更新到 Apache 2
时,它们可能位于不同的阶段。请耐心等待,或者直接向
<a href="http://httpd.apache.org/lists.html#http-dev">dev@httpd.apache.org</a> 邮件列表报告开发者页面的差异或错误。</p>
</div>
@@ -34,19 +34,21 @@
<h2><a name="topics" id="topics">主题</a></h2>
<ul>
<li><a href="API.html">Apache 1.3 API 说明</a></li>
- <li><a href="hooks.html">Apache 2.0 钩子函数</a></li>
- <li><a href="request.html">Apache 2.0 中的请求处理</a></li>
- <li><a href="filters.html">Apache 2.0 中的过滤器</a></li>
- <li><a href="modules.html">将模块从 Apache 1.3 移植到 Apache 2.0</a></li>
+ <li><a href="new_api_2_4.html">在 Apache 2.3/2.4 中的 API 改变</a></li>
+ <li><a href="hooks.html">Apache 2.x 钩子函数</a></li>
+ <li><a href="request.html">Apache 2.x 中的请求处理</a></li>
+ <li><a href="filters.html">Apache 2.x 中的过滤器</a></li>
+ <li><a href="output-filters.html">Apache 2.x 中的输出过滤器指南</a></li>
+ <li><a href="modules.html">将模块从 Apache 1.3 移植到 Apache 2.x</a></li>
<li><a href="debugging.html">在 APR 中调试内存分配</a></li>
- <li><a href="documenting.html">Apache 2.0 文档</a></li>
- <li><a href="thread_safety.html">Apache 2.0 的线程安全问题</a></li>
+ <li><a href="documenting.html">Apache 2.x 文档</a></li>
+ <li><a href="thread_safety.html">Apache 2.x 的线程安全问题</a></li>
</ul>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="external" id="external">外部资源</a></h2>
<ul>
-
+ <li><a href="http://ci.apache.org/projects/httpd/trunk/doxygen/">自动生成的 Apache HTTP 服务器 (trunk) 代码文档</a></li>
<li>Kevin O'Donnell 的模块开发教程
<ul>
diff --git a/docs/manual/developer/modules.html.en b/docs/manual/developer/modules.html.en
index 79e241ac..a6ce0b66 100644
--- a/docs/manual/developer/modules.html.en
+++ b/docs/manual/developer/modules.html.en
@@ -12,11 +12,11 @@
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
-<p class="apache">Apache HTTP Server Version 2.2</p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Converting Modules from Apache 1.3 to Apache 2.0</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Converting Modules from Apache 1.3 to Apache 2.0</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/developer/modules.html" title="English">&nbsp;en&nbsp;</a> |
<a href="../ja/developer/modules.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
@@ -196,6 +196,19 @@ module MODULE_VAR_EXPORT <var>module_name</var>_module =
far...</p>
<dl>
+ <dt><code>ap_hook_pre_config</code></dt>
+ <dd>do any setup required prior to processing configuration
+ directives</dd>
+
+ <dt><code>ap_hook_check_config</code></dt>
+ <dd>review configuration directive interdependencies</dd>
+
+ <dt><code>ap_hook_test_config</code></dt>
+ <dd>executes only with <code>-t</code> option</dd>
+
+ <dt><code>ap_hook_open_logs</code></dt>
+ <dd>open any specified logs</dd>
+
<dt><code>ap_hook_post_config</code></dt>
<dd>this is where the old <code>_init</code> routines get
registered</dd>
@@ -203,9 +216,6 @@ module MODULE_VAR_EXPORT <var>module_name</var>_module =
<dt><code>ap_hook_http_method</code></dt>
<dd>retrieve the http method from a request. (legacy)</dd>
- <dt><code>ap_hook_open_logs</code></dt>
- <dd>open any specified logs</dd>
-
<dt><code>ap_hook_auth_checker</code></dt>
<dd>check if the resource requires authorization</dd>
diff --git a/docs/manual/developer/modules.html.ja.utf8 b/docs/manual/developer/modules.html.ja.utf8
index 659136ec..3c4bace6 100644
--- a/docs/manual/developer/modules.html.ja.utf8
+++ b/docs/manual/developer/modules.html.ja.utf8
@@ -12,15 +12,18 @@
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">モジュール</a> | <a href="../mod/directives.html">ディレクティブ</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">用語</a> | <a href="../sitemap.html">サイトマップ</a></p>
-<p class="apache">Apache HTTP サーバ バージョン 2.2</p>
+<p class="apache">Apache HTTP サーバ バージョン 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP サーバ</a> &gt; <a href="http://httpd.apache.org/docs/">ドキュメンテーション</a> &gt; <a href="../">バージョン 2.2</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>モジュールの Apache 1.3 から Apache 2.0 への移植</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP サーバ</a> &gt; <a href="http://httpd.apache.org/docs/">ドキュメンテーション</a> &gt; <a href="../">バージョン
+ 2.3</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>モジュールの Apache 1.3 から Apache 2.0 への移植</h1>
<div class="toplang">
-<p><span>Available Languages: </span><a href="../en/developer/modules.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
+<p><span>言語: </span><a href="../en/developer/modules.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
<a href="../ja/developer/modules.html" title="Japanese">&nbsp;ja&nbsp;</a></p>
</div>
+<div class="outofdate">この日本語訳はすでに古くなっている可能性があります。
+ 更新された内容を見るには英語版をご覧下さい。</div>
<p>この文書は <code>mod_mmap_static</code> モジュールを Apache 2.0 用に移植した時に
学んだ経験をもとに書いた、最初の手引き書です。まだまだ完全じゃないし、
@@ -227,7 +230,7 @@ module MODULE_VAR_EXPORT <var>module_name</var>_module =
<dd>(プロトコルの処理)</dd>
<dt><code>ap_hook_child_init</code></dt>
- <dd>(子プロセス起動直後)</dd>
+ <dd>(子プロセル起動直後)</dd>
<dt><code>ap_hook_create_request</code></dt>
<dd>(??)</dd>
@@ -266,7 +269,7 @@ module MODULE_VAR_EXPORT <var>module_name</var>_module =
</div></div>
<div class="bottomlang">
-<p><span>Available Languages: </span><a href="../en/developer/modules.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
+<p><span>言語: </span><a href="../en/developer/modules.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
<a href="../ja/developer/modules.html" title="Japanese">&nbsp;ja&nbsp;</a></p>
</div><div id="footer">
<p class="apache">Copyright 2011 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
diff --git a/docs/manual/developer/new_api_2_4.html b/docs/manual/developer/new_api_2_4.html
new file mode 100644
index 00000000..f13974a3
--- /dev/null
+++ b/docs/manual/developer/new_api_2_4.html
@@ -0,0 +1,5 @@
+# GENERATED FROM XML -- DO NOT EDIT
+
+URI: new_api_2_4.html.en
+Content-Language: en
+Content-type: text/html; charset=ISO-8859-1
diff --git a/docs/manual/developer/new_api_2_4.html.en b/docs/manual/developer/new_api_2_4.html.en
new file mode 100644
index 00000000..1c6960ef
--- /dev/null
+++ b/docs/manual/developer/new_api_2_4.html.en
@@ -0,0 +1,530 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ This file is generated from xml source: DO NOT EDIT
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ -->
+<title>API Changes in Apache HTTP Server 2.4 since 2.2 - Apache HTTP Server</title>
+<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
+<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
+<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
+<link href="../images/favicon.ico" rel="shortcut icon" /></head>
+<body id="manual-page"><div id="page-header">
+<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
+<img alt="" src="../images/feather.gif" /></div>
+<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
+<div id="path">
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a></div><div id="page-content"><div id="preamble"><h1>API Changes in Apache HTTP Server 2.4 since 2.2</h1>
+<div class="toplang">
+<p><span>Available Languages: </span><a href="../en/developer/new_api_2_4.html" title="English">&nbsp;en&nbsp;</a></p>
+</div>
+
+ <p>This document describes changes to the Apache HTTPD API from
+ version 2.2 to 2.4, that may be of interest to module/application
+ developers and core hacks. At the time of writing, the 2.4 API
+ is not finalised, and this document may serve to highlight
+ points that call for further review.</p>
+ <p>API changes fall into two categories: APIs that are altogether new,
+ and existing APIs that are expanded or changed. The latter are
+ further divided into those where all changes are back-compatible
+ (so existing modules can ignore them), and those that might
+ require attention by maintainers. As with the transition from
+ HTTPD 2.0 to 2.2, existing modules and applications will require
+ recompiling and may call for some attention, but most should not
+ require any substantial updating (although some may be able to
+ take advantage of API changes to offer significant improvements).</p>
+ <p>For the purpose of this document, the API is split according
+ to the public header files. These headers are themselves the
+ reference documentation, and can be used to generate a browsable
+ HTML reference with <code>make docs</code>.</p>
+</div>
+<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#api_changes">Changed APIs</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#upgrading">Specific information on upgrading modules from 2.2</a></li>
+</ul></div>
+<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="api_changes" id="api_changes">Changed APIs</a></h2>
+
+
+ <h3><a name="ap_expr" id="ap_expr">ap_expr (NEW!)</a></h3>
+
+ <p>Introduces a new API to parse and evaluate boolean and algebraic
+ expressions, including provision for a standard syntax and
+ customised variants.</p>
+
+
+ <h3><a name="ap_listen" id="ap_listen">ap_listen (changed; back-compatible)</a></h3>
+
+ <p>Introduces new API to enable apache child processes to serve different purposes.</p>
+
+
+ <h3><a name="ap_mpm" id="ap_mpm">ap_mpm (changed)</a></h3>
+
+ <p><code>ap_mpm_run</code> is replaced by a new <code>mpm</code> hook.
+ Also <code>ap_graceful_stop_signalled</code> is lost, and
+ <code>ap_mpm_register_timed_callback</code> is new.</p>
+
+
+ <h3><a name="ap_regex" id="ap_regex">ap_regex (changed)</a></h3>
+
+ <p>In addition to the existing regexp wrapper, a new higher-level API
+ <code>ap_rxplus</code> is now provided. This provides the capability to
+ compile Perl-style expressions like <code>s/regexp/replacement/flags</code>
+ and to execute them against arbitrary strings. Support for regexp
+ backreference.</p>
+
+
+ <h3><a name="ap_slotmem" id="ap_slotmem">ap_slotmem (NEW!)</a></h3>
+
+ <p>Introduces an API for modules to allocate and manage memory slots
+ (normally) for shared memory.</p>
+
+
+ <h3><a name="ap_socache" id="ap_socache">ap_socache (NEW!)</a></h3>
+
+ <p>API to manage a shared object cache.</p>
+
+
+ <h3><a name="heartbeat" id="heartbeat">heartbeat (NEW!)</a></h3>
+
+ <p>common structures for heartbeat modules (should this be public API?)</p>
+
+
+ <h3><a name="ap_parse_htaccess" id="ap_parse_htaccess">ap_parse_htaccess (changed)</a></h3>
+
+ <p>The function signature for <code>ap_parse_htaccess</code> has been
+ changed. A <code>apr_table_t</code> of individual directives allowed
+ for override must now be passed (override remains).</p>
+
+
+ <h3><a name="http_config" id="http_config">http_config (changed)</a></h3>
+
+ <ul>
+ <li>Introduces per-module, per-directory loglevels, including macro wrappers.</li>
+ <li>New AP_DECLARE_MODULE macro to declare all modules.</li>
+ <li>New APLOG_USE_MODULE macro necessary for per-module loglevels in
+ multi-file modules.</li>
+ <li>New API to retain data across module unload/load</li>
+ <li>New check_config hook</li>
+ <li>New ap_process_fnmatch_configs() to process wildcards</li>
+ <li>Change ap_configfile_t, ap_cfg_getline(), ap_cfg_getc() to return error
+ code, new ap_pcfg_strerror().</li>
+ <li>Any config directive permitted in ACCESS_CONF context must now
+ correctly handle being called from an .htaccess file via the new
+ <code class="directive"><a href="../mod/core.html#allowoverridelist">AllowOverrideList</a></code> directive.
+ ap_check_cmd_context() accepts a new flag NOT_IN_HTACCESS to detect
+ this case.</li>
+ </ul>
+
+
+ <h3><a name="http_core" id="http_core">http_core (changed)</a></h3>
+
+ <ul>
+ <li>REMOVED ap_default_type, ap_requires, all 2.2 authnz API</li>
+ <li>Introduces Optional Functions for logio and authnz</li>
+ <li>New function ap_get_server_name_for_url to support ipv6 literals.</li>
+ <li>New function ap_register_errorlog_handler to register errorlog
+ format string handlers.</li>
+ <li>Arguments of error_log hook have changed. Declaration has moved to
+ <code>http_core.h</code>.</li>
+ <li>New function ap_state_query to determine if the server is in the
+ initial configuration preflight phase or not. This is both easier to
+ use and more correct than the old method of creating a pool userdata
+ entry in the process pool.</li>
+ <li>New function ap_get_conn_socket to get the socket descriptor for a
+ connection. This should be used instead of accessing the core
+ connection config directly.</li>
+ </ul>
+
+
+ <h3><a name="httpd" id="httpd">httpd (changed)</a></h3>
+
+ <ul>
+ <li>Introduce per-directory, per-module loglevel</li>
+ <li>New loglevels APLOG_TRACEn</li>
+ <li>Introduce errorlog ids for requests and connections</li>
+ <li>Support for mod_request kept_body</li>
+ <li>Support buffering filter data for async requests</li>
+ <li>New CONN_STATE values</li>
+ <li>Function changes: ap_escape_html updated; ap_unescape_all,
+ ap_escape_path_segment_buffer</li>
+ <li>Modules that load other modules later than the EXEC_ON_READ config
+ reading stage need to call ap_reserve_module_slots() or
+ ap_reserve_module_slots_directive() in their pre_config hook.</li>
+ <li>The useragent IP address per request can now be specified
+ independently of the client IP address of the connection for
+ the benefit of load balancers</li>
+ </ul>
+
+
+ <h3><a name="http_log" id="http_log">http_log (changed)</a></h3>
+
+ <ul>
+ <li>Introduce per-directory, per-module loglevel</li>
+ <li>New loglevels APLOG_TRACEn</li>
+ <li>ap_log_*error become macro wrappers (fully back-compatible if
+ APLOG_MARK macro is used)</li>
+ <li>piped logging revamped</li>
+ <li>module_index added to error_log hook</li>
+ <li>new function: ap_log_command_line</li>
+ </ul>
+
+
+ <h3><a name="http_request" id="http_request">http_request (changed)</a></h3>
+
+ <ul>
+ <li>New auth_internal API and auth_provider API</li>
+ <li>New EOR bucket type</li>
+ <li>New function ap_process_async_request</li>
+ <li>New flags AP_AUTH_INTERNAL_PER_CONF and AP_AUTH_INTERNAL_PER_URI</li>
+ <li>New access_checker_ex hook to apply additional access control and/or
+ bypass authentication.</li>
+ <li>New functions ap_hook_check_access_ex, ap_hook_check_access,
+ ap_hook_check_authn, ap_hook_check_authz which accept
+ AP_AUTH_INTERNAL_PER_* flags</li>
+ <li>DEPRECATED direct use of ap_hook_access_checker, access_checker_ex,
+ ap_hook_check_user_id, ap_hook_auth_checker</li>
+ </ul>
+ <p>When possible, registering all access control hooks (including
+ authentication and authorization hooks) using AP_AUTH_INTERNAL_PER_CONF
+ is recommended. If all modules' access control hooks are registered
+ with this flag, then whenever the server handles an internal
+ sub-request that matches the same set of access control configuration
+ directives as the initial request (which is the common case), it can
+ avoid invoking the access control hooks another time.</p>
+ <p>If your module requires the old behavior and must perform access
+ control checks on every sub-request with a different URI from the
+ initial request, even if that URI matches the same set of access
+ control configuration directives, then use AP_AUTH_INTERNAL_PER_URI.</p>
+
+
+ <h3><a name="mod_auth" id="mod_auth">mod_auth (NEW!)</a></h3>
+
+ <p>Introduces the new provider framework for authn and authz</p>
+
+
+ <h3><a name="mod_cache" id="mod_cache">mod_cache (changed)</a></h3>
+
+ <p>Introduces a commit_entity() function to the cache provider interface,
+ allowing atomic writes to cache. Add a cache_status() hook to report
+ the cache decision. Remove all private structures and functions from the
+ public mod_cache.h header file.</p>
+
+
+ <h3><a name="mod_core" id="mod_core">mod_core (NEW!)</a></h3>
+
+ <p>This introduces low-level APIs to send arbitrary headers,
+ and exposes functions to handle HTTP OPTIONS and TRACE.</p>
+
+
+ <h3><a name="mod_cache_disk" id="mod_cache_disk">mod_cache_disk (changed)</a></h3>
+
+ <p>Changes the disk format of the disk cache to support atomic cache
+ updates without locking. The device/inode pair of the body file is
+ embedded in the header file, allowing confirmation that the header
+ and body belong to one another.</p>
+
+
+ <h3><a name="mod_disk_cache" id="mod_disk_cache">mod_disk_cache (renamed)</a></h3>
+
+ <p>The mod_disk_cache module has been renamed to mod_cache_disk in
+ order to be consistent with the naming of other modules within the
+ server.</p>
+
+
+ <h3><a name="mod_request" id="mod_request">mod_request (NEW!)</a></h3>
+
+ <p>The API for <code class="module"><a href="../mod/mod_request.html">mod_request</a></code>, to make input data
+ available to multiple application/handler modules where required,
+ and to parse HTML form data.</p>
+
+
+ <h3><a name="mpm_common" id="mpm_common">mpm_common (changed)</a></h3>
+
+ <ul>
+ <li>REMOVES: accept, lockfile, lock_mech, set_scoreboard (locking uses the new ap_mutex API)</li>
+ <li>NEW API to drop privileges (delegates this platform-dependent
+ function to modules)</li>
+ <li>NEW Hooks: mpm_query, timed_callback, and get_name</li>
+ <li>CHANGED interfaces: monitor hook,
+ ap_reclaim_child_processes, ap_relieve_child_processes</li>
+ </ul>
+
+
+ <h3><a name="scoreboard" id="scoreboard">scoreboard (changed)</a></h3>
+
+ <p>ap_get_scoreboard_worker is gratuitously made non-back-compatible
+ as an alternative version is introduced. Additional proxy_balancer
+ support. Child status stuff revamped.</p>
+
+
+ <h3><a name="util_cookies" id="util_cookies">util_cookies (NEW!)</a></h3>
+
+ <p>Introduces a new API for managing HTTP Cookies.</p>
+
+
+ <h3><a name="util_ldap" id="util_ldap">util_ldap (changed)</a></h3>
+
+ <p>I have yet to get a handle on this update.</p>
+
+
+ <h3><a name="util_mutex" id="util_mutex">util_mutex (NEW!)</a></h3>
+
+ <p>A wrapper for APR proc and global mutexes in httpd.</p>
+
+
+ <h3><a name="util_script" id="util_script">util_script (changed)</a></h3>
+
+ <p>NEW: ap_args_to_table</p>
+
+
+ <h3><a name="util_time" id="util_time">util_time (changed)</a></h3>
+
+ <p>NEW: ap_recent_ctime_ex</p>
+
+
+</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="upgrading" id="upgrading">Specific information on upgrading modules from 2.2</a></h2>
+
+
+ <h3><a name="upgrading_logging" id="upgrading_logging">Logging</a></h3>
+
+ <p>In order to take advantage of per-module loglevel configuration, any
+ source file that calls the <code>ap_log_*</code> functions should declare
+ which module it belongs to. If the module's module_struct is called
+ <code>foo_module</code>, the following code can be used to remain
+ backward compatible with HTTPD 2.0 and 2.2:</p>
+ <div class="example"><p><code>
+ #include &lt;http_log.h&gt;<br />
+ <br />
+ #ifdef APLOG_USE_MODULE<br />
+ APLOG_USE_MODULE(foo);<br />
+ #endif
+ </code></p></div>
+ <p>Note: This is absolutely required for C++-language modules. It
+ can be skipped for C-language modules, though that breaks
+ module-specific log level support for files without it.</p>
+ <p>The number of parameters of the <code>ap_log_*</code> functions and the
+ definition of <code>APLOG_MARK</code> has changed. Normally, the change
+ is completely transparent. However, changes are required if a
+ module uses <code>APLOG_MARK</code> as a parameter to its own functions
+ or if a module calls <code>ap_log_*</code> without passing
+ <code>APLOG_MARK</code>. A module which uses wrappers
+ around <code>ap_log_*</code> typically uses both of these constructs.</p>
+
+ <p>The easiest way to change code which passes <code>APLOG_MARK</code> to
+ its own functions is to define and use a different macro that expands to
+ the parameters required by those functions, as <code>APLOG_MARK</code>
+ should only be used when calling <code>ap_log_*</code>
+ directly. In this way, the code will remain compatible with HTTPD 2.0
+ and 2.2.</p>
+
+ <p>Code which calls <code>ap_log_*</code> without passing
+ <code>APLOG_MARK</code> will necessarily differ between 2.4 and earlier
+ releases, as 2.4 requires a new third argument,
+ <code>APLOG_MODULE_INDEX</code>.</p>
+
+ <div class="example"><p><code>
+ /* code for httpd 2.0/2.2 */<br />
+ ap_log_perror(file, line, APLOG_ERR, 0, p, "Failed to allocate dynamic lock structure");<br />
+ <br />
+ /* code for httpd 2.4 */<br />
+ ap_log_perror(file, line, APLOG_MODULE_INDEX, APLOG_ERR, 0, p, "Failed to allocate dynamic lock structure");<br />
+ <br />
+ </code></p></div>
+
+ <p>A <code>server_rec</code> pointer must be passed to
+ <code>ap_log_error()</code> when called after startup. This
+ was always appropriate, but there are even more limitations with
+ a <code>NULL</code> <code>server_rec</code> in 2.4 than in
+ previous releases. Beginning with 2.3.12, the global variable
+ <code>ap_server_conf</code> can always be used as
+ the <code>server_rec</code> parameter, as it will be
+ <code>NULL</code> only when it is valid to pass <code>NULL</code>
+ to <code>ap_log_error()</code>. <code>ap_server_conf</code>
+ should be used only when a more appropriate <code>server_rec</code>
+ is not available.</p>
+
+ <p>Consider the following changes to take advantage of the new
+ <code>APLOG_TRACE1..8</code> log levels:</p>
+ <ul>
+ <li>Check current use of <code>APLOG_DEBUG</code> and
+ consider if one of the <code>APLOG_TRACEn</code> levels is
+ more appropriate.</li>
+ <li>If your module currently has a mechanism for configuring
+ the amount of debug logging which is performed, consider
+ eliminating that mechanism and relying on the use of
+ different <code>APLOG_TRACEn</code> levels. If expensive
+ trace processing needs to be bypassed depending on the
+ configured log level, use the <code>APLOGtrace<em>n</em></code>
+ and <code>APLOGrtrace<em>n</em></code> macros to first check
+ if tracing is enabled.</li>
+ </ul>
+
+ <p>Modules sometimes add process id and/or thread id to their log
+ messages. These ids are now logged by default, so it may not
+ be necessary for the module to log them explicitly. (Users may
+ remove them from the error log format, but they can be
+ instructed to add it back if necessary for problem diagnosis.)</p>
+
+
+ <h3><a name="upgrading_byfunction" id="upgrading_byfunction">If your module uses these existing APIs...</a></h3>
+
+
+ <dl>
+ <dt><code>ap_default_type()</code></dt>
+ <dd>This is no longer available; Content-Type must be configured
+ explicitly or added by the application.</dd>
+
+ <dt><code>ap_get_server_name()</code></dt>
+ <dd>If the returned server name is used in a URL,
+ use <code>ap_get_server_name_for_url()</code> instead. This new
+ function handles the odd case where the server name is an IPv6
+ literal address.</dd>
+
+ <dt><code>ap_get_server_version()</code></dt>
+ <dd>For logging purposes, where detailed information is
+ appropriate, use <code>ap_get_server_description()</code>.
+ When generating output, where the amount of information
+ should be configurable by ServerTokens, use
+ <code>ap_get_server_banner()</code>.</dd>
+
+ <dt><code>ap_graceful_stop_signalled()</code></dt>
+ <dd>Replace with a call
+ to <code>ap_mpm_query(AP_MPMQ_MPM_STATE)</code> and checking for
+ state <code>AP_MPMQ_STOPPING</code>.</dd>
+
+ <dt><code>ap_max_daemons_limit</code>, <code>ap_my_generation</code>,
+ and <code>ap_threads_per_child</code></dt>
+ <dd>Use <code>ap_mpm_query()</code> query codes
+ <code>AP_MPMQ_MAX_DAEMON_USED</code>, <code>AP_MPMQ_GENERATION</code>,
+ and <code>AP_MPMQ_MAX_THREADS</code>, respectively.</dd>
+
+ <dt><code>ap_mpm_query()</code></dt>
+ <dd>Ensure that it is not used until after the register-hooks
+ hook has completed. Otherwise, an MPM built as a DSO
+ would not have had a chance to enable support for this
+ function.</dd>
+
+ <dt><code>ap_server_conf-&gt;process-&gt;pool</code>
+ userdata</dt>
+ <dd>
+ Optional:
+ <ul>
+ <li>If your module uses this to determine which pass of the
+ startup hooks is being run,
+ use <code>ap_state_query(AP_SQ_MAIN_STATE)</code>.</li>
+ <li>If your module uses this to maintain data across the
+ unloading and reloading of your module, use
+ <code>ap_retained_data_create()</code> and
+ <code>ap_retained_data_get()</code>.</li>
+ </ul>
+ </dd>
+
+ <dt><code>apr_global_mutex_create()</code>,
+ <code>apr_proc_mutex_create()</code></dt>
+ <dd>Optional: See <code>ap_mutex_register()</code>,
+ <code>ap_global_mutex_create()</code>, and
+ <code>ap_proc_mutex_create()</code>; these allow your
+ mutexes to be configurable with
+ the <code class="directive"><a href="../mod/core.html#mutex">Mutex</a></code> directive;
+ you can also remove any configuration mechanisms in your
+ module for such mutexes
+ </dd>
+
+ <dt><code>CORE_PRIVATE</code></dt>
+ <dd>This is now unnecessary and ignored.</dd>
+
+ <dt><code>dav_new_error()</code>
+ and <code>dav_new_error_tag()</code></dt>
+ <dd>Previously, these assumed that <code>errno</code> contained
+ information describing the failure. Now,
+ an <code>apr_status_t</code> parameter must be provided. Pass
+ 0/APR_SUCCESS if there is no such error information, or a valid
+ <code>apr_status_t</code> value otherwise.</dd>
+
+ <dt><code>mpm_default.h</code>, <code>DEFAULT_LOCKFILE</code>,
+ <code>DEFAULT_THREAD_LIMIT</code>, <code>DEFAULT_PIDLOG</code>,
+ etc.</dt>
+ <dd>The header file and most of the default configuration
+ values set in it are no longer visible to modules. (Most can
+ still be overridden at build time.) <code>DEFAULT_PIDLOG</code>
+ and <code>DEFAULT_REL_RUNTIMEDIR</code> are now universally
+ available via <code>ap_config.h</code>.</dd>
+
+ <dt><code>unixd_config</code></dt>
+ <dd>This has been renamed to ap_unixd_config.</dd>
+
+ <dt><code>conn_rec-&gt;remote_ip and conn_rec-&gt;remote_addr</code></dt>
+ <dd>In order to distinguish between the client IP address of the
+ connection, and the useragent IP address of the request potentially
+ overridden by a load balancer or proxy, the above variables have
+ been renamed. If a module makes reference to either of the above
+ variables, they need to be replaced with one of the following two
+ options as appropriate for the module:
+ <ul>
+ <li>When you require the IP address of the user agent, which
+ might be connected directly to the server, or might optionally be
+ separated from the server by a transparent load balancer or
+ proxy, use request_rec-&gt;useragent_ip and
+ request_rec-&gt;useragent_addr.</li>
+ <li>When you require the IP address of the client that is
+ connected directly to the server, which might be the useragent or
+ might be the load balancer or proxy itself, use
+ conn_rec-&gt;client_ip and conn_rec-&gt;client_addr.</li>
+ </ul>
+ </dd>
+ </dl>
+
+
+ <h3><a name="upgrading_byfeature" id="upgrading_byfeature">If your module interfaces with this feature...</a></h3>
+
+ <dl>
+ <dt>suEXEC</dt>
+ <dd>Optional: If your module logs an error
+ when <code>ap_unixd_config.suexec_enabled</code> is 0,
+ also log the value of the new
+ field <code>suexec_disabled_reason</code>, which contains an
+ explanation of why it is not available.</dd>
+
+ <dt>Extended status data in the scoreboard</dt>
+ <dd>In previous releases, <code>ExtendedStatus</code> had to be
+ set to <code>On</code>, which in turn required that
+ mod_status was loaded. In 2.4, just
+ set <code>ap_extended_status</code> to <code>1</code> in a
+ pre-config hook and the extended status data will be
+ available.</dd>
+
+ </dl>
+
+
+ <h3><a name="upgrading_newfeatures" id="upgrading_newfeatures">Does your module...</a></h3>
+
+ <dl>
+ <dt>Parse query args</dt>
+ <dd>Consider if <code>ap_args_to_table()</code> would be
+ helpful.</dd>
+
+ <dt>Parse form data...</dt>
+ <dd>Use <code>ap_parse_form_data()</code>.</dd>
+
+ <dt>Check for request header fields <code>Content-Length</code>
+ and <code>Transfer-Encoding</code> to see if a body was
+ specified</dt>
+ <dd>Use <code>ap_request_has_body()</code>.</dd>
+
+ <dt>Implement cleanups which clear pointer variables</dt>
+ <dd>Use <code>ap_pool_cleanup_set_null()</code>.</dd>
+ </dl>
+
+
+</div></div>
+<div class="bottomlang">
+<p><span>Available Languages: </span><a href="../en/developer/new_api_2_4.html" title="English">&nbsp;en&nbsp;</a></p>
+</div><div id="footer">
+<p class="apache">Copyright 2011 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
+<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
+</body></html> \ No newline at end of file
diff --git a/docs/manual/developer/output-filters.html b/docs/manual/developer/output-filters.html
new file mode 100644
index 00000000..b0a884bd
--- /dev/null
+++ b/docs/manual/developer/output-filters.html
@@ -0,0 +1,5 @@
+# GENERATED FROM XML -- DO NOT EDIT
+
+URI: output-filters.html.en
+Content-Language: en
+Content-type: text/html; charset=ISO-8859-1
diff --git a/docs/manual/developer/output-filters.html.en b/docs/manual/developer/output-filters.html.en
new file mode 100644
index 00000000..1f6ec282
--- /dev/null
+++ b/docs/manual/developer/output-filters.html.en
@@ -0,0 +1,509 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ This file is generated from xml source: DO NOT EDIT
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ -->
+<title>Guide to writing output filters - Apache HTTP Server</title>
+<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
+<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
+<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
+<link href="../images/favicon.ico" rel="shortcut icon" /></head>
+<body id="manual-page"><div id="page-header">
+<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
+<img alt="" src="../images/feather.gif" /></div>
+<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
+<div id="path">
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Guide to writing output filters</h1>
+<div class="toplang">
+<p><span>Available Languages: </span><a href="../en/developer/output-filters.html" title="English">&nbsp;en&nbsp;</a></p>
+</div>
+
+ <p>There are a number of common pitfalls encountered when writing
+ output filters; this page aims to document best practice for
+ authors of new or existing filters.</p>
+
+ <p>This document is applicable to both version 2.0 and version 2.2
+ of the Apache HTTP Server; it specifically targets
+ <code>RESOURCE</code>-level or <code>CONTENT_SET</code>-level
+ filters though some advice is generic to all types of filter.</p>
+ </div>
+<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#basics">Filters and bucket brigades</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#invocation">Filter invocation</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#brigade">Brigade structure</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#buckets">Processing buckets</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#filtering">Filtering brigades</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#state">Maintaining state</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#buffer">Buffering buckets</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#nonblock">Non-blocking bucket reads</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#rules">Ten rules for output filters</a></li>
+</ul></div>
+<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="basics" id="basics">Filters and bucket brigades</a></h2>
+
+
+ <p>Each time a filter is invoked, it is passed a <em>bucket
+ brigade</em>, containing a sequence of <em>buckets</em> which
+ represent both data content and metadata. Every bucket has a
+ <em>bucket type</em>; a number of bucket types are defined and
+ used by the <code>httpd</code> core modules (and the
+ <code>apr-util</code> library which provides the bucket brigade
+ interface), but modules are free to define their own types.</p>
+
+ <div class="note">Output filters must be prepared to process
+ buckets of non-standard types; with a few exceptions, a filter
+ need not care about the types of buckets being filtered.</div>
+
+ <p>A filter can tell whether a bucket represents either data or
+ metadata using the <code>APR_BUCKET_IS_METADATA</code> macro.
+ Generally, all metadata buckets should be passed down the filter
+ chain by an output filter. Filters may transform, delete, and
+ insert data buckets as appropriate.</p>
+
+ <p>There are two metadata bucket types which all filters must pay
+ attention to: the <code>EOS</code> bucket type, and the
+ <code>FLUSH</code> bucket type. An <code>EOS</code> bucket
+ indicates that the end of the response has been reached and no
+ further buckets need be processed. A <code>FLUSH</code> bucket
+ indicates that the filter should flush any buffered buckets (if
+ applicable) down the filter chain immediately.</p>
+
+ <div class="note"><code>FLUSH</code> buckets are sent when the
+ content generator (or an upstream filter) knows that there may be
+ a delay before more content can be sent. By passing
+ <code>FLUSH</code> buckets down the filter chain immediately,
+ filters ensure that the client is not kept waiting for pending
+ data longer than necessary.</div>
+
+ <p>Filters can create <code>FLUSH</code> buckets and pass these
+ down the filter chain if desired. Generating <code>FLUSH</code>
+ buckets unnecessarily, or too frequently, can harm network
+ utilisation since it may force large numbers of small packets to
+ be sent, rather than a small number of larger packets. The
+ section on <a href="#nonblock">Non-blocking bucket reads</a>
+ covers a case where filters are encouraged to generate
+ <code>FLUSH</code> buckets.</p>
+
+ <div class="example"><h3>Example bucket brigade</h3><p><code>
+ HEAP FLUSH FILE EOS</code></p></div>
+
+ <p>This shows a bucket brigade which may be passed to a filter; it
+ contains two metadata buckets (<code>FLUSH</code> and
+ <code>EOS</code>), and two data buckets (<code>HEAP</code> and
+ <code>FILE</code>).</p>
+
+ </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="invocation" id="invocation">Filter invocation</a></h2>
+
+
+ <p>For any given request, an output filter might be invoked only
+ once and be given a single brigade representing the entire response.
+ It is also possible that the number of times a filter is invoked
+ for a single response is proportional to the size of the content
+ being filtered, with the filter being passed a brigade containing
+ a single bucket each time. Filters must operate correctly in
+ either case.</p>
+
+ <div class="warning">An output filter which allocates long-lived
+ memory every time it is invoked may consume memory proportional to
+ response size. Output filters which need to allocate memory
+ should do so once per response; see <a href="#state">Maintaining
+ state</a> below.</div>
+
+ <p>An output filter can distinguish the final invocation for a
+ given response by the presence of an <code>EOS</code> bucket in
+ the brigade. Any buckets in the brigade after an EOS should be
+ ignored.</p>
+
+ <p>An output filter should never pass an empty brigade down the
+ filter chain. To be defensive, filters should be prepared to
+ accept an empty brigade, and should return success without passing
+ this brigade on down the filter chain. The handling of an empty
+ brigade should have no side effects (such as changing any state
+ private to the filter).</p>
+
+ <div class="example"><h3>How to handle an empty brigade</h3><p><code>
+ apr_status_t dummy_filter(ap_filter_t *f, apr_bucket_brigade *bb)<br />
+ {<br />
+ <span class="indent">
+ if (APR_BRIGADE_EMPTY(bb)) {<br />
+ <span class="indent">
+ return APR_SUCCESS;<br />
+ </span>
+ }<br />
+ ....<br />
+ </span>
+ </code></p></div>
+
+ </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="brigade" id="brigade">Brigade structure</a></h2>
+
+
+ <p>A bucket brigade is a doubly-linked list of buckets. The list
+ is terminated (at both ends) by a <em>sentinel</em> which can be
+ distinguished from a normal bucket by comparing it with the
+ pointer returned by <code>APR_BRIGADE_SENTINEL</code>. The list
+ sentinel is in fact not a valid bucket structure; any attempt to
+ call normal bucket functions (such as
+ <code>apr_bucket_read</code>) on the sentinel will have undefined
+ behaviour (i.e. will crash the process).</p>
+
+ <p>There are a variety of functions and macros for traversing and
+ manipulating bucket brigades; see the <a href="http://apr.apache.org/docs/apr-util/trunk/group___a_p_r___util___bucket___brigades.html">apr_bucket.h</a>
+ header for complete coverage. Commonly used macros include:</p>
+
+ <dl>
+ <dt><code>APR_BRIGADE_FIRST(bb)</code></dt>
+ <dd>returns the first bucket in brigade bb</dd>
+
+ <dt><code>APR_BRIGADE_LAST(bb)</code></dt>
+ <dd>returns the last bucket in brigade bb</dd>
+
+ <dt><code>APR_BUCKET_NEXT(e)</code></dt>
+ <dd>gives the next bucket after bucket e</dd>
+
+ <dt><code>APR_BUCKET_PREV(e)</code></dt>
+ <dd>gives the bucket before bucket e</dd>
+
+ </dl>
+
+ <p>The <code>apr_bucket_brigade</code> structure itself is
+ allocated out of a pool, so if a filter creates a new brigade, it
+ must ensure that memory use is correctly bounded. A filter which
+ allocates a new brigade out of the request pool
+ (<code>r-&gt;pool</code>) on every invocation, for example, will fall
+ foul of the <a href="#invocation">warning above</a> concerning
+ memory use. Such a filter should instead create a brigade on the
+ first invocation per request, and store that brigade in its <a href="#state">state structure</a>.</p>
+
+ <div class="warning"><p>It is generally never advisable to use
+ <code>apr_brigade_destroy</code> to "destroy" a brigade unless
+ you know for certain that the brigade will never be used
+ again, even then, it should be used rarely. The
+ memory used by the brigade structure will not be released by
+ calling this function (since it comes from a pool), but the
+ associated pool cleanup is unregistered. Using
+ <code>apr_brigade_destroy</code> can in fact cause memory leaks;
+ if a "destroyed" brigade contains buckets when its
+ containing pool is destroyed, those buckets will <em>not</em> be
+ immediately destroyed.</p>
+
+ <p>In general, filters should use <code>apr_brigade_cleanup</code>
+ in preference to <code>apr_brigade_destroy</code>.</p></div>
+
+ </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="buckets" id="buckets">Processing buckets</a></h2>
+
+
+
+ <p>When dealing with non-metadata buckets, it is important to
+ understand that the "<code>apr_bucket *</code>" object is an
+ abstract <em>representation</em> of data:</p>
+
+ <ol>
+ <li>The amount of data represented by the bucket may or may not
+ have a determinate length; for a bucket which represents data of
+ indeterminate length, the <code>-&gt;length</code> field is set to
+ the value <code>(apr_size_t)-1</code>. For example, buckets of
+ the <code>PIPE</code> bucket type have an indeterminate length;
+ they represent the output from a pipe.</li>
+
+ <li>The data represented by a bucket may or may not be mapped
+ into memory. The <code>FILE</code> bucket type, for example,
+ represents data stored in a file on disk.</li>
+ </ol>
+
+ <p>Filters read the data from a bucket using the
+ <code>apr_bucket_read</code> function. When this function is
+ invoked, the bucket may <em>morph</em> into a different bucket
+ type, and may also insert a new bucket into the bucket brigade.
+ This must happen for buckets which represent data not mapped into
+ memory.</p>
+
+ <p>To give an example; consider a bucket brigade containing a
+ single <code>FILE</code> bucket representing an entire file, 24
+ kilobytes in size:</p>
+
+ <div class="example"><p><code>FILE(0K-24K)</code></p></div>
+
+ <p>When this bucket is read, it will read a block of data from the
+ file, morph into a <code>HEAP</code> bucket to represent that
+ data, and return the data to the caller. It also inserts a new
+ <code>FILE</code> bucket representing the remainder of the file;
+ after the <code>apr_bucket_read</code> call, the brigade looks
+ like:</p>
+
+ <div class="example"><p><code>HEAP(8K) FILE(8K-24K)</code></p></div>
+
+ </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="filtering" id="filtering">Filtering brigades</a></h2>
+
+
+ <p>The basic function of any output filter will be to iterate
+ through the passed-in brigade and transform (or simply examine)
+ the content in some manner. The implementation of the iteration
+ loop is critical to producing a well-behaved output filter.</p>
+
+ <p>Taking an example which loops through the entire brigade as
+ follows:</p>
+
+ <div class="example"><h3>Bad output filter -- do not imitate!</h3><p><code>
+ apr_bucket *e = APR_BRIGADE_FIRST(bb);<br />
+const char *data;<br />
+apr_size_t len;<br />
+<br />
+while (e != APR_BRIGADE_SENTINEL(bb)) {<br />
+<span class="indent">
+ apr_bucket_read(e, &amp;data, &amp;length, APR_BLOCK_READ);<br />
+ e = APR_BUCKET_NEXT(e);<br />
+</span>
+}<br />
+<br />
+return ap_pass_brigade(bb);
+ </code></p></div>
+
+ <p>The above implementation would consume memory proportional to
+ content size. If passed a <code>FILE</code> bucket, for example,
+ the entire file contents would be read into memory as each
+ <code>apr_bucket_read</code> call morphed a <code>FILE</code>
+ bucket into a <code>HEAP</code> bucket.</p>
+
+ <p>In contrast, the implementation below will consume a fixed
+ amount of memory to filter any brigade; a temporary brigade is
+ needed and must be allocated only once per response, see the <a href="#state">Maintaining state</a> section.</p>
+
+ <div class="example"><h3>Better output filter</h3><p><code>
+apr_bucket *e;<br />
+const char *data;<br />
+apr_size_t len;<br />
+<br />
+while ((e = APR_BRIGADE_FIRST(bb)) != APR_BRIGADE_SENTINEL(bb)) {<br />
+<span class="indent">
+ rv = apr_bucket_read(e, &amp;data, &amp;length, APR_BLOCK_READ);<br />
+ if (rv) ...;<br />
+ /* Remove bucket e from bb. */<br />
+ APR_BUCKET_REMOVE(e);<br />
+ /* Insert it into temporary brigade. */<br />
+ APR_BRIGADE_INSERT_HEAD(tmpbb, e);<br />
+ /* Pass brigade downstream. */<br />
+ rv = ap_pass_brigade(f-&gt;next, tmpbb);<br />
+ if (rv) ...;<br />
+ apr_brigade_cleanup(tmpbb);<br />
+</span>
+}
+ </code></p></div>
+
+ </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="state" id="state">Maintaining state</a></h2>
+
+
+
+ <p>A filter which needs to maintain state over multiple
+ invocations per response can use the <code>-&gt;ctx</code> field of
+ its <code>ap_filter_t</code> structure. It is typical to store a
+ temporary brigade in such a structure, to avoid having to allocate
+ a new brigade per invocation as described in the <a href="#brigade">Brigade structure</a> section.</p>
+
+ <div class="example"><h3>Example code to maintain filter state</h3><p><code>
+struct dummy_state {<br />
+<span class="indent">
+ apr_bucket_brigade *tmpbb;<br />
+ int filter_state;<br />
+ ....<br />
+</span>
+};<br />
+<br />
+apr_status_t dummy_filter(ap_filter_t *f, apr_bucket_brigade *bb)<br />
+{<br />
+<span class="indent">
+ struct dummy_state *state;<br />
+<br />
+ state = f-&gt;ctx;<br />
+ if (state == NULL) {<br />
+ <span class="indent">
+ /* First invocation for this response: initialise state structure.
+ */<br />
+ f-&gt;ctx = state = apr_palloc(sizeof *state, f-&gt;r-&gt;pool);<br />
+<br />
+ state-&gt;tmpbb = apr_brigade_create(f-&gt;r-&gt;pool, f-&gt;c-&gt;bucket_alloc);<br />
+ state-&gt;filter_state = ...;<br />
+ </span>
+ }<br />
+ ...
+</span>
+ </code></p></div>
+
+ </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="buffer" id="buffer">Buffering buckets</a></h2>
+
+
+ <p>If a filter decides to store buckets beyond the duration of a
+ single filter function invocation (for example storing them in its
+ <code>-&gt;ctx</code> state structure), those buckets must be <em>set
+ aside</em>. This is necessary because some bucket types provide
+ buckets which represent temporary resources (such as stack memory)
+ which will fall out of scope as soon as the filter chain completes
+ processing the brigade.</p>
+
+ <p>To setaside a bucket, the <code>apr_bucket_setaside</code>
+ function can be called. Not all bucket types can be setaside, but
+ if successful, the bucket will have morphed to ensure it has a
+ lifetime at least as long as the pool given as an argument to the
+ <code>apr_bucket_setaside</code> function.</p>
+
+ <p>Alternatively, the <code>ap_save_brigade</code> function can be
+ used, which will move all the buckets into a separate brigade
+ containing buckets with a lifetime as long as the given pool
+ argument. This function must be used with care, taking into
+ account the following points:</p>
+
+ <ol>
+ <li>On return, <code>ap_save_brigade</code> guarantees that all
+ the buckets in the returned brigade will represent data mapped
+ into memory. If given an input brigade containing, for example,
+ a <code>PIPE</code> bucket, <code>ap_save_brigade</code> will
+ consume an arbitrary amount of memory to store the entire output
+ of the pipe.</li>
+
+ <li>When <code>ap_save_brigade</code> reads from buckets which
+ cannot be setaside, it will always perform blocking reads,
+ removing the opportunity to use <a href="#nonblock">Non-blocking
+ bucket reads</a>.</li>
+
+ <li>If <code>ap_save_brigade</code> is used without passing a
+ non-NULL "<code>saveto</code>" (destination) brigade parameter,
+ the function will create a new brigade, which may cause memory
+ use to be proportional to content size as described in the <a href="#brigade">Brigade structure</a> section.</li>
+ </ol>
+
+ <div class="warning">Filters must ensure that any buffered data is
+ processed and passed down the filter chain during the last
+ invocation for a given response (a brigade containing an EOS
+ bucket). Otherwise such data will be lost.</div>
+
+ </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="nonblock" id="nonblock">Non-blocking bucket reads</a></h2>
+
+
+ <p>The <code>apr_bucket_read</code> function takes an
+ <code>apr_read_type_e</code> argument which determines whether a
+ <em>blocking</em> or <em>non-blocking</em> read will be performed
+ from the data source. A good filter will first attempt to read
+ from every data bucket using a non-blocking read; if that fails
+ with <code>APR_EAGAIN</code>, then send a <code>FLUSH</code>
+ bucket down the filter chain, and retry using a blocking read.</p>
+
+ <p>This mode of operation ensures that any filters further down the
+ filter chain will flush any buffered buckets if a slow content
+ source is being used.</p>
+
+ <p>A CGI script is an example of a slow content source which is
+ implemented as a bucket type. <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code> will send
+ <code>PIPE</code> buckets which represent the output from a CGI
+ script; reading from such a bucket will block when waiting for the
+ CGI script to produce more output.</p>
+
+ <div class="example"><h3>Example code using non-blocking bucket reads</h3><p><code>
+
+apr_bucket *e;<br />
+apr_read_type_e mode = APR_NONBLOCK_READ;<br />
+<br />
+while ((e = APR_BRIGADE_FIRST(bb)) != APR_BRIGADE_SENTINEL(bb)) {<br />
+<span class="indent">
+ apr_status_t rv;<br />
+<br />
+ rv = apr_bucket_read(e, &amp;data, &amp;length, mode);<br />
+ if (rv == APR_EAGAIN &amp;&amp; mode == APR_NONBLOCK_READ) {<br />
+ <span class="indent">
+ /* Pass down a brigade containing a flush bucket: */<br />
+ APR_BRIGADE_INSERT_TAIL(tmpbb, apr_bucket_flush_create(...));<br />
+ rv = ap_pass_brigade(f-&gt;next, tmpbb);<br />
+ apr_brigade_cleanup(tmpbb);<br />
+ if (rv != APR_SUCCESS) return rv;<br />
+<br />
+ /* Retry, using a blocking read. */<br />
+ mode = APR_BLOCK_READ;<br />
+ continue;<br />
+ </span>
+ } else if (rv != APR_SUCCESS) {<br />
+ <span class="indent">
+ /* handle errors */<br />
+ </span>
+ }<br />
+<br />
+ /* Next time, try a non-blocking read first. */<br />
+ mode = APR_NONBLOCK_READ;<br />
+ ...<br />
+</span>
+}
+ </code></p></div>
+
+ </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="rules" id="rules">Ten rules for output filters</a></h2>
+
+
+ <p>In summary, here is a set of rules for all output filters to
+ follow:</p>
+
+ <ol>
+ <li>Output filters should not pass empty brigades down the filter
+ chain, but should be tolerant of being passed empty
+ brigades.</li>
+
+ <li>Output filters must pass all metadata buckets down the filter
+ chain; <code>FLUSH</code> buckets should be respected by passing
+ any pending or buffered buckets down the filter chain.</li>
+
+ <li>Output filters should ignore any buckets following an
+ <code>EOS</code> bucket.</li>
+
+ <li>Output filters must process a fixed amount of data at a
+ time, to ensure that memory consumption is not proportional to
+ the size of the content being filtered.</li>
+
+ <li>Output filters should be agnostic with respect to bucket
+ types, and must be able to process buckets of unfamiliar
+ type.</li>
+
+ <li>After calling <code>ap_pass_brigade</code> to pass a brigade
+ down the filter chain, output filters should call
+ <code>apr_brigade_cleanup</code> to ensure the brigade is empty
+ before reusing that brigade structure; output filters should
+ never use <code>apr_brigade_destroy</code> to "destroy"
+ brigades.</li>
+
+ <li>Output filters must <em>setaside</em> any buckets which are
+ preserved beyond the duration of the filter function.</li>
+
+ <li>Output filters must not ignore the return value of
+ <code>ap_pass_brigade</code>, and must return appropriate errors
+ back up the filter chain.</li>
+
+ <li>Output filters must only create a fixed number of bucket
+ brigades for each response, rather than one per invocation.</li>
+
+ <li>Output filters should first attempt non-blocking reads from
+ each data bucket, and send a <code>FLUSH</code> bucket down the
+ filter chain if the read blocks, before retrying with a blocking
+ read.</li>
+
+ </ol>
+
+ </div></div>
+<div class="bottomlang">
+<p><span>Available Languages: </span><a href="../en/developer/output-filters.html" title="English">&nbsp;en&nbsp;</a></p>
+</div><div id="footer">
+<p class="apache">Copyright 2011 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
+<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
+</body></html> \ No newline at end of file
diff --git a/docs/manual/developer/request.html.en b/docs/manual/developer/request.html.en
index 58d0648a..68b7c08b 100644
--- a/docs/manual/developer/request.html.en
+++ b/docs/manual/developer/request.html.en
@@ -12,11 +12,11 @@
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
-<p class="apache">Apache HTTP Server Version 2.2</p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Request Processing in Apache 2.0</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Request Processing in Apache 2.0</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/developer/request.html" title="English">&nbsp;en&nbsp;</a></p>
</div>
@@ -148,56 +148,18 @@
<p>Needs Documentation. Code is:</p>
<div class="example"><pre>
-switch (ap_satisfies(r)) {
-case SATISFY_ALL:
-case SATISFY_NOSPEC:
- if ((access_status = ap_run_access_checker(r)) != 0) {
- return decl_die(access_status, "check access", r);
- }
-
- if (ap_some_auth_required(r)) {
- if (((access_status = ap_run_check_user_id(r)) != 0)
- || !ap_auth_type(r)) {
- return decl_die(access_status, ap_auth_type(r)
- ? "check user. No user file?"
- : "perform authentication. AuthType not set!",
- r);
- }
-
- if (((access_status = ap_run_auth_checker(r)) != 0)
- || !ap_auth_type(r)) {
- return decl_die(access_status, ap_auth_type(r)
- ? "check access. No groups file?"
- : "perform authentication. AuthType not set!",
- r);
- }
- }
- break;
-
-case SATISFY_ANY:
- if (((access_status = ap_run_access_checker(r)) != 0)) {
- if (!ap_some_auth_required(r)) {
+ if ((access_status = ap_run_access_checker(r)) != 0) {
return decl_die(access_status, "check access", r);
}
- if (((access_status = ap_run_check_user_id(r)) != 0)
- || !ap_auth_type(r)) {
- return decl_die(access_status, ap_auth_type(r)
- ? "check user. No user file?"
- : "perform authentication. AuthType not set!",
- r);
+ if ((access_status = ap_run_check_user_id(r)) != 0) {
+ return decl_die(access_status, "check user", r);
}
- if (((access_status = ap_run_auth_checker(r)) != 0)
- || !ap_auth_type(r)) {
- return decl_die(access_status, ap_auth_type(r)
- ? "check access. No groups file?"
- : "perform authentication. AuthType not set!",
- r);
+ if ((access_status = ap_run_auth_checker(r)) != 0) {
+ return decl_die(access_status, "check authorization", r);
}
- }
- break;
-}</pre></div>
+ </pre></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="preparation" id="preparation">The Preparation Phase</a></h2>
diff --git a/docs/manual/developer/thread_safety.html.en b/docs/manual/developer/thread_safety.html.en
index a5150927..926f9e2b 100644
--- a/docs/manual/developer/thread_safety.html.en
+++ b/docs/manual/developer/thread_safety.html.en
@@ -12,11 +12,11 @@
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
-<p class="apache">Apache HTTP Server Version 2.2</p>
+<p class="apache">Apache HTTP Server Version 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Apache 2.0 Thread Safety Issues</h1>
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Developer Documentation</a></div><div id="page-content"><div id="preamble"><h1>Apache 2.0 Thread Safety Issues</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/developer/thread_safety.html" title="English">&nbsp;en&nbsp;</a></p>
</div>
@@ -48,7 +48,7 @@
allowed to use static or global variables. There are times when you
actually want something to affect all threads, but generally you need to
avoid using them if you want your code to be thread safe.</p>
-
+
<p>In the case where you have a global variable that needs to be global and
accessed by all threads, be very careful when you update it. If, for
example, it is an incrementing counter, you need to atomically increment
@@ -84,7 +84,7 @@
to their <code><var>*</var>_r</code> equivalents and sometimes changes
the common <code>getc</code>/<code>putc</code> macros into safer function
calls. Check your libc documentation for specifics. Instead of, or in
- addition to <code>_REENTRANT</code> the symbols that may affect this are
+ addition to <code>_REENTRANT</code> the symbols that may affect this are
<code>_POSIX_C_SOURCE</code>, <code>_THREAD_SAFE</code>,
<code>_SVID_SOURCE</code>, and <code>_BSD_SOURCE</code>.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>