http_protocol.c revision 6202bc12656548c624a235bf43d6c866719b2b06
38dc50ae00a1ea57fa41500d74f4e818747e3cefpquerna/* ====================================================================
7d5ac94fda90b837211dadf2585c0fe8c5dc3e5djerenkrantz * The Apache Software License, Version 1.1
ecf8d72af432e53e4c0661fb99dfda8061507bfajerenkrantz * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
62f7716b14b71603a8004434ca3536902bfb8899wrowe * reserved.
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * Redistribution and use in source and binary forms, with or without
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * modification, are permitted provided that the following conditions
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * 1. Redistributions of source code must retain the above copyright
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * notice, this list of conditions and the following disclaimer.
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * 2. Redistributions in binary form must reproduce the above copyright
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * notice, this list of conditions and the following disclaimer in
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * the documentation and/or other materials provided with the
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * distribution.
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * 3. The end-user documentation included with the redistribution,
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * if any, must include the following acknowledgment:
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * "This product includes software developed by the
38dc50ae00a1ea57fa41500d74f4e818747e3cefpquerna * Apache Software Foundation (http://www.apache.org/)."
366616a5cc6212cbf7134ccf877f965d668c6b04wrowe * Alternately, this acknowledgment may appear in the software itself,
ecf8d72af432e53e4c0661fb99dfda8061507bfajerenkrantz * if and wherever such third-party acknowledgments normally appear.
80464b326874ee15d74742ae39708ec3f2eae1d7wrowe * 4. The names "Apache" and "Apache Software Foundation" must
80464b326874ee15d74742ae39708ec3f2eae1d7wrowe * not be used to endorse or promote products derived from this
38dc50ae00a1ea57fa41500d74f4e818747e3cefpquerna * software without prior written permission. For written
5eb27f5ecb5daa4252c36cf6f049a2058ebe7bd6jim * permission, please contact apache@apache.org.
53e66a2931d02e84628ba946055cc92e56b43db8wrowe * 5. Products derived from this software may not be called "Apache",
53e66a2931d02e84628ba946055cc92e56b43db8wrowe * nor may "Apache" appear in their name, without prior written
cd365a1ad6798c1faef19b445c00ae97eb94a234pquerna * permission of the Apache Software Foundation.
6507aa1a5709a9122f2e0b9be8bb9bd6d78715c3pquerna * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
b6c98ce4a43f123af0a691fd7b833efcf0ce1d6apquerna * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
af4c982a7cf4515f124935f99a329744035fc699slive * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
d96ee8cda2799e1f2743c1603adeb4833ed0e15fslive * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ecf8d72af432e53e4c0661fb99dfda8061507bfajerenkrantz * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
ecf8d72af432e53e4c0661fb99dfda8061507bfajerenkrantz * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * SUCH DAMAGE.
ecf8d72af432e53e4c0661fb99dfda8061507bfajerenkrantz * ====================================================================
d96ee8cda2799e1f2743c1603adeb4833ed0e15fslive * This software consists of voluntary contributions made by many
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * individuals on behalf of the Apache Software Foundation. For more
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe * information on the Apache Software Foundation, please see
5ca8e11fadb6f7a8d9d0367c1800205c99d4bcd6jerenkrantz * Portions of this software are based upon public domain software
62f7716b14b71603a8004434ca3536902bfb8899wrowe * originally written at the National Center for Supercomputing Applications,
45b0e1c775c1cfed6473c9e5304179ccb9609f53stoddard * University of Illinois, Urbana-Champaign.
a74ee4396fe11ffc1ca05837a59e497c905eedc3sf * http_protocol.c --- routines which directly communicate with the client.
a74ee4396fe11ffc1ca05837a59e497c905eedc3sf * Code originally by Rob McCool; much redone by Robert S. Thau
a74ee4396fe11ffc1ca05837a59e497c905eedc3sf * and the Apache Software Foundation.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe#include "http_log.h" /* For errors detected in basic auth common
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * support code... */
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe#include "util_date.h" /* For parseHTTPdate and BAD_DATE */
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe apr_table_get(r->headers_out, "Connection"), "close");
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe const char *conn = apr_table_get(r->headers_in, "Connection");
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* The following convoluted conditional determines whether or not
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * the current connection should remain persistent after this response
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz * (a.k.a. HTTP Keep-Alive) and whether or not the output message
828333c93c6c11a4b46154302515e35cc6982f12sctemme * body should use the HTTP/1.1 chunked transfer-coding. In English,
54ab41105e95418b4bb2a130d271a631e42fc21epgollucci * IF we have not marked this connection as errored;
38d2c5d41cdb5eb28668d0290b59f8c76ae2a4bfjim * and the response body has a defined length due to the status code
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * being 304 or 204, the request method being HEAD, already
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * having defined Content-Length or Transfer-Encoding: chunked, or
bce58f79020e39e5ac5de398fe08b4f8a1e19970pgollucci * the request version being HTTP/1.1 and thus capable of being set
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * as chunked [we know the (r->chunked = 1) side-effect is ugly];
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * and the server configuration enables keep-alive;
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz * and the server configuration has a reasonable inter-request timeout;
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * and there is no maximum # requests or the max hasn't been reached;
828333c93c6c11a4b46154302515e35cc6982f12sctemme * and the response status does not require a close;
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * and the response generator has not already indicated close;
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * and the client did not request non-persistence (Connection: close);
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * and we haven't been configured to ignore the buggy twit
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz * or they're a buggy twit coming through a HTTP/1.1 proxy
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * and the client is requesting an HTTP/1.0-style keep-alive
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * or the client claims to be HTTP/1.1 compliant (perhaps a proxy);
62f7716b14b71603a8004434ca3536902bfb8899wrowe * THEN we can be persistent, which requires more headers be output.
53e66a2931d02e84628ba946055cc92e56b43db8wrowe * Note that the condition evaluation order is extremely important.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe "Transfer-Encoding"),
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe && (r->chunked = 1))) /* THIS CODE IS CORRECT, see comment above. */
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe || (r->server->keep_alive_max > r->connection->keepalives))
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe && ((ka_sent = ap_find_token(r->pool, conn, "keep-alive"))
979b5dac648b2e3eef4b5a514b3711b58640026bsctemme int left = r->server->keep_alive_max - r->connection->keepalives;
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* If they sent a Keep-Alive token, send one back */
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe apr_table_mergen(r->headers_out, "Connection", "Keep-Alive");
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* Otherwise, we need to indicate that we will be closing this
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * connection immediately after the current response.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * We only really need to send "close" to HTTP/1.1 clients, but we
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * always send it anyway, because a broken proxy may identify itself
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * as HTTP/1.0, but pass our request along with our HTTP/1.1 tag
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * to a HTTP/1.1 client. Better safe than sorry.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe apr_table_mergen(r->headers_out, "Connection", "close");
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe const char *etag = apr_table_get(r->headers_out, "ETag");
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe const char *if_match, *if_modified_since, *if_unmodified, *if_nonematch;
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* Check for conditional requests --- note that we only want to do
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * this if we are successful so far and we are not processing a
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * subrequest or an ErrorDocument.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * The order of the checks is important, since ETag checks are supposed
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * to be more accurate than checks relative to the modification time.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * However, not all documents are guaranteed to *have* ETags, and some
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * might have Last-Modified values w/o ETags, so this gets a little
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * complicated.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe if (!ap_is_HTTP_SUCCESS(r->status) || r->no_local_copy) {
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* XXX: we should define a "time unset" constant */
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* If an If-Match request-header field was given
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * AND the field value is not "*" (meaning match anything)
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * AND if our strong ETag does not match any entity tag in that field,
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * respond with a status of 412 (Precondition Failed).
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe if ((if_match = apr_table_get(r->headers_in, "If-Match")) != NULL) {
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* Else if a valid If-Unmodified-Since request-header field was given
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * AND the requested resource has been modified since the time
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * specified in this field, then the server MUST
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * respond with a status of 412 (Precondition Failed).
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe if_unmodified = apr_table_get(r->headers_in, "If-Unmodified-Since");
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* If an If-None-Match request-header field was given
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * AND the field value is "*" (meaning match anything)
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * OR our ETag matches any of the entity tags in that field, fail.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * If the request method was GET or HEAD, failure means the server
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * SHOULD respond with a 304 (Not Modified) response.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * For all other request methods, failure means the server MUST
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * respond with a status of 412 (Precondition Failed).
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * GET or HEAD allow weak etag comparison, all other methods require
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * strong comparison. We can only use weak if it's not a range request.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe if_nonematch = apr_table_get(r->headers_in, "If-None-Match");
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* Else if a valid If-Modified-Since request-header field was given
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * AND it is a GET or HEAD request
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * AND the requested resource has not been modified since the time
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * specified in this field, then the server MUST
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * respond with a status of 304 (Not Modified).
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * A date later than the server's current request time is invalid.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe/* Get the method number associated with the given string, assumed to
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * contain an HTTP method. Returns M_INVALID if not recognized.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * This is the first step toward placing method names in a configurable
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * list. Hopefully it (and other routines) can eventually be moved to
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * something like a mod_http_methods.c, complete with config stuff.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewroweAP_DECLARE(int) ap_method_number_of(const char *method)
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe switch (*method) {
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * Turn a known method number into a name. Doesn't work for
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * extension methods, obviously.
bce58f79020e39e5ac5de398fe08b4f8a1e19970pgollucciAP_DECLARE(const char *) ap_method_name_of(int methnum)
28c4fe67d75f8f26504d75b7aa8dc5d868032888wrowe static const char *AP_HTTP_METHODS[METHODS] = { NULL };
28c4fe67d75f8f26504d75b7aa8dc5d868032888wrowe * This is ugly, but the previous incantation made Windows C
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * varf. I'm not even sure it was ANSI C. However, ugly as it
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * is, this works, and we only have to do it once.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * Since we're using symbolic names, make sure we only do
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * this once by forcing a value into the first slot IFF it's
28c4fe67d75f8f26504d75b7aa8dc5d868032888wrowe * still NULL.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe enum {WANT_HDR /* must have value zero */, WANT_BODY, WANT_TRL} state;
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowestatic long get_chunk_size(char *);
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewroweapr_status_t ap_dechunk_filter(ap_filter_t *f, apr_bucket_brigade *bb,
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe const char *buf;
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe f->ctx = ctx = apr_pcalloc(f->r->pool, sizeof(struct dechunk_ctx));
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* Time to read another chunk header or trailer... ap_http_filter() is
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * the next filter in line and it knows how to return a brigade with
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe * one line.
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe if ((rv = ap_getline(line, sizeof(line), f->r, 0)) < 0) {
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* XXX sanity check end chunk here */
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* bad trailer */
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe if (ctx->chunk_size == 0) { /* we just finished the last chunk? */
9e86ff266f053757dd96dab7cf4bc53aaaaa583ewrowe /* append eos bucket and get out */
62f7716b14b71603a8004434ca3536902bfb8899wrowe ap_assert(ctx->state == WANT_HDR || ctx->state == WANT_TRL);
return rv;
b = APR_BUCKET_NEXT(b);
return APR_SUCCESS;
typedef struct http_filter_ctx {
} http_ctx_t;
apr_bucket *e;
char *buff;
char *pos;
if (!ctx) {
apr_bucket *e;
const char *str;
e = NULL;
return APR_EOF;
const char *c = str;
if (*c == APR_ASCII_LF)
else return APR_SUCCESS;
return rv;
if (f->c->remain) {
const char *ignore;
return rv;
if (len) {
f->c->remain = 0;
APR_BRIGADE_INSERT_TAIL(b, e);
if (f->c->remain == 0) {
return APR_SUCCESS;
return rv;
APR_BRIGADE_INSERT_TAIL(b, e);
return APR_SUCCESS;
APR_BRIGADE_INSERT_TAIL(b, e);
return APR_SUCCESS;
* The number of status lines must equal the value of RESPONSE_CODES (httpd.h)
#ifdef UTS21
int i, pos;
return LEVEL_500;
return pos;
typedef struct header_struct {
* In other words, don't change this one without checking table_do in alloc.c.
char *headfield;
const char **protocol)
if (r->assbackwards) {
if (!r->status_line)
const char *protocol)
char *tmp;
if (r->assbackwards) {
const char *protocol;
char *list;
int mask;
NULL);
int rv;
while (r->prev)
r = r->prev;
return rv;
apr_table_do((int (*) (void *, const char *, const char *))
return OK;
if (r->assbackwards)
return DECLINED;
return OK;
* consisting of comma/space-separated tokens.
char *start;
char **strpp;
start = e;
++i, ++strpp) {
ap_filter_t *f,
request_rec *r = f->r;
const char *clheader;
const char *protocol;
apr_bucket *e;
APR_BRIGADE_FOREACH(e, b) {
return AP_FILTER_ERROR;
if (r->assbackwards) {
r->bytes_sent = 0;
r->headers_out);
fixup_vary(r);
ap_set_keepalive(r);
if (r->chunked) {
r->content_type));
if (r->content_encoding) {
r->content_encoding);
else if (r->content_language) {
r->content_language);
if (r->header_only &&
(void *) &h, r->headers_out,
NULL);
if (r->header_only) {
return OK;
if (r->chunked) {
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;
#ifdef AP_DEBUG
&core_module);
return OK;
char *tmp;
apr_bucket *e;
e = apr_bucket_flush_create();
static long get_chunk_size(char *b)
long chunksize = 0;
while (apr_isxdigit(*b)) {
int xvalue = 0;
return chunksize;
const char *tempbuf;
&core_module);
total = 0;
old = b;
b = APR_BUCKET_NEXT(b);
return total;
int rv;
return rv;
if (r->expecting_100) {
return OK;
if (rv < 0)
return HTTP_BAD_REQUEST;
return OK;
const char *prefix,
const char *key,
const char *suffix)
return result;
request_rec *r,
const char *location)
switch (status) {
case HTTP_MOVED_PERMANENTLY:
case HTTP_MOVED_TEMPORARILY:
case HTTP_TEMPORARY_REDIRECT:
return(apr_pstrcat(p,
NULL));
case HTTP_SEE_OTHER:
return(apr_pstrcat(p,
NULL));
case HTTP_USE_PROXY:
return(apr_pstrcat(p,
NULL));
case HTTP_UNAUTHORIZED:
case HTTP_BAD_REQUEST:
return(add_optional_notes(r,
case HTTP_FORBIDDEN:
return(apr_pstrcat(p,
NULL));
case HTTP_NOT_FOUND:
return(apr_pstrcat(p,
NULL));
case HTTP_METHOD_NOT_ALLOWED:
return(apr_pstrcat(p,
NULL));
case HTTP_NOT_ACCEPTABLE:
NULL);
case HTTP_MULTIPLE_CHOICES:
case HTTP_LENGTH_REQUIRED:
r->method,
NULL);
case HTTP_PRECONDITION_FAILED:
return(apr_pstrcat(p,
NULL));
case HTTP_NOT_IMPLEMENTED:
NULL);
case HTTP_BAD_GATEWAY:
case HTTP_VARIANT_ALSO_VARIES:
return(apr_pstrcat(p,
NULL));
case HTTP_REQUEST_TIME_OUT:
case HTTP_GONE:
return(apr_pstrcat(p,
NULL));
return(apr_pstrcat(p,
r->method,
NULL));
case HTTP_EXPECTATION_FAILED:
return(apr_pstrcat(p,
NULL));
case HTTP_LOCKED:
case HTTP_FAILED_DEPENDENCY:
case HTTP_SERVICE_UNAVAILABLE:
case HTTP_GATEWAY_TIME_OUT:
case HTTP_NOT_EXTENDED:
return(apr_pstrcat(p,
NULL));
f = f->next;
f = f->next;
char *custom_response;
r->eos_sent = 0;
reset_filters(r);
if (!r->assbackwards) {
r->clength = 0;
if (r->header_only) {
r = r->prev;
const char *h1;
NULL);
NULL);
if (recursive_error) {
return ml;
char **imethods;
char **omethods;
int mnum),
void *rec,
const char *mname,
int mnum),
int methnum;
char **methods;
int methnum;
const char **xmethod;
char **methods;
const char *method)
int methnum;
char **methods;
l->method_mask = 0;
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++;
if (!dash)
dash++;
if (*dash)
if (*start < 0)
*start = 0;
typedef struct byterange_ctx {
int num_ranges;
const char *orig_ct;
* 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;
ap_filter_t *f,
request_rec *r = f->r;
apr_bucket *e;
char *current;
char *bound_head;
int found = 0;
if (!ctx) {
e = apr_bucket_eos_create();
if (num_ranges == 0) {
r->content_type =
return APR_SUCCESS;
NULL);
char *ts;
ec = e;
const char *str;
if (found == 0) {
return HTTP_RANGE_NOT_SATISFIABLE;
char *end;
e = apr_bucket_eos_create();
const char *range;
const char *if_range;
const char *match;
const char *ct;
int num_ranges;
if (r->assbackwards)
* send multipart/x-byteranges instead of multipart/byteranges for
int rv;
return rv;
NULL));
return num_ranges;