mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
Begin mod_core.h for CORE-private information. Ideally, AP_CORE_DECLARE
function decl's and CORE_PRIVATE header info should all move into this header. Start with moving the filter function declarations. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87808 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -62,8 +62,6 @@
|
||||
#include "apr_hooks.h"
|
||||
#include "apr_portable.h"
|
||||
#include "apr_mmap.h"
|
||||
#include "util_filter.h"
|
||||
#include "apr_buckets.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -103,12 +101,6 @@ AP_DECLARE(void) ap_basic_http_header(request_rec *r, char *buf);
|
||||
*/
|
||||
AP_DECLARE(void) ap_send_http_header(request_rec *l);
|
||||
|
||||
AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(ap_filter_t *f, apr_bucket_brigade *b);
|
||||
AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f, apr_bucket_brigade *b);
|
||||
AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *,
|
||||
apr_bucket_brigade *);
|
||||
AP_CORE_DECLARE_NONSTD(apr_status_t) ap_old_write_filter(ap_filter_t *f, apr_bucket_brigade *b);
|
||||
|
||||
/* Send the response to special method requests */
|
||||
|
||||
AP_DECLARE(int) ap_send_http_trace(request_rec *r);
|
||||
@@ -519,9 +511,6 @@ AP_DECLARE(int) ap_method_number_of(const char *method);
|
||||
*/
|
||||
AP_DECLARE(const char *) ap_method_name_of(int methnum);
|
||||
|
||||
apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode);
|
||||
apr_status_t ap_dechunk_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode);
|
||||
|
||||
|
||||
/* Hooks */
|
||||
/*
|
||||
|
@@ -62,9 +62,10 @@
|
||||
#include "apr_fnmatch.h"
|
||||
#include "apr_thread_proc.h" /* for RLIMIT stuff */
|
||||
|
||||
#if APR_HAVE_SYS_UIO_H
|
||||
#include <sys/uio.h> /* for iovec */
|
||||
#endif
|
||||
#define APR_WANT_IOVEC
|
||||
#define APR_WANT_STRFUNC
|
||||
#define APR_WANT_MEMFUNC
|
||||
#include "apr_want.h"
|
||||
|
||||
#define CORE_PRIVATE
|
||||
#include "ap_config.h"
|
||||
@@ -84,15 +85,15 @@
|
||||
#include "util_ebcdic.h"
|
||||
#include "mpm.h"
|
||||
|
||||
#include "mod_core.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* LimitXMLRequestBody handling */
|
||||
#define AP_LIMIT_UNSET ((long) -1)
|
||||
|
@@ -65,16 +65,18 @@
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_strings.h"
|
||||
#include "apr_buckets.h"
|
||||
|
||||
#define APR_WANT_STDIO /* for sscanf */
|
||||
#define APR_WANT_STRFUNC
|
||||
#define APR_WANT_MEMFUNC
|
||||
#include "apr_want.h"
|
||||
|
||||
#if APR_HAVE_STDIO_H
|
||||
#include <stdio.h> /* for EOF, sscanf() */
|
||||
#endif
|
||||
#if APR_HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#define CORE_PRIVATE
|
||||
#include "apr_buckets.h"
|
||||
#include "util_filter.h"
|
||||
#include "ap_config.h"
|
||||
#include "httpd.h"
|
||||
@@ -91,12 +93,12 @@
|
||||
#include "util_ebcdic.h"
|
||||
#include "mpm_status.h"
|
||||
|
||||
#include "mod_core.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
|
||||
APR_HOOK_STRUCT(
|
||||
APR_HOOK_LINK(post_read_request)
|
||||
|
@@ -66,6 +66,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "apr_strings.h"
|
||||
#include "apr_file_io.h"
|
||||
#include "apr_fnmatch.h"
|
||||
|
||||
#define CORE_PRIVATE
|
||||
#include "ap_config.h"
|
||||
#include "httpd.h"
|
||||
@@ -77,9 +81,9 @@
|
||||
#include "http_main.h"
|
||||
#include "util_filter.h"
|
||||
#include "util_charset.h"
|
||||
#include "apr_strings.h"
|
||||
#include "apr_file_io.h"
|
||||
#include "apr_fnmatch.h"
|
||||
|
||||
#include "mod_core.h"
|
||||
|
||||
#ifdef APR_HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
@@ -1358,15 +1362,26 @@ static void process_request_internal(request_rec *r)
|
||||
|
||||
static void check_pipeline_flush(request_rec *r)
|
||||
{
|
||||
/* ### if would be nice if we could PEEK without a brigade. that would
|
||||
### allow us to defer creation of the brigade to when we actually
|
||||
### need to send a FLUSH. */
|
||||
apr_bucket_brigade *bb = apr_brigade_create(r->pool);
|
||||
|
||||
/* Flush the filter contents if:
|
||||
*
|
||||
* 1) the connection will be closed
|
||||
* 2) there isn't a request ready to be read
|
||||
*/
|
||||
/* ### shouldn't this read from the connection input filters? */
|
||||
if (!r->connection->keepalive ||
|
||||
ap_get_brigade(r->input_filters, bb, AP_MODE_PEEK) != APR_SUCCESS) {
|
||||
apr_bucket *e = apr_bucket_create_flush();
|
||||
|
||||
/* We just send directly to the connection based filters, because at
|
||||
* this point, we know that we have seen all of the data, so we just
|
||||
* want to flush the buckets if something hasn't been sent to the
|
||||
* network yet.
|
||||
/* We just send directly to the connection based filters. At
|
||||
* this point, we know that we have seen all of the data
|
||||
* (request finalization sent an EOS bucket, which empties all
|
||||
* of the request filters). We just want to flush the buckets
|
||||
* if something hasn't been sent to the network yet.
|
||||
*/
|
||||
APR_BRIGADE_INSERT_HEAD(bb, e);
|
||||
ap_pass_brigade(r->connection->output_filters, bb);
|
||||
|
92
modules/http/mod_core.h
Normal file
92
modules/http/mod_core.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/* ====================================================================
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 2000 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. The end-user documentation included with the redistribution,
|
||||
* if any, must include the following acknowledgment:
|
||||
* "This product includes software developed by the
|
||||
* Apache Software Foundation (http://www.apache.org/)."
|
||||
* Alternately, this acknowledgment may appear in the software itself,
|
||||
* if and wherever such third-party acknowledgments normally appear.
|
||||
*
|
||||
* 4. The names "Apache" and "Apache Software Foundation" must
|
||||
* not be used to endorse or promote products derived from this
|
||||
* software without prior written permission. For written
|
||||
* permission, please contact apache@apache.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "Apache",
|
||||
* nor may "Apache" appear in their name, without prior written
|
||||
* permission of the Apache Software Foundation.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This software consists of voluntary contributions made by many
|
||||
* individuals on behalf of the Apache Software Foundation. For more
|
||||
* information on the Apache Software Foundation, please see
|
||||
* <http://www.apache.org/>.
|
||||
*/
|
||||
|
||||
#ifndef MOD_CORE_H
|
||||
#define MOD_CORE_H
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_buckets.h"
|
||||
|
||||
#include "httpd.h"
|
||||
#include "util_filter.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @package mod_core private header file
|
||||
*/
|
||||
|
||||
/*
|
||||
* These (output) filters are internal to the mod_core operation.
|
||||
*/
|
||||
AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(ap_filter_t *f, apr_bucket_brigade *b);
|
||||
AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f, apr_bucket_brigade *b);
|
||||
AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *,
|
||||
apr_bucket_brigade *);
|
||||
AP_CORE_DECLARE_NONSTD(apr_status_t) ap_old_write_filter(ap_filter_t *f, apr_bucket_brigade *b);
|
||||
|
||||
/*
|
||||
* These (input) filters are internal to the mod_core operation.
|
||||
*/
|
||||
apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode);
|
||||
apr_status_t ap_dechunk_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !MOD_CORE_H */
|
Reference in New Issue
Block a user