proxy_util.c revision dbf39e55f7360fb7250cf2438dd93c637dedfcf1
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich/* Licensed to the Apache Software Foundation (ASF) under one or more
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich * contributor license agreements. See the NOTICE file distributed with
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich * this work for additional information regarding copyright ownership.
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich * The ASF licenses this file to You under the Apache License, Version 2.0
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich * (the "License"); you may not use this file except in compliance with
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich * the License. You may obtain a copy of the License at
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich * Unless required by applicable law or agreed to in writing, software
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich * distributed under the License is distributed on an "AS IS" BASIS,
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich * See the License for the specific language governing permissions and
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich * limitations under the License.
224d2b804fd6f92d9d553a3d6fe54dd14a73dde2Klaus Luettich/* Utility routines for Apache proxy */
} 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;
apr_pool_t *p,
const char *url)
if (!lbmethod) {
#if APR_HAS_THREADS
return NULL;
const char *url)
int max_match = 0;
int url_length;
int min_match;
int worker_name_length;
char *url_copy;
return NULL;
char *pathstart;
worker++;
return max_worker;
#if APR_HAS_THREADS
return APR_SUCCESS;
apr_pool_t *p,
const char *url,
int id)
int rv;
if (id < 0) {
return NULL;
apr_pool_t *p,
const char *url)
if (id < 0) {
return worker;
PROXY_DECLARE(void)
if (id < 0) {
PROXY_DECLARE(void)
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;
return APR_SUCCESS;
#if APR_HAS_THREADS
return APR_SUCCESS;
apr_pool_clear(p);
#if APR_HAS_THREADS
return APR_SUCCESS;
request_rec *r)
return APR_SUCCESS;
#if APR_HAS_THREADS
return APR_SUCCESS;
return APR_SUCCESS;
server_rec *s)
if (!worker->s) {
if (ap_scoreboard_image) {
if (!score) {
if (!score) {
PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, server_rec *s, apr_pool_t *p)
#if APR_HAS_THREADS
int mpm_threads;
return APR_SUCCESS;
return APR_EGENERAL;
#if APR_HAS_THREADS
return rv;
#if (APR_MAJOR_VERSION > 0)
void *conn;
return rv;
server_rec *s)
return OK;
return DECLINED;
return OK;
server_rec *s)
return HTTP_SERVICE_UNAVAILABLE;
#if APR_HAS_THREADS
return HTTP_SERVICE_UNAVAILABLE;
#if APR_HAS_THREADS
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,
c->bucket_alloc);
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);
PROXY_DECLARE(unsigned int)
unsigned int hash;
return hash;
unsigned int hash;
return hash;