proxy_util.c revision 14c8c18e6caab1bdeb0f26b2b031e000fef58ef9
be7261704c274bf3e012acf8d3c45602c705d820brian/* Licensed to the Apache Software Foundation (ASF) under one or more
be7261704c274bf3e012acf8d3c45602c705d820brian * contributor license agreements. See the NOTICE file distributed with
be7261704c274bf3e012acf8d3c45602c705d820brian * this work for additional information regarding copyright ownership.
be7261704c274bf3e012acf8d3c45602c705d820brian * The ASF licenses this file to You under the Apache License, Version 2.0
be7261704c274bf3e012acf8d3c45602c705d820brian * (the "License"); you may not use this file except in compliance with
be7261704c274bf3e012acf8d3c45602c705d820brian * the License. You may obtain a copy of the License at
be7261704c274bf3e012acf8d3c45602c705d820brian * Unless required by applicable law or agreed to in writing, software
be7261704c274bf3e012acf8d3c45602c705d820brian * distributed under the License is distributed on an "AS IS" BASIS,
be7261704c274bf3e012acf8d3c45602c705d820brian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
be7261704c274bf3e012acf8d3c45602c705d820brian * See the License for the specific language governing permissions and
be7261704c274bf3e012acf8d3c45602c705d820brian * limitations under the License.
#include "mod_proxy.h"
#include "ap_mpm.h"
#include "scoreboard.h"
#include "apr_version.h"
#include "apr_hash.h"
} forward_info;
static int lb_workers_limit = 0;
#if !APR_CHARSET_EBCDIC
int ch = x[0];
return buf[0];
#if !APR_CHARSET_EBCDIC
int proxyreq)
int i, j, ch;
if (t == enc_path) {
else if (t == enc_search) {
else if (t == enc_user) {
else if (t == enc_fpath) {
if (t == enc_path) {
else if (t == enc_search) {
for (i = 0, j = 0; i < len; i++, j++) {
ch = x[i];
y[j] = ch;
return NULL;
y[j] = ch;
PROXY_DECLARE(char *)
return NULL;
PROXY_DECLARE(const char *)
char* ndate;
if (!time) {
return date;
return date;
return ndate;
return rp;
int len, i;
if (p != NULL) {
i = p - list;
} while (apr_isspace(*p));
list = p;
int len, i;
if (p != NULL) {
i = p - list;
} while (apr_isspace(*p));
if (new) {
list = p;
return new;
int i, ch;
ch = x[i];
int i, ch;
return statuscode;
return r->hostname;
return NULL;
url = apr_pstrdup(r->pool, &url[1]); /* make it point to "//", which is what proxy_canon_netloc expects */
int i, quads;
long bits;
char *tmp;
char *tmp;
++addr;
--quads;
/* "IP Address should be given in dotted-quad form, optionally followed by a netmask (e.g., 192.168.111.0/24)"; */
#if DEBUGGING
#if DEBUGGING
!= APR_SUCCESS) {
#if DEBUGGING
while (reqaddr) {
#if DEBUGGING
#if DEBUGGING
--d_len;
--h_len;
int h2_len;
int h1_len;
while (addr) {
--h2_len;
--h1_len;
return HTTP_FORBIDDEN;
while (conf_addr) {
while (uri_addr) {
char *conf_ip;
char *uri_ip;
return HTTP_FORBIDDEN;
return OK;
return OK;
* ap_rgetline() in protocol.c. Deprecate this function and use ap_rgetline()
apr_bucket *e;
char *response;
int found = 0;
buff[0] = 0;
*eos = 0;
while (!found) {
return rv;
while (!found) {
return APR_ECONNABORTED;
if (APR_BUCKET_IS_EOS(e)) {
(const char **)&response,
&len,
APR_BLOCK_READ))) {
return rv;
if (len > 0) {
return APR_SUCCESS;
if (!initial) {
count++;
return url;
int n, l3 = 0;
if (urlpart) {
* BalancerMember balancer://alias http://example.com/foo
* translate url http://example.com/foo/bar/that to /bash/that
if (urlpart) {
--l2;
NULL);
worker++;
if (part) {
if (part) {
return url;
&proxy_module);
const char *pathp;
const char *domainp;
int ddiff = 0;
int pdiff = 0;
char *ret;
return str;
if (newpath) {
if (newdomain) {
if (newdomain) {
return ret;
const char *url)
return NULL;
return balancer;
balancer++;
return NULL;
const char *url)
if (!lbmethod) {
return NULL;
return APR_SUCCESS;
return APR_SUCCESS;
if (conn->r) {
return APR_SUCCESS;
apr_pool_clear(p);
return APR_SUCCESS;
request_rec *r)
return APR_SUCCESS;
return APR_SUCCESS;
return APR_SUCCESS;
const char *url)
int max_match = 0;
int url_length;
int min_match;
int worker_name_length;
char *url_copy;
return NULL;
char *pathstart;
if (balancer) {
return max_worker;
const char *url)
int rv;
* ProxyPass / http://www.example.com
if (balancer) {
} else if (conf) {
return NULL;
PROXY_DECLARE(apr_status_t) ap_proxy_share_worker(proxy_worker *worker, proxy_worker_shared *shm, int i)
return APR_EINVAL;
return APR_SUCCESS;
PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, server_rec *s, apr_pool_t *p)
int mpm_threads;
return APR_EGENERAL;
return rv;
void *conn;
return rv;
server_rec *s)
return OK;
return DECLINED;
return OK;
request_rec *r,
int access_status;
if (*worker) {
*url);
*url);
*url);
return access_status;
request_rec *r,
if (balancer) {
return access_status;
const char *proxy_function,
const char *backend_name,
request_rec *r)
int connected = 0;
int loglevel;
server_rec *s)
return HTTP_SERVICE_UNAVAILABLE;
return HTTP_SERVICE_UNAVAILABLE;
return OK;
server_rec *s)
return OK;
PROXY_DECLARE(int)
char **url,
const char *proxyname,
char *server_portstr,
int server_portstr_size)
int server_port;
NULL));
if (!proxyname) {
if (proxyname) {
const char *proxy_auth;
return HTTP_INTERNAL_SERVER_ERROR;
return OK;
server_rec *s)
int status;
int complete = 0;
int len = 0;
if (!complete) {
buffer);
code_str);
return(status);
server_rec *s)
int connected = 0;
int loglevel;
conn_rec *c,
server_rec *s)
int rc;
return OK;
0, NULL,
return HTTP_INTERNAL_SERVER_ERROR;
return HTTP_INTERNAL_SERVER_ERROR;
return rc;
return OK;
int ap_proxy_lb_workers(void)
if (!lb_workers_limit)
return lb_workers_limit;
apr_bucket *e;
if (r->main)
c->bucket_alloc);
apr_bucket *e;
const char *data;
e = APR_BUCKET_NEXT(e)) {
if (!APR_BUCKET_IS_METADATA(e)) {
else if (APR_BUCKET_IS_FLUSH(e)) {
else if (APR_BUCKET_IS_EOS(e)) {
return rv;
PROXY_DECLARE(unsigned int)
unsigned int hash;
return hash;
unsigned int hash;
return hash;