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 */
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;
#include "apr_hooks.h"
#include "apr.h"
-#include "apr_compat.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_buckets.h"
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;
}
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;
}
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';
"proxy:<FTP: %3.3u %s", rc, message);
if (pmessage != NULL)
- *pmessage = ap_pstrdup(r->pool, message);
+ *pmessage = apr_pstrdup(r->pool, message);
return rc;
}
/* 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) {
/* 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;
*(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)
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);
}
/* 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)
);
}
}
/* 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;
}
/* 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;
&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;
/* 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;
}
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,