http_protocol.c revision f15953964058dc2a5c775df882c73f1c9256d08c
0b152383e04dbeb10dba29bcdfaa0981e4d9df27Simon Ulbricht/* ====================================================================
0b152383e04dbeb10dba29bcdfaa0981e4d9df27Simon Ulbricht * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
0b152383e04dbeb10dba29bcdfaa0981e4d9df27Simon Ulbricht * Redistribution and use in source and binary forms, with or without
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu Prodescu * modification, are permitted provided that the following conditions
0b152383e04dbeb10dba29bcdfaa0981e4d9df27Simon Ulbricht * 1. Redistributions of source code must retain the above copyright
0b152383e04dbeb10dba29bcdfaa0981e4d9df27Simon Ulbricht * notice, this list of conditions and the following disclaimer.
0b152383e04dbeb10dba29bcdfaa0981e4d9df27Simon Ulbricht * 2. Redistributions in binary form must reproduce the above copyright
0b152383e04dbeb10dba29bcdfaa0981e4d9df27Simon Ulbricht * notice, this list of conditions and the following disclaimer in
0b152383e04dbeb10dba29bcdfaa0981e4d9df27Simon Ulbricht * the documentation and/or other materials provided with the
2643008447e30b6025f742eb6a661f38be756b1eSimon Ulbricht * distribution.
2643008447e30b6025f742eb6a661f38be756b1eSimon Ulbricht * 3. All advertising materials mentioning features or use of this
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * software must display the following acknowledgment:
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * "This product includes software developed by the Apache Group
d815d2b83e945875100ceca322ebd50d96714206Simon Ulbricht * for use in the Apache HTTP server project (http://www.apache.org/)."
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * 4. The names "Apache Server" and "Apache Group" must not be used to
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * endorse or promote products derived from this software without
abea93ed557b22ea833e1524ee5ca11afc12208aSimon Ulbricht * prior written permission. For written permission, please contact
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht * apache@apache.org.
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht * 5. Products derived from this software may not be called "Apache"
6150196e8d99f7161a622fdc1a872fecd378195fSimon Ulbricht * nor may "Apache" appear in their names without prior written
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * permission of the Apache Group.
abea93ed557b22ea833e1524ee5ca11afc12208aSimon Ulbricht * 6. Redistributions of any form whatsoever must retain the following
3209c34f23fb83a86fbbdd6501db6d4bfb949a57Simon Ulbricht * acknowledgment:
2643008447e30b6025f742eb6a661f38be756b1eSimon Ulbricht * "This product includes software developed by the Apache Group
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * for use in the Apache HTTP server project (http://www.apache.org/)."
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * OF THE POSSIBILITY OF SUCH DAMAGE.
abea93ed557b22ea833e1524ee5ca11afc12208aSimon Ulbricht * ====================================================================
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * This software consists of voluntary contributions made by many
9da6e0cb2ea6e43f5b09dcd2a9af5468a5d0fcf4Christian Maeder * individuals on behalf of the Apache Group and was originally based
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * on public domain software written at the National Center for
6150196e8d99f7161a622fdc1a872fecd378195fSimon Ulbricht * Supercomputing Applications, University of Illinois, Urbana-Champaign.
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * For more information on the Apache Group and the Apache HTTP server
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * project, please see <http://www.apache.org/>.
b0adcc203b4267d5535b430372935a5f36726db1Simon Ulbricht * http_protocol.c --- routines which directly communicate with the client.
b0adcc203b4267d5535b430372935a5f36726db1Simon Ulbricht * Code originally by Rob McCool; much redone by Robert S. Thau
b0adcc203b4267d5535b430372935a5f36726db1Simon Ulbricht * and the Apache Group.
b0adcc203b4267d5535b430372935a5f36726db1Simon Ulbricht#include "http_log.h" /* For errors detected in basic auth common
b0adcc203b4267d5535b430372935a5f36726db1Simon Ulbricht * support code... */
b0adcc203b4267d5535b430372935a5f36726db1Simon Ulbricht#include "util_date.h" /* For parseHTTPdate and BAD_DATE */
b0adcc203b4267d5535b430372935a5f36726db1Simon Ulbricht ap_bgetopt (r->connection->client, BO_BYTECT, &r->bytes_sent); \
b0adcc203b4267d5535b430372935a5f36726db1Simon Ulbrichtstatic int parse_byterange(char *range, long clength, long *start, long *end)
432ac7c08e2592af0660e026051ffb052e88a100Simon Ulbricht /* In the form "-5" */
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht else /* "5-" */
abea93ed557b22ea833e1524ee5ca11afc12208aSimon Ulbrichtstatic int internal_byterange(int, long *, request_rec *, const char **,
abea93ed557b22ea833e1524ee5ca11afc12208aSimon UlbrichtAPI_EXPORT(int) ap_set_byterange(request_rec *r)
abea93ed557b22ea833e1524ee5ca11afc12208aSimon Ulbricht /* Check for Range request-header (HTTP/1.1) or Request-Range for
abea93ed557b22ea833e1524ee5ca11afc12208aSimon Ulbricht * backwards-compatibility with second-draft Luotonen/Franks
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * byte-ranges (e.g. Netscape Navigator 2-3).
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * We support this form, with Request-Range, and (farther down) we
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * send multipart/x-byteranges instead of multipart/byteranges for
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht * Request-Range based requests to work around a bug in Netscape
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht * Navigator 2-3 and MSIE 3.
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht if (!(range = ap_table_get(r->headers_in, "Range")))
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht range = ap_table_get(r->headers_in, "Request-Range");
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht if (!range || strncasecmp(range, "bytes=", 6)) {
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht /* Check the If-Range header for Etag or Date.
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht * Note that this check will return false (as required) if either
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * of the two etags are weak.
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht if ((if_range = ap_table_get(r->headers_in, "If-Range"))) {
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht if (!(match = ap_table_get(r->headers_out, "Etag")) ||
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht else if (!(match = ap_table_get(r->headers_out, "Last-Modified")) ||
ea9768c548fe6ae05d275380869c2923c3392244Simon Ulbricht /* A single range */
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht if (!parse_byterange(ap_pstrdup(r->pool, range + 6), r->clength,
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht ap_table_setn(r->headers_out, "Content-Range",
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht ap_table_setn(r->headers_out, "Content-Length",
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht ap_psprintf(r->pool, "%ld", range_end - range_start + 1));
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht /* a multiple range */
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht const char *r_range = ap_pstrdup(r->pool, range + 6);
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht while (internal_byterange(0, &tlength, r, &r_range, NULL, NULL));
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht ap_table_setn(r->headers_out, "Content-Length",
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon UlbrichtAPI_EXPORT(int) ap_each_byterange(request_rec *r, ap_off_t *offset,
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht return internal_byterange(1, NULL, r, &r->range, offset, length);
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht/* If this function is called with realreq=1, it will spit out
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * the correct headers for a byterange chunk, and set offset and
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht * length to the positions they should be.
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * If it is called with realreq=0, it will add to tlength the length
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * it *would* have used with realreq=1.
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * Either case will return 1 if it should be called again, and 0
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbrichtstatic int internal_byterange(int realreq, long *tlength, request_rec *r,
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht ap_rvputs(r, "\015\012--", r->boundary, "--\015\012", NULL);
1651c7f5055453e18a8c34f96c333e2aa702a34eSimon Ulbricht if (!parse_byterange(range, r->clength, &range_start, &range_end))
1651c7f5055453e18a8c34f96c333e2aa702a34eSimon Ulbricht /* Skip this one */
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht return internal_byterange(realreq, tlength, r, r_range, offset,
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht const char *ct = r->content_type ? r->content_type : ap_default_type(r);
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht ap_snprintf(ts, sizeof(ts), "%ld-%ld/%ld", range_start, range_end,
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht ap_rvputs(r, "\015\012--", r->boundary, "\015\012Content-type: ",
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht ct, "\015\012Content-range: bytes ", ts, "\015\012\015\012",
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht *tlength += 4 + strlen(r->boundary) + 16 + strlen(ct) + 23 +
ea9768c548fe6ae05d275380869c2923c3392244Simon UlbrichtAPI_EXPORT(int) ap_set_content_length(request_rec *r, long clength)
1651c7f5055453e18a8c34f96c333e2aa702a34eSimon Ulbricht ap_table_setn(r->headers_out, "Content-Length", ap_psprintf(r->pool, "%ld", clength));
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon UlbrichtAPI_EXPORT(int) ap_set_keepalive(request_rec *r)
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht ap_table_get(r->headers_out, "Connection"), "close");
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht const char *conn = ap_table_get(r->headers_in, "Connection");
3ac14720aa7f1e0715311bd1598e7d78c37dd3c6Simon Ulbricht /* The following convoluted conditional determines whether or not
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * the current connection should remain persistent after this response
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * (a.k.a. HTTP Keep-Alive) and whether or not the output message
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * body should use the HTTP/1.1 chunked transfer-coding. In English,
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * IF we have not marked this connection as errored;
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * and the response body has a defined length due to the status code
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * being 304 or 204, the request method being HEAD, already
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * having defined Content-Length or Transfer-Encoding: chunked, or
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * the request version being HTTP/1.1 and thus capable of being set
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * as chunked [we know the (r->chunked = 1) side-effect is ugly];
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * and the server configuration enables keep-alive;
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * and the server configuration has a reasonable inter-request timeout;
53d3b5d18cae658f0e54872ade90ab5259b52b95Simon Ulbricht * and there is no maximum # requests or the max hasn't been reached;
a210c2e5add831cd438183c8602ed8e610922beaSimon Ulbricht * and the response status does not require a close;
1651c7f5055453e18a8c34f96c333e2aa702a34eSimon Ulbricht * and the response generator has not already indicated close;
369771f5d48a40eda134026b1f45f63b2c00bdb8Simon Ulbricht * and the client did not request non-persistence (Connection: close);
987c9ee1092c7fd8b53242abefe4f3cf8e9a1011Simon Ulbricht * and we haven't been configured to ignore the buggy twit
r->header_only ||
!wimpy &&
if (ka_sent) {
if (!wimpy)
return OK;
return HTTP_PRECONDITION_FAILED;
return HTTP_PRECONDITION_FAILED;
return HTTP_NOT_MODIFIED;
return HTTP_NOT_MODIFIED;
return HTTP_NOT_MODIFIED;
return HTTP_PRECONDITION_FAILED;
&& ((if_modified_since =
return HTTP_NOT_MODIFIED;
return OK;
char *etag;
char *weak;
(unsigned long) r->mtime);
(unsigned long) r->mtime);
return etag;
char *etag;
int vlv_weak;
if (!r->vlist_validator) {
if (vlv_weak)
vlv++;
* something like a mod_http_methods.c, complete with config stuff.
switch (*method) {
return M_GET;
return M_POST;
return M_PUT;
return M_PATCH;
return M_PROPFIND;
return M_PROPPATCH;
return M_DELETE;
return M_CONNECT;
return M_COPY;
return M_MKCOL;
return M_MOVE;
return M_OPTIONS;
return M_TRACE;
return M_LOCK;
return M_UNLOCK;
return M_INVALID;
int retval;
int total = 0;
pos = s;
if (retval <= 0)
--total;
return total;
* This will prevent "http://www.wherever.com/..\..\/" from
const char *ll = l;
const char *uri;
int len;
char *value;
char *copy;
int len;
unsigned int fields_read = 0;
++value;
request_rec *r;
ap_context_t *p;
const char *expect;
int access_status;
r->pool = p;
r->read_length = 0;
#ifdef CHARSET_EBCDIC
if (!read_request_line(r)) {
ap_send_error_response(r, 0);
return NULL;
if (!r->assbackwards) {
get_mime_headers(r);
ap_send_error_response(r, 0);
if (r->header_only) {
r->uri);
r->header_only = 0;
ap_send_error_response(r, 0);
ap_send_error_response(r, 0);
ap_send_error_response(r, 0);
(void) ap_discard_request_body(r);
return NULL;
NULL));
return DECLINED;
if (!ap_auth_name(r)) {
return SERVER_ERROR;
if (!auth_line) {
return AUTH_REQUIRED;
return AUTH_REQUIRED;
auth_line++;
*pw = t;
return OK;
* The number of status lines must equal the value of RESPONSE_CODES (httpd.h)
#ifdef UTS21
int i, pos;
return LEVEL_500;
return pos;
* In other words, don't change this one without checking table_do in alloc.c.
char *protocol;
#ifdef CHARSET_EBCDIC
if (r->assbackwards)
if (!r->status_line)
if (r->proxyreq
#ifdef CHARSET_EBCDIC
#ifdef CHARSET_EBCDIC
if (!convert)
long int bs;
NULL);
int rv;
while (r->prev)
r = r->prev;
return rv;
ap_table_do((int (*) (void *, const char *, const char *))
return OK;
const long int zero = 0L;
if (r->assbackwards)
return DECLINED;
ap_set_keepalive(r);
terminate_header(r);
return OK;
* Here we try to be compatible with clients that want multipart/x-byteranges
* instead of multipart/byteranges (also see above), as per HTTP/1.1. We
const char *ua;
* consisting of comma/space-separated tokens.
char *start;
char **strpp;
start = e;
++i, ++strpp) {
const long int zero = 0L;
#ifdef CHARSET_EBCDIC
if (r->assbackwards) {
if (!r->main)
r->headers_out);
fixup_vary(r);
#ifdef CHARSET_EBCDIC
ap_set_keepalive(r);
if (r->chunked) {
else if (r->content_type)
if (r->content_encoding)
else if (r->content_language)
terminate_header(r);
if (r->chunked)
#ifdef CHARSET_EBCDIC
if (!convert)
r->chunked = 0;
unsigned long max_body;
r->read_chunked = 0;
r->remaining = 0;
if (tenc) {
return HTTP_NOT_IMPLEMENTED;
else if (lenp) {
++pos;
return HTTP_BAD_REQUEST;
return HTTP_REQUEST_ENTITY_TOO_LARGE;
return HTTP_REQUEST_ENTITY_TOO_LARGE;
return OK;
NULL);
ap_rflush(r);
static long get_chunk_size(char *b)
long chunksize = 0;
while (ap_isxdigit(*b)) {
int xvalue = 0;
return chunksize;
long chunk_start = 0;
unsigned long max_body;
if (len_read <= 0) {
if (len_read < 0)
return len_read;
return len_read;
if (bufsiz <= 0)
max_body);
get_mime_headers(r);
chunk_start = 0;
if (len_read < 0) {
return chunk_start;
if (len_read <= 0) {
if (c != LF) {
int rv;
return rv;
if (r->expecting_100) {
return OK;
if (rv < 0)
return HTTP_BAD_REQUEST;
return OK;
long total_bytes_sent = 0;
ap_ssize_t n;
if (length == 0)
o = IOBUFSIZE;
total_bytes_sent += w;
SET_BYTES_SENT(r);
return total_bytes_sent;
long total_bytes_sent = 0;
long zero_timeout = 0;
int n, w, rc, o;
if (length == 0) {
(void) ap_rflush(r);
(void) ap_rflush(r);
total_bytes_sent += w;
SET_BYTES_SENT(r);
return total_bytes_sent;
#ifndef MMAP_SEGMENT_SIZE
if (length == 0)
n = MMAP_SEGMENT_SIZE;
total_bytes_sent += w;
offset += w;
SET_BYTES_SENT(r);
return total_bytes_sent;
return EOF;
return EOF;
SET_BYTES_SENT(r);
int rcode;
return EOF;
if (rcode < 0) {
return EOF;
SET_BYTES_SENT(r);
return rcode;
return EOF;
return EOF;
SET_BYTES_SENT(r);
SET_BYTES_SENT(r);
SET_BYTES_SENT(r);
return EOF;
if (x == NULL)
j = strlen(x);
return EOF;
SET_BYTES_SENT(r);
return EOF;
char *custom_response;
r->headers_out);
ap_set_keepalive(r);
(void *) r, r->headers_out,
NULL);
terminate_header(r);
if (!r->assbackwards) {
r->clength = 0;
if (r->header_only) {
ap_rflush(r);
ap_rflush(r);
r = r->prev;
const char *h1;
const char *error_notes;
ap_rvputs(r,
NULL);
switch (status) {
case HTTP_MOVED_PERMANENTLY:
case HTTP_MOVED_TEMPORARILY:
case HTTP_TEMPORARY_REDIRECT:
NULL);
case HTTP_SEE_OTHER:
NULL);
case HTTP_USE_PROXY:
case AUTH_REQUIRED:
case BAD_REQUEST:
case HTTP_FORBIDDEN:
case NOT_FOUND:
case METHOD_NOT_ALLOWED:
case NOT_ACCEPTABLE:
ap_rvputs(r,
case MULTIPLE_CHOICES:
const char *list;
case LENGTH_REQUIRED:
case PRECONDITION_FAILED:
case HTTP_NOT_IMPLEMENTED:
case BAD_GATEWAY:
case VARIANT_ALSO_VARIES:
case HTTP_REQUEST_TIME_OUT:
case HTTP_GONE:
NULL);
case HTTP_EXPECTATION_FAILED:
NULL);
case HTTP_LOCKED:
case HTTP_FAILED_DEPENDENCY:
case HTTP_SERVICE_UNAVAILABLE:
case HTTP_GATEWAY_TIME_OUT:
case HTTP_NOT_EXTENDED:
if (recursive_error) {
ap_rflush(r);
NULL)