]> granicus.if.org Git - apache/commitdiff
No crutches, people!
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 23 Jun 2002 06:06:25 +0000 (06:06 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 23 Jun 2002 06:06:25 +0000 (06:06 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95854 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h
modules/proxy/proxy_ftp.c
modules/proxy/proxy_http.c
modules/proxy/proxy_util.c

index e78415aae341127e7003a401e94890a73dfeaa83..886e02ddc783feea0d1b33faa398c08e2f0abf3a 100644 (file)
@@ -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;
 
index ec7899ec67383e17f53dbce66048e43c919f1ff1..b986b31ed8cdacf34f3c2b10158b92800fe37f51 100644 (file)
@@ -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"
index fcd2fbd0f4f4812443ffb0777f57a58627c26301..a4c77d3a41d1de562743f403f35bd7c5d47a081b 100644 (file)
@@ -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);
     }
index b460028dd1234231a783ff7c6d1a6535c6fe7e39..7de23e75ef2c4442c33e17b433210a9df0392727 100644 (file)
@@ -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;
index 0914ee1ecb7f6be5f21c7b3fa77d00bf9d435163..5ba48f21bba1878d62d361c665743ce12781cc5c 100644 (file)
@@ -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,