mod_proxy.c revision 655b45ecbcfe204749cddff73f149dc0ec278905
2d0611ffc9f91c5fc2ddccb93f9a3d17791ae650takashi/* Copyright 1999-2004 The Apache Software Foundation
d3e250aab242db84d14060985b5db675a731d548nd * Licensed under the Apache License, Version 2.0 (the "License");
c79e39ad568d9af854765f64049534044ef6c034nd * you may not use this file except in compliance with the License.
c79e39ad568d9af854765f64049534044ef6c034nd * You may obtain a copy of the License at
c79e39ad568d9af854765f64049534044ef6c034nd * Unless required by applicable law or agreed to in writing, software
c79e39ad568d9af854765f64049534044ef6c034nd * distributed under the License is distributed on an "AS IS" BASIS,
c79e39ad568d9af854765f64049534044ef6c034nd * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#define CORE_PRIVATE
#include "mod_proxy.h"
#include "mod_core.h"
#include "apr_optional.h"
#include "mod_status.h"
#include "mod_ssl.h"
#ifndef MAX
#define MAX(x,y) ((x) >= (y) ? (x) : (y))
* map_to_storage: run proxy_walk (rather than directory_walk/file_walk)
* can't trust directory_walk/file_walk since these are
#ifdef FIX_15207
static unsigned char hex2c(const char* p) {
return ret;
#define PROXY_COPY_CONF_PARAMS(w, c) \
const char *key,
const char *val)
int ival;
if (ival < 0)
if (ival < 0)
if (ival < 0)
return NULL;
const char *key,
const char *val)
int ival;
return NULL;
++aliasp;
++urip;
#ifndef FIX_15207
* GET http://othervhost/cgi-bin/printenv HTTP/1.0
#ifdef FIX_15207
int i, len;
: ap_default_port(r))))) {
#ifdef FIX_15207
if (len > 0) {
return DECLINED;
#ifndef FIX_15207
int i, len;
if (r->proxyreq) {
return OK;
#ifndef FIX_15207
if (len > 0) {
return DECLINED;
return OK;
return DECLINED;
&proxy_module);
for (j = 0; j < num_sec; ++j)
if (entry_proxy->r
return OK;
int access_status;
return DECLINED;
return access_status;
return OK;
#ifndef FIX_15207
char *url, *p;
int access_status;
return DECLINED;
#ifdef FIX_15207
return OK;
return access_status;
return HTTP_BAD_REQUEST;
char *nuri;
const char *ref;
return DECLINED;
&r->parsed_uri,
return HTTP_MOVED_PERMANENTLY;
const char *p2;
int direct_connect = 0;
const char *str;
long maxfwd;
return DECLINED;
switch (r->method_number) {
case M_TRACE: {
int access_status;
return OK;
case M_OPTIONS: {
int access_status;
return OK;
if (p == NULL) {
return HTTP_BAD_REQUEST;
return HTTP_MOVED_PERMANENTLY;
int ii;
#if DEBUGGING
r->uri);
return access_status;
if (!direct_connect) {
goto cleanup;
goto cleanup;
if (balancer) {
return access_status;
return ps;
ps->allowed_connect_ports = apr_array_append(p, base->allowed_connect_ports, overrides->allowed_connect_ports);
ps->recv_buffer_size = (overrides->recv_buffer_size_set == 0) ? base->recv_buffer_size : overrides->recv_buffer_size;
ps->io_buffer_size = (overrides->io_buffer_size_set == 0) ? base->io_buffer_size : overrides->io_buffer_size;
ps->error_override = (overrides->error_override_set == 0) ? base->error_override : overrides->error_override;
ps->preserve_host = (overrides->preserve_host_set == 0) ? base->preserve_host : overrides->preserve_host;
return ps;
return (void *) new;
return new;
char *r, *f, *scheme;
int port;
if (regex)
scheme[p-r] = 0;
if (q != NULL) {
if (regex)
if (regex) {
if (!reg)
return NULL;
char *r = NULL;
char *word;
while (*arg) {
f = word;
r = word;
if (!val) {
if (r == NULL)
if (!balancer) {
conf, r);
if (err)
if (err)
if (!worker) {
if (err)
if (err)
return NULL;
&proxy_module);
if ( r == NULL)
return NULL;
&proxy_module);
return NULL;
&proxy_module);
return NULL;
int found = 0;
if (!found) {
return NULL;
int *New;
return NULL;
int found = 0;
if (!found) {
#if DEBUGGING
#if DEBUGGING
#if DEBUGGING
#if DEBUGGING
return NULL;
return NULL;
const char *err;
if (flag) {
return NULL;
return NULL;
return NULL;
return NULL;
return NULL;
return NULL;
int timeout;
return NULL;
return NULL;
return NULL;
return NULL;
char *word;
while (*arg) {
if (!path)
else if (!name)
if (!val)
if (!path)
if (!name)
if (!worker) {
const char *err;
if (err)
if (!balancer) {
if (err)
return NULL;
const char *err;
if (!balancer) {
if (!worker) {
while (*arg) {
if (!val) {
if (worker)
if (err)
return NULL;
&proxy_module);
const char *errmsg;
return err;
if (!arg) {
return errmsg;
conf->r = r;
return NULL;
{NULL}
if (proxy_ssl_enable) {
if (proxy_ssl_disable) {
return proxy_ssl_disable(c);
worker++;
return OK;
return OK;
++worker;
++balancer;
return OK;
return OK;
#ifndef FIX_15207
#ifndef FIX_15207
request_rec *r,
request_rec *r,
(request_rec *r), (r),