mirror of
https://github.com/apache/httpd.git
synced 2025-08-20 16:09:55 +00:00

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
111 lines
4.2 KiB
C
111 lines
4.2 KiB
C
/* Copyright 2000-2004 Apache Software Foundation
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#ifndef APACHE_HTTP_CONNECTION_H
|
|
#define APACHE_HTTP_CONNECTION_H
|
|
|
|
#include "apr_hooks.h"
|
|
#include "apr_network_io.h"
|
|
#include "apr_buckets.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @package Apache connection library
|
|
*/
|
|
#ifdef CORE_PRIVATE
|
|
/**
|
|
* This is the protocol module driver. This calls all of the
|
|
* pre-connection and connection hooks for all protocol modules.
|
|
* @param c The connection on which the request is read
|
|
* @param csd The mechanism on which this connection is to be read.
|
|
* Most times this will be a socket, but it is up to the module
|
|
* that accepts the request to determine the exact type.
|
|
* @deffunc void ap_process_connection(conn_rec *c, void *csd)
|
|
*/
|
|
AP_CORE_DECLARE(void) ap_process_connection(conn_rec *c, void *csd);
|
|
|
|
AP_CORE_DECLARE(void) ap_flush_conn(conn_rec *c);
|
|
|
|
/**
|
|
* This function is responsible for the following cases:
|
|
* <pre>
|
|
* we now proceed to read from the client until we get EOF, or until
|
|
* MAX_SECS_TO_LINGER has passed. the reasons for doing this are
|
|
* documented in a draft:
|
|
*
|
|
* http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-connection-00.txt
|
|
*
|
|
* in a nutshell -- if we don't make this effort we risk causing
|
|
* TCP RST packets to be sent which can tear down a connection before
|
|
* all the response data has been sent to the client.
|
|
* </pre>
|
|
* @param c The connection we are closing
|
|
*/
|
|
AP_DECLARE(void) ap_lingering_close(conn_rec *c);
|
|
#endif
|
|
|
|
/* Hooks */
|
|
/**
|
|
* create_connection is a RUN_FIRST hook which allows modules to create
|
|
* connections. In general, you should not install filters with the
|
|
* create_connection hook. If you require vhost configuration information
|
|
* to make filter installation decisions, you must use the pre_connection
|
|
* or install_network_transport hook. This hook should close the connection
|
|
* if it encounters a fatal error condition.
|
|
*
|
|
* @param p The pool from which to allocate the connection record
|
|
* @param csd The socket that has been accepted
|
|
* @param conn_id A unique identifier for this connection. The ID only
|
|
* needs to be unique at that time, not forever.
|
|
* @param sbh A handle to scoreboard information for this connection.
|
|
* @return An allocated connection record or NULL.
|
|
*/
|
|
AP_DECLARE_HOOK(conn_rec *, create_connection,
|
|
(apr_pool_t *p, server_rec *server, apr_socket_t *csd,
|
|
long conn_id, void *sbh, apr_bucket_alloc_t *alloc))
|
|
|
|
/**
|
|
* This hook gives protocol modules an opportunity to set everything up
|
|
* before calling the protocol handler. All pre-connection hooks are
|
|
* run until one returns something other than ok or decline
|
|
* @param c The connection on which the request has been received.
|
|
* @param csd The mechanism on which this connection is to be read.
|
|
* Most times this will be a socket, but it is up to the module
|
|
* that accepts the request to determine the exact type.
|
|
* @return OK or DECLINED
|
|
* @deffunc int ap_run_pre_connection(conn_rec *c, void *csd)
|
|
*/
|
|
AP_DECLARE_HOOK(int,pre_connection,(conn_rec *c, void *csd))
|
|
|
|
/**
|
|
* This hook implements different protocols. After a connection has been
|
|
* established, the protocol module must read and serve the request. This
|
|
* function does that for each protocol module. The first protocol module
|
|
* to handle the request is the last module run.
|
|
* @param c The connection on which the request has been received.
|
|
* @return OK or DECLINED
|
|
* @deffunc int ap_run_process_connection(conn_rec *c)
|
|
*/
|
|
AP_DECLARE_HOOK(int,process_connection,(conn_rec *c))
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* !APACHE_HTTP_REQUEST_H */
|