]> granicus.if.org Git - apache/commitdiff
Move ProxyFtpDirCharset from mod_proxy to mod_proxy_ftp.
authorTakashi Sato <takashi@apache.org>
Wed, 30 Dec 2009 00:51:46 +0000 (00:51 +0000)
committerTakashi Sato <takashi@apache.org>
Wed, 30 Dec 2009 00:51:46 +0000 (00:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@894526 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/mod_proxy.xml
docs/manual/mod/mod_proxy_ftp.xml
include/ap_mmn.h
modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h
modules/proxy/mod_proxy_ftp.c

diff --git a/CHANGES b/CHANGES
index b547de54dfa1cd53ae7cc7cd2dc890f42bffa946..5a71ddcac88e778bca1c7b533d1d79585f7ce001 100644 (file)
--- 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]
 
index bff8168c0b0fc4c7903d4905401073cf48e241cf..16c539cbc42b2dfc33d6c76e31ff96532efb3e4f 100644 (file)
@@ -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 
index b9f7d95a23a9305fdecb33784c470126f9b352f7..9c2e012f52a08b0c351426284c6fc13c6c7ec66e 100644 (file)
 </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>
index 63c9ff44302915cb32f06a78bdf468c8fab543c0..b6813f0ee47dbe9a1e1115ea5e00779c12b1a427 100644 (file)
  * 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 */
 
index fd7431d0ec3349d71bf484494e5841fd7d0bde80..6668736880bbd8df55c0715af42f261a8628b2a2 100644 (file)
@@ -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}
 };
 
index 0dee2402b901dda421f1b55a13808604e70ceef5..066a307c89befb28faec767e387beab34ced2e1a 100644 (file)
@@ -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;
index b56d0002aa8f1ee9c05f78deccfb5a32ddfaf955..10b434c3f9e71a40e491e1a15bb711c806a6042f 100644 (file)
@@ -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}
 };