⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mod_proxy.h

📁 Apache官方在今天放出产品系列2.2的最新版本2.2.11的源码包 最流行的HTTP服务器软件之一
💻 H
📖 第 1 页 / 共 3 页
字号:
/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.  See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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 MOD_PROXY_H#define MOD_PROXY_H /** * @file  mod_proxy.h * @brief Proxy Extension Module for Apache * * @defgroup MOD_PROXY mod_proxy * @ingroup  APACHE_MODS * @{ *//*   Also note numerous FIXMEs and CHECKMEs which should be eliminated.   This code is once again experimental!   Things to do:   1. Make it completely work (for FTP too)   2. HTTP/1.1   Chuck Murcko <chuck@topsail.org> 02-06-01 */#define CORE_PRIVATE#include "apr_hooks.h"#include "apr.h"#include "apr_lib.h"#include "apr_strings.h"#include "apr_buckets.h"#include "apr_md5.h"#include "apr_network_io.h"#include "apr_pools.h"#include "apr_strings.h"#include "apr_uri.h"#include "apr_date.h"#include "apr_strmatch.h"#include "apr_fnmatch.h"#include "apr_reslist.h"#define APR_WANT_STRFUNC#include "apr_want.h"#include "httpd.h"#include "http_config.h"#include "ap_config.h"#include "http_core.h"#include "http_protocol.h"#include "http_request.h"#include "http_vhost.h"#include "http_main.h"#include "http_log.h"#include "http_connection.h"#include "util_filter.h"#include "util_ebcdic.h"#include "ap_provider.h"#if APR_HAVE_NETINET_IN_H#include <netinet/in.h>#endif#if APR_HAVE_ARPA_INET_H#include <arpa/inet.h>#endif/* for proxy_canonenc() */enum enctype {    enc_path, enc_search, enc_user, enc_fpath, enc_parm};#if APR_CHARSET_EBCDIC#define CRLF   "\r\n"#else /*APR_CHARSET_EBCDIC*/#define CRLF   "\015\012"#endif /*APR_CHARSET_EBCDIC*//* default Max-Forwards header setting *//* Set this to -1, which complies with RFC2616 by not setting * max-forwards if the client didn't send it to us. */#define DEFAULT_MAX_FORWARDS    -1/* static information about a remote proxy */struct proxy_remote {    const char *scheme;     /* the schemes handled by this proxy, or '*' */    const char *protocol;   /* the scheme used to talk to this proxy */    const char *hostname;   /* the hostname of this proxy */    apr_port_t  port;       /* the port for this proxy */    ap_regex_t *regexp;        /* compiled regex (if any) for the remote */    int use_regex;          /* simple boolean. True if we have a regex pattern */};#define PROXYPASS_NOCANON 0x01#define PROXYPASS_INTERPOLATE 0x02struct proxy_alias {    const char  *real;    const char  *fake;    ap_regex_t  *regex;    unsigned int flags;};struct dirconn_entry {    char *name;    struct in_addr addr, mask;    struct apr_sockaddr_t *hostaddr;    int (*matcher) (struct dirconn_entry * This, request_rec *r);};struct noproxy_entry {    const char *name;    struct apr_sockaddr_t *addr;};typedef struct proxy_balancer  proxy_balancer;typedef struct proxy_worker    proxy_worker;typedef struct proxy_conn_pool proxy_conn_pool;typedef struct proxy_balancer_method proxy_balancer_method;typedef struct {    apr_array_header_t *proxies;    apr_array_header_t *sec_proxy;    apr_array_header_t *aliases;    apr_array_header_t *noproxies;    apr_array_header_t *dirconn;    apr_array_header_t *allowed_connect_ports;    apr_array_header_t *workers;    apr_array_header_t *balancers;    proxy_worker       *forward;    /* forward proxy worker */    proxy_worker       *reverse;    /* reverse "module-driven" proxy worker */    const char *domain;     /* domain name to use in absence of a domain name in the request */    int req;                /* true if proxy requests are enabled */    char req_set;    enum {      via_off,      via_on,      via_block,      via_full    } viaopt;                   /* how to deal with proxy Via: headers */    char viaopt_set;    apr_size_t recv_buffer_size;    char recv_buffer_size_set;    apr_size_t io_buffer_size;    char io_buffer_size_set;    long maxfwd;    char maxfwd_set;    /**      * the following setting masks the error page     * returned from the 'proxied server' and just      * forwards the status code upwards.     * This allows the main server (us) to generate     * the error page, (so it will look like a error     * returned from the rest of the system      */    int error_override;    int error_override_set;    int preserve_host;    int preserve_host_set;    apr_interval_time_t timeout;    char timeout_set;    enum {      bad_error,      bad_ignore,      bad_body    } badopt;                   /* how to deal with bad headers */    char badopt_set;/* putting new stuff on the end maximises binary back-compatibility. * the strmatch_patterns are really a const just to have a * case-independent strstr. */    enum {        status_off,        status_on,        status_full    } proxy_status;             /* Status display options */    char proxy_status_set;    apr_pool_t *pool;           /* Pool used for allocating this struct */} proxy_server_conf;typedef struct {    const char *p;            /* The path */    int         p_is_fnmatch; /* Is this path an fnmatch candidate? */    ap_regex_t  *r;            /* Is this a regex? *//* ProxyPassReverse and friends are documented as working inside * <Location>.  But in fact they never have done in the case of * more than one <Location>, because the server_conf can't see it. * We need to move them to the per-dir config. * Discussed in February: * http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=110726027118798&w=2 */    apr_array_header_t *raliases;    apr_array_header_t* cookie_paths;    apr_array_header_t* cookie_domains;    const apr_strmatch_pattern* cookie_path_str;    const apr_strmatch_pattern* cookie_domain_str;    const char *ftp_directory_charset;    int interpolate_env;} proxy_dir_conf;/* if we interpolate env vars per-request, we'll need a per-request * copy of the reverse proxy config */typedef struct {    apr_array_header_t *raliases;    apr_array_header_t* cookie_paths;    apr_array_header_t* cookie_domains;} proxy_req_conf;typedef struct {    conn_rec     *connection;    const char   *hostname;    apr_port_t   port;    int          is_ssl;    apr_pool_t   *pool;     /* Subpool for hostname and addr data */    apr_socket_t *sock;     /* Connection socket */    apr_sockaddr_t *addr;   /* Preparsed remote address info */    apr_uint32_t flags;     /* Conection flags */    int          close;     /* Close 'this' connection */    int          close_on_recycle; /* Close the connection when returning to pool */    proxy_worker *worker;   /* Connection pool this connection belongs to */    void         *data;     /* per scheme connection data */#if APR_HAS_THREADS    int          inreslist; /* connection in apr_reslist? */#endif    apr_pool_t   *scpool;   /* Subpool used for socket and connection data */    request_rec  *r;        /* Request record of the frontend request                             * which the backend currently answers. */    int          need_flush;/* Flag to decide whether we need to flush the                             * filter chain or not */} proxy_conn_rec;typedef struct {        float cache_completion; /* completion percentage */        int content_length; /* length of the content */} proxy_completion;/* Connection pool */struct proxy_conn_pool {    apr_pool_t     *pool;   /* The pool used in constructor and destructor calls */    apr_sockaddr_t *addr;   /* Preparsed remote address info */#if APR_HAS_THREADS    apr_reslist_t  *res;    /* Connection resource list */#endif    proxy_conn_rec *conn;   /* Single connection for prefork mpm's */};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -