1
0
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:
Greg Stein
2001-01-24 02:14:23 +00:00
parent 3d03cd34e2
commit c8d300bd44
5 changed files with 130 additions and 31 deletions

View File

@@ -62,8 +62,6 @@
#include "apr_hooks.h" #include "apr_hooks.h"
#include "apr_portable.h" #include "apr_portable.h"
#include "apr_mmap.h" #include "apr_mmap.h"
#include "util_filter.h"
#include "apr_buckets.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { 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_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 */ /* Send the response to special method requests */
AP_DECLARE(int) ap_send_http_trace(request_rec *r); 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); 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 */ /* Hooks */
/* /*

View File

@@ -62,9 +62,10 @@
#include "apr_fnmatch.h" #include "apr_fnmatch.h"
#include "apr_thread_proc.h" /* for RLIMIT stuff */ #include "apr_thread_proc.h" /* for RLIMIT stuff */
#if APR_HAVE_SYS_UIO_H #define APR_WANT_IOVEC
#include <sys/uio.h> /* for iovec */ #define APR_WANT_STRFUNC
#endif #define APR_WANT_MEMFUNC
#include "apr_want.h"
#define CORE_PRIVATE #define CORE_PRIVATE
#include "ap_config.h" #include "ap_config.h"
@@ -84,15 +85,15 @@
#include "util_ebcdic.h" #include "util_ebcdic.h"
#include "mpm.h" #include "mpm.h"
#include "mod_core.h"
#ifdef HAVE_SYS_SOCKET_H #ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
#ifdef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
/* LimitXMLRequestBody handling */ /* LimitXMLRequestBody handling */
#define AP_LIMIT_UNSET ((long) -1) #define AP_LIMIT_UNSET ((long) -1)

View File

@@ -65,16 +65,18 @@
#include "apr.h" #include "apr.h"
#include "apr_strings.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 #if APR_HAVE_STDARG_H
#include <stdarg.h> #include <stdarg.h>
#endif #endif
#define CORE_PRIVATE #define CORE_PRIVATE
#include "apr_buckets.h"
#include "util_filter.h" #include "util_filter.h"
#include "ap_config.h" #include "ap_config.h"
#include "httpd.h" #include "httpd.h"
@@ -91,12 +93,12 @@
#include "util_ebcdic.h" #include "util_ebcdic.h"
#include "mpm_status.h" #include "mpm_status.h"
#include "mod_core.h"
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
APR_HOOK_STRUCT( APR_HOOK_STRUCT(
APR_HOOK_LINK(post_read_request) APR_HOOK_LINK(post_read_request)

View File

@@ -66,6 +66,10 @@
* *
*/ */
#include "apr_strings.h"
#include "apr_file_io.h"
#include "apr_fnmatch.h"
#define CORE_PRIVATE #define CORE_PRIVATE
#include "ap_config.h" #include "ap_config.h"
#include "httpd.h" #include "httpd.h"
@@ -77,9 +81,9 @@
#include "http_main.h" #include "http_main.h"
#include "util_filter.h" #include "util_filter.h"
#include "util_charset.h" #include "util_charset.h"
#include "apr_strings.h"
#include "apr_file_io.h" #include "mod_core.h"
#include "apr_fnmatch.h"
#ifdef APR_HAVE_STDARG_H #ifdef APR_HAVE_STDARG_H
#include <stdarg.h> #include <stdarg.h>
#endif #endif
@@ -1358,15 +1362,26 @@ static void process_request_internal(request_rec *r)
static void check_pipeline_flush(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); 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 || if (!r->connection->keepalive ||
ap_get_brigade(r->input_filters, bb, AP_MODE_PEEK) != APR_SUCCESS) { ap_get_brigade(r->input_filters, bb, AP_MODE_PEEK) != APR_SUCCESS) {
apr_bucket *e = apr_bucket_create_flush(); apr_bucket *e = apr_bucket_create_flush();
/* We just send directly to the connection based filters, because at /* We just send directly to the connection based filters. At
* this point, we know that we have seen all of the data, so we just * this point, we know that we have seen all of the data
* want to flush the buckets if something hasn't been sent to the * (request finalization sent an EOS bucket, which empties all
* network yet. * 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); APR_BRIGADE_INSERT_HEAD(bb, e);
ap_pass_brigade(r->connection->output_filters, bb); ap_pass_brigade(r->connection->output_filters, bb);

92
modules/http/mod_core.h Normal file
View 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 */