diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2002-06-23 08:06:25 +0200 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2002-06-23 08:06:25 +0200 |
commit | f8511d81d82f1981f1ad10529eb4fc7f64253e46 (patch) | |
tree | ba19f2fd03b9ed0cf25172eb061fba7b247a17c4 /modules/proxy | |
parent | Simplify add_ssi_vars() and move the ssi/cgi vars into their respective (diff) | |
download | apache2-f8511d81d82f1981f1ad10529eb4fc7f64253e46.tar.xz apache2-f8511d81d82f1981f1ad10529eb4fc7f64253e46.zip |
No crutches, people!
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95854 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy')
-rw-r--r-- | modules/proxy/mod_proxy.c | 20 | ||||
-rw-r--r-- | modules/proxy/mod_proxy.h | 1 | ||||
-rw-r--r-- | modules/proxy/proxy_ftp.c | 22 | ||||
-rw-r--r-- | modules/proxy/proxy_http.c | 28 | ||||
-rw-r--r-- | modules/proxy/proxy_util.c | 12 |
5 files changed, 41 insertions, 42 deletions
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index e78415aae3..886e02ddc7 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -477,15 +477,15 @@ static int proxy_handler(request_rec *r) static void * create_proxy_config(apr_pool_t *p, server_rec *s) { - proxy_server_conf *ps = ap_pcalloc(p, sizeof(proxy_server_conf)); - - ps->sec_proxy = ap_make_array(p, 10, sizeof(ap_conf_vector_t *)); - ps->proxies = ap_make_array(p, 10, sizeof(struct proxy_remote)); - ps->aliases = ap_make_array(p, 10, sizeof(struct proxy_alias)); - ps->raliases = ap_make_array(p, 10, sizeof(struct proxy_alias)); - ps->noproxies = ap_make_array(p, 10, sizeof(struct noproxy_entry)); - ps->dirconn = ap_make_array(p, 10, sizeof(struct dirconn_entry)); - ps->allowed_connect_ports = ap_make_array(p, 10, sizeof(int)); + proxy_server_conf *ps = apr_pcalloc(p, sizeof(proxy_server_conf)); + + ps->sec_proxy = apr_array_make(p, 10, sizeof(ap_conf_vector_t *)); + ps->proxies = apr_array_make(p, 10, sizeof(struct proxy_remote)); + ps->aliases = apr_array_make(p, 10, sizeof(struct proxy_alias)); + ps->raliases = apr_array_make(p, 10, sizeof(struct proxy_alias)); + ps->noproxies = apr_array_make(p, 10, sizeof(struct noproxy_entry)); + ps->dirconn = apr_array_make(p, 10, sizeof(struct dirconn_entry)); + ps->allowed_connect_ports = apr_array_make(p, 10, sizeof(int)); ps->domain = NULL; ps->viaopt = via_off; /* initially backward compatible with 1.3.1 */ ps->viaopt_set = 0; /* 0 means default */ @@ -508,7 +508,7 @@ static void * create_proxy_config(apr_pool_t *p, server_rec *s) static void * merge_proxy_config(apr_pool_t *p, void *basev, void *overridesv) { - proxy_server_conf *ps = ap_pcalloc(p, sizeof(proxy_server_conf)); + proxy_server_conf *ps = apr_pcalloc(p, sizeof(proxy_server_conf)); proxy_server_conf *base = (proxy_server_conf *) basev; proxy_server_conf *overrides = (proxy_server_conf *) overridesv; diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index ec7899ec67..b986b31ed8 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -83,7 +83,6 @@ #include "apr_hooks.h" #include "apr.h" -#include "apr_compat.h" #include "apr_lib.h" #include "apr_strings.h" #include "apr_buckets.h" diff --git a/modules/proxy/proxy_ftp.c b/modules/proxy/proxy_ftp.c index fcd2fbd0f4..a4c77d3a41 100644 --- a/modules/proxy/proxy_ftp.c +++ b/modules/proxy/proxy_ftp.c @@ -93,7 +93,7 @@ static int decodeenc(char *x) for (i = 0, j = 0; x[i] != '\0'; i++, j++) { /* decode it if not already done */ ch = x[i]; - if (ch == '%' && ap_isxdigit(x[i + 1]) && ap_isxdigit(x[i + 2])) { + if (ch == '%' && apr_isxdigit(x[i + 1]) && apr_isxdigit(x[i + 2])) { ch = ap_proxy_hex2c(&x[i + 1]); i += 2; } @@ -153,7 +153,7 @@ static int ftp_check_string(const char *x) for (i = 0; x[i] != '\0'; i++) { ch = x[i]; - if (ch == '%' && ap_isxdigit(x[i + 1]) && ap_isxdigit(x[i + 2])) { + if (ch == '%' && apr_isxdigit(x[i + 1]) && apr_isxdigit(x[i + 2])) { ch = ap_proxy_hex2c(&x[i + 1]); i += 2; } @@ -643,7 +643,7 @@ proxy_ftp_command(const char *cmd, request_rec *r, conn_rec *ftp_ctrl, ap_pass_brigade(ftp_ctrl->output_filters, bb); /* strip off the CRLF for logging */ - ap_cpystrn(message, cmd, sizeof message); + apr_cpystrn(message, cmd, sizeof(message)); if ((crlf = strchr(message, '\r')) != NULL || (crlf = strchr(message, '\n')) != NULL) *crlf = '\0'; @@ -663,7 +663,7 @@ proxy_ftp_command(const char *cmd, request_rec *r, conn_rec *ftp_ctrl, "proxy:<FTP: %3.3u %s", rc, message); if (pmessage != NULL) - *pmessage = ap_pstrdup(r->pool, message); + *pmessage = apr_pstrdup(r->pool, message); return rc; } @@ -807,7 +807,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, /* stuff for PASV mode */ int connect = 0, use_port = 0; - char dates[AP_RFC822_DATE_LEN]; + char dates[APR_RFC822_DATE_LEN]; /* is this for us? */ if (proxyhost) { @@ -826,7 +826,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, /* create space for state information */ backend = (proxy_conn_rec *) ap_get_module_config(c->conn_config, &proxy_ftp_module); if (!backend) { - backend = ap_pcalloc(c->pool, sizeof(proxy_conn_rec)); + backend = apr_pcalloc(c->pool, sizeof(proxy_conn_rec)); backend->connection = NULL; backend->hostname = NULL; backend->port = 0; @@ -860,12 +860,12 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, *(type_suffix++) = '\0'; if (type_suffix != NULL && strncmp(type_suffix, "type=", 5) == 0 - && ap_isalpha(type_suffix[5])) { + && apr_isalpha(type_suffix[5])) { /* "type=d" forces a dir listing. * The other types (i|a|e) are directly used for the ftp TYPE command */ - if ( ! (dirlisting = (ap_tolower(type_suffix[5]) == 'd'))) - xfer_type = ap_toupper(type_suffix[5]); + if ( ! (dirlisting = (apr_tolower(type_suffix[5]) == 'd'))) + xfer_type = apr_toupper(type_suffix[5]); /* Check valid types, rather than ignoring invalid types silently: */ if (strchr("AEI", xfer_type) == NULL) @@ -1091,8 +1091,8 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, break; if (*secs_str != '\0') { secs = atol(secs_str); - ap_table_add(r->headers_out, "Retry-After", - apr_psprintf(p, "%lu", (unsigned long)(60 * secs))); + apr_table_add(r->headers_out, "Retry-After", + apr_psprintf(p, "%lu", (unsigned long)(60 * secs))); } return ap_proxyerror(r, HTTP_SERVICE_UNAVAILABLE, ftpmessage); } diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index b460028dd1..7de23e75ef 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -779,19 +779,19 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, /* handle Via header in response */ if (conf->viaopt != via_off && conf->viaopt != via_block) { /* create a "Via:" response header entry and merge it */ - ap_table_mergen(r->headers_out, "Via", - (conf->viaopt == via_full) - ? apr_psprintf(p, "%d.%d %s%s (%s)", - HTTP_VERSION_MAJOR(r->proto_num), - HTTP_VERSION_MINOR(r->proto_num), - ap_get_server_name(r), - server_portstr, - AP_SERVER_BASEVERSION) - : apr_psprintf(p, "%d.%d %s%s", - HTTP_VERSION_MAJOR(r->proto_num), - HTTP_VERSION_MINOR(r->proto_num), - ap_get_server_name(r), - server_portstr) + apr_table_mergen(r->headers_out, "Via", + (conf->viaopt == via_full) + ? apr_psprintf(p, "%d.%d %s%s (%s)", + HTTP_VERSION_MAJOR(r->proto_num), + HTTP_VERSION_MINOR(r->proto_num), + ap_get_server_name(r), + server_portstr, + AP_SERVER_BASEVERSION) + : apr_psprintf(p, "%d.%d %s%s", + HTTP_VERSION_MAJOR(r->proto_num), + HTTP_VERSION_MINOR(r->proto_num), + ap_get_server_name(r), + server_portstr) ); } @@ -1050,7 +1050,7 @@ int ap_proxy_http_handler(request_rec *r, proxy_server_conf *conf, } /* create space for state information */ if (!backend) { - backend = ap_pcalloc(c->pool, sizeof(proxy_conn_rec)); + backend = apr_pcalloc(c->pool, sizeof(proxy_conn_rec)); backend->connection = NULL; backend->hostname = NULL; backend->port = 0; diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 0914ee1ecb..5ba48f21bb 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -204,7 +204,7 @@ PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, en } /* decode it if not already done */ if (isenc && ch == '%') { - if (!ap_isxdigit(x[i + 1]) || !ap_isxdigit(x[i + 2])) + if (!apr_isxdigit(x[i + 1]) || !apr_isxdigit(x[i + 2])) return NULL; ch = ap_proxy_hex2c(&x[i + 1]); i += 2; @@ -370,7 +370,7 @@ PROXY_DECLARE(const char *) &min, &sec, &year) != 7) return x; for (wk = 0; wk < 7; wk++) - if (strcmp(week, ap_day_snames[wk]) == 0) + if (strcmp(week, apr_day_snames[wk]) == 0) break; if (wk == 7) return x; @@ -378,14 +378,14 @@ PROXY_DECLARE(const char *) /* check date */ for (mon = 0; mon < 12; mon++) - if (strcmp(month, ap_month_snames[mon]) == 0) + if (strcmp(month, apr_month_snames[mon]) == 0) break; if (mon == 12) return x; q = apr_palloc(p, 30); - apr_snprintf(q, 30, "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", ap_day_snames[wk], - mday, ap_month_snames[mon], year, hour, min, sec); + apr_snprintf(q, 30, "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", apr_day_snames[wk], + mday, apr_month_snames[mon], year, hour, min, sec); return q; } @@ -434,7 +434,7 @@ PROXY_DECLARE(apr_table_t *)ap_proxy_read_headers(request_rec *r, request_rec *r char *value, *end; char field[MAX_STRING_LEN]; - headers_out = ap_make_table(r->pool, 20); + headers_out = apr_table_make(r->pool, 20); /* * Read header lines until we get the empty separator line, a read error, |