summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sato <takashi@apache.org>2009-12-30 01:51:46 +0100
committerTakashi Sato <takashi@apache.org>2009-12-30 01:51:46 +0100
commit92cf9b940e7d2941cd79b32bc3656ead5ffc4aa8 (patch)
tree1b6a7dc4a5039a6f0d1471915128ce54b90d3a35
parentfollow up r894425: (diff)
downloadapache2-92cf9b940e7d2941cd79b32bc3656ead5ffc4aa8.tar.xz
apache2-92cf9b940e7d2941cd79b32bc3656ead5ffc4aa8.zip
Move ProxyFtpDirCharset from mod_proxy to mod_proxy_ftp.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@894526 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES3
-rw-r--r--docs/manual/mod/mod_proxy.xml16
-rw-r--r--docs/manual/mod/mod_proxy_ftp.xml15
-rw-r--r--include/ap_mmn.h4
-rw-r--r--modules/proxy/mod_proxy.c14
-rw-r--r--modules/proxy/mod_proxy.h1
-rw-r--r--modules/proxy/mod_proxy_ftp.c23
7 files changed, 38 insertions, 38 deletions
diff --git a/CHANGES b/CHANGES
index b547de54df..5a71ddcac8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
Changes with Apache 2.3.5
+ *) mod_proxy, mod_proxy_ftp: Move ProxyFtpDirCharset from mod_proxy to
+ mod_proxy_ftp. [Takashi Sato]
+
*) mod_proxy, mod_proxy_connect: Move AllowCONNECT from mod_proxy to
mod_proxy_connect. [Takashi Sato]
diff --git a/docs/manual/mod/mod_proxy.xml b/docs/manual/mod/mod_proxy.xml
index bff8168c0b..16c539cbc4 100644
--- a/docs/manual/mod/mod_proxy.xml
+++ b/docs/manual/mod/mod_proxy.xml
@@ -374,22 +374,6 @@ response</description>
</usage>
</directivesynopsis>
-<directivesynopsis>
-<name>ProxyFtpDirCharset</name>
-<description>Define the character set for proxied FTP listings</description>
-<syntax>ProxyFtpDirCharset <var>character set</var></syntax>
-<default>ProxyFtpDirCharset ISO-8859-1</default>
-<contextlist><context>server config</context><context>virtual host</context>
-<context>directory</context></contextlist>
-<compatibility>Available in Apache 2.2.7 and later</compatibility>
-
-<usage>
- <p>The <directive>ProxyFtpDirCharset</directive> directive defines the
- character set to be set for FTP directory listings in HTML generated by
- <module>mod_proxy_ftp</module>.</p>
-</usage>
-</directivesynopsis>
-
<directivesynopsis type="section">
<name>ProxyMatch</name>
<description>Container for directives applied to regular-expression-matched
diff --git a/docs/manual/mod/mod_proxy_ftp.xml b/docs/manual/mod/mod_proxy_ftp.xml
index b9f7d95a23..9c2e012f52 100644
--- a/docs/manual/mod/mod_proxy_ftp.xml
+++ b/docs/manual/mod/mod_proxy_ftp.xml
@@ -196,5 +196,20 @@
</usage>
</directivesynopsis>
+<directivesynopsis>
+<name>ProxyFtpDirCharset</name>
+<description>Define the character set for proxied FTP listings</description>
+<syntax>ProxyFtpDirCharset <var>character set</var></syntax>
+<default>ProxyFtpDirCharset ISO-8859-1</default>
+<contextlist><context>server config</context><context>virtual host</context>
+<context>directory</context></contextlist>
+<compatibility>Available in Apache 2.2.7 and later. Moved from <module>mod_proxy</module> in Apache 2.3.5.</compatibility>
+
+<usage>
+ <p>The <directive>ProxyFtpDirCharset</directive> directive defines the
+ character set to be set for FTP directory listings in HTML generated by
+ <module>mod_proxy_ftp</module>.</p>
+</usage>
+</directivesynopsis>
</modulesynopsis>
diff --git a/include/ap_mmn.h b/include/ap_mmn.h
index 63c9ff4430..b6813f0ee4 100644
--- a/include/ap_mmn.h
+++ b/include/ap_mmn.h
@@ -208,13 +208,15 @@
* 20091119.1 (2.3.4-dev) ap_mutex_register(), ap_{proc,global}_mutex_create()
* 20091229.0 (2.3.5-dev) Move allowed_connect_ports from proxy_server_conf
* to mod_proxy_connect
+ * 20091230.0 (2.3.5-dev) Move ftp_directory_charset from proxy_dir_conf
+ * to proxy_ftp_dir_conf(mod_proxy_ftp)
*
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20091229
+#define MODULE_MAGIC_NUMBER_MAJOR 20091230
#endif
#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c
index fd7431d0ec..6668736880 100644
--- a/modules/proxy/mod_proxy.c
+++ b/modules/proxy/mod_proxy.c
@@ -1190,9 +1190,6 @@ static void *merge_proxy_dir_config(apr_pool_t *p, void *basev, void *addv)
new->cookie_domain_str = base->cookie_domain_str;
new->interpolate_env = (add->interpolate_env == -1) ? base->interpolate_env
: add->interpolate_env;
- new->ftp_directory_charset = add->ftp_directory_charset ?
- add->ftp_directory_charset :
- base->ftp_directory_charset;
new->preserve_host = (add->preserve_host_set == 0) ? base->preserve_host
: add->preserve_host;
new->preserve_host_set = add->preserve_host_set || base->preserve_host_set;
@@ -1890,15 +1887,6 @@ static const char *
return NULL;
}
-static const char *set_ftp_directory_charset(cmd_parms *cmd, void *dconf,
- const char *arg)
-{
- proxy_dir_conf *conf = dconf;
-
- conf->ftp_directory_charset = arg;
- return NULL;
-}
-
static void ap_add_per_proxy_conf(server_rec *s, ap_conf_vector_t *dir_config)
{
proxy_server_conf *sconf = ap_get_module_config(s->module_config,
@@ -2106,8 +2094,6 @@ static const command_rec proxy_cmds[] =
"Configure Status: proxy status to one of: on | off | full"),
AP_INIT_RAW_ARGS("ProxySet", set_proxy_param, NULL, RSRC_CONF|ACCESS_CONF,
"A balancer or worker name with list of params"),
- AP_INIT_TAKE1("ProxyFtpDirCharset", set_ftp_directory_charset, NULL,
- RSRC_CONF|ACCESS_CONF, "Define the character set for proxied FTP listings"),
{NULL}
};
diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h
index 0dee2402b9..066a307c89 100644
--- a/modules/proxy/mod_proxy.h
+++ b/modules/proxy/mod_proxy.h
@@ -198,7 +198,6 @@ typedef struct {
apr_array_header_t* cookie_domains;
const apr_strmatch_pattern* cookie_path_str;
const apr_strmatch_pattern* cookie_domain_str;
- const char *ftp_directory_charset;
int interpolate_env;
int preserve_host;
int preserve_host_set;
diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c
index b56d0002aa..10b434c3f9 100644
--- a/modules/proxy/mod_proxy_ftp.c
+++ b/modules/proxy/mod_proxy_ftp.c
@@ -42,6 +42,7 @@ typedef struct {
int ftp_list_on_wildcard_set;
int ftp_escape_wildcards;
int ftp_escape_wildcards_set;
+ const char *ftp_directory_charset;
} proxy_ftp_dir_conf;
static void *create_proxy_ftp_dir_config(apr_pool_t *p, char *dummy)
@@ -75,7 +76,9 @@ static void *merge_proxy_ftp_dir_config(apr_pool_t *p, void *basev, void *addv)
new->ftp_escape_wildcards_set = add->ftp_escape_wildcards_set ?
1 :
base->ftp_escape_wildcards_set;
-
+ new->ftp_directory_charset = add->ftp_directory_charset ?
+ add->ftp_directory_charset :
+ base->ftp_directory_charset;
return new;
}
@@ -99,6 +102,15 @@ static const char *set_ftp_escape_wildcards(cmd_parms *cmd, void *dconf,
return NULL;
}
+static const char *set_ftp_directory_charset(cmd_parms *cmd, void *dconf,
+ const char *arg)
+{
+ proxy_ftp_dir_conf *conf = dconf;
+
+ conf->ftp_directory_charset = arg;
+ return NULL;
+}
+
/*
* Decodes a '%' escaped string, and returns the number of characters
*/
@@ -1785,12 +1797,9 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker,
/* set content-type */
if (dirlisting) {
- proxy_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
- &proxy_module);
-
ap_set_content_type(r, apr_pstrcat(p, "text/html;charset=",
- dconf->ftp_directory_charset ?
- dconf->ftp_directory_charset :
+ fdconf->ftp_directory_charset ?
+ fdconf->ftp_directory_charset :
"ISO-8859-1", NULL));
}
else {
@@ -2013,6 +2022,8 @@ static const command_rec proxy_ftp_cmds[] =
RSRC_CONF|ACCESS_CONF, "Whether wildcard characters in a path cause mod_proxy_ftp to list the files instead of trying to get them. Defaults to on."),
AP_INIT_FLAG("ProxyFtpEscapeWildcards", set_ftp_escape_wildcards, NULL,
RSRC_CONF|ACCESS_CONF, "Whether the proxy should escape wildcards in paths before sending them to the FTP server. Defaults to on, but most FTP servers will need it turned off if you need to manage paths that contain wildcard characters."),
+ AP_INIT_TAKE1("ProxyFtpDirCharset", set_ftp_directory_charset, NULL,
+ RSRC_CONF|ACCESS_CONF, "Define the character set for proxied FTP listings"),
{NULL}
};