http_protocol.h revision cf8d02ea0c91653917b044529f3133c5a1bb9200
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl/* Licensed to the Apache Software Foundation (ASF) under one or more
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * contributor license agreements. See the NOTICE file distributed with
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * this work for additional information regarding copyright ownership.
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * The ASF licenses this file to You under the Apache License, Version 2.0
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * (the "License"); you may not use this file except in compliance with
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * the License. You may obtain a copy of the License at
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl *
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * http://www.apache.org/licenses/LICENSE-2.0
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl *
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * Unless required by applicable law or agreed to in writing, software
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * distributed under the License is distributed on an "AS IS" BASIS,
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * See the License for the specific language governing permissions and
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * limitations under the License.
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * @file http_protocol.h
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * @brief HTTP protocol handling
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco *
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * @defgroup APACHE_CORE_PROTO HTTP Protocol Handling
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * @ingroup APACHE_CORE
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * @{
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#ifndef APACHE_HTTP_PROTOCOL_H
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco#define APACHE_HTTP_PROTOCOL_H
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco#include "httpd.h"
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#include "apr_hooks.h"
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#include "apr_portable.h"
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco#include "apr_mmap.h"
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco#include "apr_buckets.h"
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco#include "util_filter.h"
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco#ifdef __cplusplus
b9840e4ee6fda6e42fa4ee9f337482ccc4839a39Adrián Riescoextern "C" {
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco#endif
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco/**
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * This hook allows modules to insert filters for the current error response
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @param r the current request
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @ingroup hooks
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco */
223be434693e8c97e2522ac19155a284b3536035Adrián RiescoAP_DECLARE_HOOK(void,insert_error_filter,(request_rec *r))
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco/** This is an optimization. We keep a record of the filter_rec that
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * stores the old_write filter, so that we can avoid strcmp's later.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián RiescoAP_DECLARE_DATA extern ap_filter_rec_t *ap_old_write_func;
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/*
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Prototypes for routines which either talk directly back to the user,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * or control the ones that eventually do.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Read a request and fill in the fields.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param c The current connection
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return The new request_rec
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescorequest_rec *ap_read_request(conn_rec *c);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Read the mime-encoded headers.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco */
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián RiescoAP_DECLARE(void) ap_get_mime_headers(request_rec *r);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Optimized version of ap_get_mime_headers() that requires a
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * temporary brigade to work with
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param bb temp brigade
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_get_mime_headers_core(request_rec *r,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco apr_bucket_brigade *bb);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/* Finish up stuff after a request */
7474965b2e6323002c96c0b39a59843cde201870Adrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Called at completion of sending the response. It sends the terminating
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * protocol information.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_finalize_request_protocol(request_rec *r);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Send error back to client.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param recursive_error last arg indicates error status in case we get
7474965b2e6323002c96c0b39a59843cde201870Adrián Riesco * an error in the process of trying to deal with an ErrorDocument
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * to handle some other error. In that case, we print the default
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * report for the first thing that went wrong, and more briefly report
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * on the problem with the ErrorDocument.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/* Set last modified header line from the lastmod date of the associated file.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Also, set content length.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco *
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * May return an error status, typically HTTP_NOT_MODIFIED (that when the
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * permit_cache argument is set to one).
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
7474965b2e6323002c96c0b39a59843cde201870Adrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Set the content length for this request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param length The new content length
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_set_content_length(request_rec *r, apr_off_t length);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Set the keepalive status for this request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return 1 if keepalive can be set, 0 otherwise
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(int) ap_set_keepalive(request_rec *r);
7474965b2e6323002c96c0b39a59843cde201870Adrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Return the latest rational time from a request/mtime pair. Mtime is
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * returned unless it's in the future, in which case we return the current time.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param mtime The last modified time
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return the latest rational time.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(apr_time_t) ap_rationalize_mtime(request_rec *r, apr_time_t mtime);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Build the content-type that should be sent to the client from the
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * content-type specified. The following rules are followed:
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * - if type is NULL or "", return NULL (do not set content-type).
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * - if charset adding is disabled, stop processing and return type.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * - then, if there are no parameters on type, add the default charset
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * - return type
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param type The content type
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return The content-type
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(const char *) ap_make_content_type(request_rec *r,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *type);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Precompile metadata structures used by ap_make_content_type()
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param pool The pool to use for allocations
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_setup_make_content_type(apr_pool_t *pool);
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Construct an entity tag from the resource information. If it's a real
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * file, build in some of the file characteristics.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param force_weak Force the entity tag to be weak - it could be modified
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * again in as short an interval.
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @return The entity tag
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(char *) ap_make_etag(request_rec *r, int force_weak);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Set the E-tag outgoing header
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_set_etag(request_rec *r);
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Set the last modified time for the file being sent
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_set_last_modified(request_rec *r);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * Implements condition GET rules for HTTP/1.1 specification. This function
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * inspects the client headers and determines if the response fulfills
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * the requirements specified.
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return OK if the response fulfills the condition GET rules, some
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * other status code otherwise
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(int) ap_meets_conditions(request_rec *r);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco/* Other ways to send stuff at the client. All of these keep track
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * of bytes_sent automatically. This indirection is intended to make
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * it a little more painless to slide things like HTTP-NG packetization
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * underneath the main body of the code later. In the meantime, it lets
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * us centralize a bit of accounting (bytes_sent).
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco *
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * These also return the number of bytes written by the call.
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * They should only be called with a timeout registered, for obvious reaasons.
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * (Ditto the send_header stuff).
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco */
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco/**
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * Send an entire file to the client, using sendfile if supported by the
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * current platform
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @param fd The file to send.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * @param offset Offset into the file to start sending.
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @param length Amount of data to send
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @param nbytes Amount of data actually sent
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco */
223be434693e8c97e2522ac19155a284b3536035Adrián RiescoAP_DECLARE(apr_status_t) ap_send_fd(apr_file_t *fd, request_rec *r, apr_off_t offset,
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco apr_size_t length, apr_size_t *nbytes);
3f8cdebaede9921402318d525b57a9af8f9279d3Adrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#if APR_HAS_MMAP
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Send an MMAP'ed file to the client
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param mm The MMAP'ed file to send
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * @param offset The offset into the MMAP to start sending
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * @param length The amount of data to send
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @return The number of bytes sent
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco */
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián RiescoAP_DECLARE(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset,
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco size_t length);
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián Riesco#endif
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco/**
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián Riesco * Register a new request method, and return the offset that will be
0f593bb6e3f0bc82abf3d6d3c76ef222a43d0476Adrián Riesco * associated with that method.
0f593bb6e3f0bc82abf3d6d3c76ef222a43d0476Adrián Riesco *
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián Riesco * @param p The pool to create registered method numbers from.
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián Riesco * @param methname The name of the new method to register.
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * @return Ab int value representing an offset into a bitmask.
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco */
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián RiescoAP_DECLARE(int) ap_method_register(apr_pool_t *p, const char *methname);
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián Riesco
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián Riesco/**
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * Initialize the method_registry and allocate memory for it.
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco *
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián Riesco * @param p Pool to allocate memory for the registry from.
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián Riesco */
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián RiescoAP_DECLARE(void) ap_method_registry_init(apr_pool_t *p);
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián Riesco
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco/**
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * This is a convenience macro to ease with checking a mask
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * against a method name.
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco */
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco#define AP_METHOD_CHECK_ALLOWED(mask, methname) \
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco ((mask) & (AP_METHOD_BIT << ap_method_number_of((methname))))
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco/**
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * Create a new method list with the specified number of preallocated
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * slots for extension methods.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco *
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @param p Pointer to a pool in which the structure should be
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * allocated.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @param nelts Number of preallocated extension slots
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @return Pointer to the newly created structure.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco */
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián RiescoAP_DECLARE(ap_method_list_t *) ap_make_method_list(apr_pool_t *p, int nelts);
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco/**
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * Copy a method list
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco *
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @param dest List to copy to
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @param src List to copy from
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco */
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián RiescoAP_DECLARE(void) ap_copy_method_list(ap_method_list_t *dest,
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco ap_method_list_t *src);
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco/**
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * Search for an HTTP method name in an ap_method_list_t structure, and
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * return true if found.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco *
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @param method String containing the name of the method to check.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @param l Pointer to a method list, such as r->allowed_methods.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @return 1 if method is in the list, otherwise 0
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco */
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián RiescoAP_DECLARE(int) ap_method_in_list(ap_method_list_t *l, const char *method);
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco/**
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * Add an HTTP method name to an ap_method_list_t structure if it isn't
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * already listed.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco *
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @param method String containing the name of the method to check.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @param l Pointer to a method list, such as r->allowed_methods.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * @return None.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco */
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián RiescoAP_DECLARE(void) ap_method_list_add(ap_method_list_t *l, const char *method);
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco/**
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * Remove an HTTP method name from an ap_method_list_t structure.
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco *
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * @param l Pointer to a method list, such as r->allowed_methods.
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @param method String containing the name of the method to remove.
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @return None.
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco */
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián RiescoAP_DECLARE(void) ap_method_list_remove(ap_method_list_t *l,
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco const char *method);
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco/**
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * Reset a method list to be completely empty.
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco *
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * @param l Pointer to a method list, such as r->allowed_methods.
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * @return None.
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco */
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián RiescoAP_DECLARE(void) ap_clear_method_list(ap_method_list_t *l);
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco/**
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * Set the content type for this request (r->content_type).
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @param r The current request
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @param ct The new content type
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @warning This function must be called to set r->content_type in order
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * for the AddOutputFilterByType directive to work correctly.
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco */
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián RiescoAP_DECLARE(void) ap_set_content_type(request_rec *r, const char *ct);
b9840e4ee6fda6e42fa4ee9f337482ccc4839a39Adrián Riesco
b9840e4ee6fda6e42fa4ee9f337482ccc4839a39Adrián Riesco/* Hmmm... could macrofy these for now, and maybe forever, though the
b9840e4ee6fda6e42fa4ee9f337482ccc4839a39Adrián Riesco * definitions of the macros would get a whole lot hairier.
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco */
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco/**
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * Output one character for this request
0be63c5d4b5e66cc600a0003081ae2bf85be9615Adrián Riesco * @param c the character to output
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * @param r the current request
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * @return The number of bytes sent
0be63c5d4b5e66cc600a0003081ae2bf85be9615Adrián Riesco */
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián RiescoAP_DECLARE(int) ap_rputc(int c, request_rec *r);
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco/**
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * Output a string for the current request
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * @param str The string to output
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * @param r The current request
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * @return The number of bytes sent
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco */
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián RiescoAP_DECLARE(int) ap_rputs(const char *str, request_rec *r);
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco/**
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * Write a buffer for the current request
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @param buf The buffer to write
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * @param nbyte The number of bytes to send from the buffer
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * @param r The current request
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @return The number of bytes sent
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco */
7fc57d0f02d0fec1192376ccebe2be0224cb9a55Adrián RiescoAP_DECLARE(int) ap_rwrite(const void *buf, int nbyte, request_rec *r);
7fc57d0f02d0fec1192376ccebe2be0224cb9a55Adrián Riesco
7fc57d0f02d0fec1192376ccebe2be0224cb9a55Adrián Riesco/**
b9840e4ee6fda6e42fa4ee9f337482ccc4839a39Adrián Riesco * Write an unspecified number of strings to the request
b9840e4ee6fda6e42fa4ee9f337482ccc4839a39Adrián Riesco * @param r The current request
7fc57d0f02d0fec1192376ccebe2be0224cb9a55Adrián Riesco * @param ... The strings to write
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * @return The number of bytes sent
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco */
223be434693e8c97e2522ac19155a284b3536035Adrián RiescoAP_DECLARE_NONSTD(int) ap_rvputs(request_rec *r,...);
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * Output data to the client in a printf format
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @param r The current request
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * @param fmt The format string
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * @param vlist The arguments to use to fill out the format string
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * @return The number of bytes sent
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco */
7fc57d0f02d0fec1192376ccebe2be0224cb9a55Adrián RiescoAP_DECLARE(int) ap_vrprintf(request_rec *r, const char *fmt, va_list vlist);
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * Output data to the client in a printf format
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param r The current request
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param fmt The format string
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param ... The arguments to use to fill out the format string
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * @return The number of bytes sent
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco */
223be434693e8c97e2522ac19155a284b3536035Adrián RiescoAP_DECLARE_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt,...)
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco __attribute__((format(printf,2,3)));
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco/**
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * Flush all of the data for the current request to the client
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param r The current request
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @return The number of bytes sent
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco */
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián RiescoAP_DECLARE(int) ap_rflush(request_rec *r);
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * Index used in custom_responses array for a specific error code
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * (only use outside protocol.c is in getting them configured).
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param status HTTP status code
7fc57d0f02d0fec1192376ccebe2be0224cb9a55Adrián Riesco * @return The index of the response
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco */
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián RiescoAP_DECLARE(int) ap_index_of_response(int status);
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * Return the Status-Line for a given status code (excluding the
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * HTTP-Version field). If an invalid or unknown status code is
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * passed, "500 Internal Server Error" will be returned.
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param status The HTTP status code
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @return The Status-Line
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco */
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián RiescoAP_DECLARE(const char *) ap_get_status_line(int status);
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/* Reading a block of data from the client connection (e.g., POST arg) */
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * Setup the client to allow Apache to read the request body.
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param r The current request
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param read_policy How the server should interpret a chunked
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * transfer-encoding. One of: <pre>
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * REQUEST_NO_BODY Send 413 error if message has any body
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * REQUEST_CHUNKED_ERROR Send 411 error if body without Content-Length
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * REQUEST_CHUNKED_DECHUNK If chunked, remove the chunks for me.
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * </pre>
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @return either OK or an error code
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco */
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián RiescoAP_DECLARE(int) ap_setup_client_block(request_rec *r, int read_policy);
7fc57d0f02d0fec1192376ccebe2be0224cb9a55Adrián Riesco
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco/**
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * Determine if the client has sent any data. This also sends a
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * 100 Continue response to HTTP/1.1 clients, so modules should not be called
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * until the module is ready to read content.
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @warning Never call this function more than once.
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param r The current request
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * @return 0 if there is no message to read, 1 otherwise
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco */
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián RiescoAP_DECLARE(int) ap_should_client_block(request_rec *r);
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * Call this in a loop. It will put data into a buffer and return the length
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * of the input block
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param r The current request
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param buffer The buffer in which to store the data
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param bufsiz The size of the buffer
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @return Number of bytes inserted into the buffer. When done reading, 0
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * if EOF, or -1 if there was an error
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco */
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián RiescoAP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer, apr_size_t bufsiz);
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * In HTTP/1.1, any method can have a body. However, most GET handlers
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * wouldn't know what to do with a request body if they received one.
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * This helper routine tests for and reads any message body in the request,
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * simply discarding whatever it receives. We need to do this because
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * failing to read the request body would cause it to be interpreted
7fc57d0f02d0fec1192376ccebe2be0224cb9a55Adrián Riesco * as the next request on a persistent connection.
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * @param r The current request
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * @return error status if request is malformed, OK otherwise
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco */
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián RiescoAP_DECLARE(int) ap_discard_request_body(request_rec *r);
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * Setup the output headers so that the client knows how to authenticate
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * itself the next time, if an authentication request failed. This function
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * works for both basic and digest authentication
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param r The current request
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco */
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián RiescoAP_DECLARE(void) ap_note_auth_failure(request_rec *r);
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * Setup the output headers so that the client knows how to authenticate
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * itself the next time, if an authentication request failed. This function
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * works only for basic authentication
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * @param r The current request
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco */
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián RiescoAP_DECLARE(void) ap_note_basic_auth_failure(request_rec *r);
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Setup the output headers so that the client knows how to authenticate
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * itself the next time, if an authentication request failed. This function
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * works only for digest authentication
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @param r The current request
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_note_digest_auth_failure(request_rec *r);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Get the password from the request headers
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * @param pw The password as set in the headers
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * @return 0 (OK) if it set the 'pw' argument (and assured
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * a correct value in r->user); otherwise it returns
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * an error code, either HTTP_INTERNAL_SERVER_ERROR if things are
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco * really confused, HTTP_UNAUTHORIZED if no authentication at all
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * seemed to be in use, or DECLINED if there was authentication but
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * it wasn't Basic (in which case, the caller should presumably
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * decline as well).
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco */
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián RiescoAP_DECLARE(int) ap_get_basic_auth_pw(request_rec *r, const char **pw);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * parse_uri: break apart the uri
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @warning Side Effects:
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @li sets r->args to rest after '?' (or NULL if no '?')
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @li sets r->uri to request uri (without r->args part)
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @li sets r->hostname (if not set already) from request (scheme://host:port)
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param uri The uri to break apart
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián RiescoAP_CORE_DECLARE(void) ap_parse_uri(request_rec *r, const char *uri);
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco
7474965b2e6323002c96c0b39a59843cde201870Adrián Riesco/**
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * Get the next line of input for the request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param s The buffer into which to read the line
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * @param n The size of the buffer
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param fold Whether to merge continuation lines
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @return The length of the line, if successful
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * n, if the line is too big to fit in the buffer
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * -1 for miscellaneous errors
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(int) ap_getline(char *s, int n, request_rec *r, int fold);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco/**
172f4dfb4b858440fab545bac00d3ec4abd0cbe4Adrián Riesco * Get the next line of input for the request
172f4dfb4b858440fab545bac00d3ec4abd0cbe4Adrián Riesco *
172f4dfb4b858440fab545bac00d3ec4abd0cbe4Adrián Riesco * Note: on ASCII boxes, ap_rgetline is a macro which simply calls
172f4dfb4b858440fab545bac00d3ec4abd0cbe4Adrián Riesco * ap_rgetline_core to get the line of input.
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco *
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * on EBCDIC boxes, ap_rgetline is a wrapper function which
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * translates ASCII protocol lines to the local EBCDIC code page
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * after getting the line of input.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco *
7474965b2e6323002c96c0b39a59843cde201870Adrián Riesco * @param s Pointer to the pointer to the buffer into which the line
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * should be read; if *s==NULL, a buffer of the necessary size
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco * to hold the data will be allocated from the request pool
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param n The size of the buffer
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param read The length of the line.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param fold Whether to merge continuation lines
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param bb Working brigade to use when reading buckets
7474965b2e6323002c96c0b39a59843cde201870Adrián Riesco * @return APR_SUCCESS, if successful
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * APR_ENOSPC, if the line is too big to fit in the buffer
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Other errors where appropriate
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#if APR_CHARSET_EBCDIC
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(apr_status_t) ap_rgetline(char **s, apr_size_t n,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco apr_size_t *read,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco request_rec *r, int fold,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco apr_bucket_brigade *bb);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#else /* ASCII box */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#define ap_rgetline(s, n, read, r, fold, bb) \
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco ap_rgetline_core((s), (n), (read), (r), (fold), (bb))
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#endif
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/** @see ap_rgetline */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n,
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco apr_size_t *read,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco request_rec *r, int fold,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco apr_bucket_brigade *bb);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Get the method number associated with the given string, assumed to
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * contain an HTTP method. Returns M_INVALID if not recognized.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param method A string containing a valid HTTP method
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return The method number
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(int) ap_method_number_of(const char *method);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Get the method name associated with the given internal method
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * number. Returns NULL if not recognized.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param p A pool to use for temporary allocations.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param methnum An integer value corresponding to an internal method number
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return The name corresponding to the method number
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(const char *) ap_method_name_of(apr_pool_t *p, int methnum);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /* Hooks */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /*
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * post_read_request --- run right after read_request or internal_redirect,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * and not run during any subrequests.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * This hook allows modules to affect the request immediately after the request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * has been read, and before any other phases have been processes. This allows
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * modules to make decisions based upon the input header fields
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return OK or DECLINED
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE_HOOK(int,post_read_request,(request_rec *r))
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * This hook allows modules to perform any module-specific logging activities
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * over and above the normal server things.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return OK, DECLINED, or HTTP_...
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE_HOOK(int,log_transaction,(request_rec *r))
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * This hook allows modules to retrieve the http scheme for a request. This
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * allows Apache modules to easily extend the schemes that Apache understands
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return The http scheme from the request
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE_HOOK(const char *,http_scheme,(const request_rec *r))
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Return the default port from the current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The current request
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * @return The current port
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE_HOOK(apr_port_t,default_port,(const request_rec *r))
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/** @see ap_bucket_type_error */
172f4dfb4b858440fab545bac00d3ec4abd0cbe4Adrián Riescotypedef struct ap_bucket_error ap_bucket_error;
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @struct ap_bucket_error
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @brief A bucket referring to an HTTP error
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco *
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * This bucket can be passed down the filter stack to indicate that an
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * HTTP error occurred while running a filter. In order for this bucket
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco * to be used successfully, it MUST be sent as the first bucket in the
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * first brigade to be sent from a given filter.
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescostruct ap_bucket_error {
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /** Number of buckets using this memory */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco apr_bucket_refcount refcount;
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /** The error code */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco int status;
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /** The error string */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *data;
3b1e33dd8d2de8301d7a31860dd1819bd3752718Adrián Riesco};
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/** @see ap_bucket_type_error */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE_DATA extern const apr_bucket_type_t ap_bucket_type_error;
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Determine if a bucket is an error bucket
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param e The bucket to inspect
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @return true or false
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#define AP_BUCKET_IS_ERROR(e) (e->type == &ap_bucket_type_error)
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco/**
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * Make the bucket passed in an error bucket
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @param b The bucket to make into an error bucket
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @param error The HTTP error code to put in the bucket.
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco * @param buf An optional error string to put in the bucket.
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco * @param p A pool to allocate out of.
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco * @return The new bucket, or NULL if allocation failed
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco */
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián RiescoAP_DECLARE(apr_bucket *) ap_bucket_error_make(apr_bucket *b, int error,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *buf, apr_pool_t *p);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * Create a bucket referring to an HTTP error.
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @param error The HTTP error code to put in the bucket.
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @param buf An optional error string to put in the bucket.
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @param p A pool to allocate the error string out of.
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco * @param list The bucket allocator from which to allocate the bucket
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco * @return The new bucket, or NULL if allocation failed
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco */
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián RiescoAP_DECLARE(apr_bucket *) ap_bucket_error_create(int error, const char *buf,
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco apr_pool_t *p,
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco apr_bucket_alloc_t *list);
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián RiescoAP_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(ap_filter_t *f, apr_bucket_brigade *b);
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián RiescoAP_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f, apr_bucket_brigade *b);
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián RiescoAP_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *,
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco apr_bucket_brigade *);
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián RiescoAP_DECLARE_NONSTD(apr_status_t) ap_old_write_filter(ap_filter_t *f, apr_bucket_brigade *b);
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco/**
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco * Sett up the protocol fields for subsidiary requests
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco * @param rnew New Sub Request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r current request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_set_sub_req_protocol(request_rec *rnew, const request_rec *r);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * A wrapup function to keep the internal accounting straight.
0f77efdcc159eee5682aabf2b9a3c178c467b466Adrián Riesco * Indicates that there is no more content coming.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param sub_r Subrequest that is now compete
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_finalize_sub_req_protocol(request_rec *sub_r);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/**
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Send an interim (HTTP 1xx) response immediately.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param r The request
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * @param send_headers Whether to send&clear headers in r->headers_out
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián RiescoAP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#ifdef __cplusplus
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco}
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#endif
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#endif /* !APACHE_HTTP_PROTOCOL_H */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/** @} */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco