httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r608191 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS docs/manual/mod/mod_proxy.xml include/ap_mmn.h modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h modules/proxy/mod_proxy_ftp.c
Date Wed, 02 Jan 2008 19:25:09 GMT
Author: jim
Date: Wed Jan  2 11:25:08 2008
New Revision: 608191

URL: http://svn.apache.org/viewvc?rev=608191&view=rev
Log:
Add ProxyFtpDirCharset directive:

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml
    httpd/httpd/branches/2.2.x/include/ap_mmn.h
    httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c
    httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h
    httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_ftp.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=608191&r1=608190&r2=608191&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Wed Jan  2 11:25:08 2008
@@ -19,6 +19,10 @@
      mod_imagemap: Fix a cross-site scripting issue.  Reported by JPCERT.
      [Joe Orton]
 
+  *) Introduce the ProxyFtpDirCharset directive, allowing the administrator
+     to identify a default, or specific servers or paths which list their
+     contents in other-than ISO-8859-1 charset (e.g. utf-8). [Ruediger Pluem]
+
   *) mod_dav: Adjust etag generation to produce identical results on 32-bit
      and 64-bit platforms and avoid a regression with conditional PUT's on lock
      and etag. PR 44152.

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=608191&r1=608190&r2=608191&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Wed Jan  2 11:25:08 2008
@@ -107,17 +107,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  * mod_proxy_ftp: Introduce the ProxyFtpDirCharset directive, allowing
-    the administrator to identify a default, or specific servers or paths
-    which list their contents in other-than ISO-8859-1 charset (e.g. utf-8).
-    [Ruediger Pluem]
-      trunk version; http://svn.apache.org/viewvc?view=rev&revision=607638
-      backport;
-        http://people.apache.org/~wrowe/mod_proxy_ftp_dir_listing-2.2.diff
-      +1: wrowe, rpluem, jim
-      -0: niq: I dislike this patch for reasons stated on-list, but it
-               delivers the functionality needed for the charset "showstopper".
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]

Modified: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml?rev=608191&r1=608190&r2=608191&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml (original)
+++ httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml Wed Jan  2 11:25:08 2008
@@ -369,6 +369,22 @@
 </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 

Modified: httpd/httpd/branches/2.2.x/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/include/ap_mmn.h?rev=608191&r1=608190&r2=608191&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/include/ap_mmn.h (original)
+++ httpd/httpd/branches/2.2.x/include/ap_mmn.h Wed Jan  2 11:25:08 2008
@@ -119,6 +119,7 @@
  * 20051115.8 (2.2.7)  Added flags to proxy_alias (minor)
  * 20051115.9 (2.2.7)  Add ap_send_interim_response API
  * 20051115.10(2.2.7)  Added ap_mod_status_reqtail (minor)
+ * 20051115.11(2.2.7)  Add *ftp_directory_charset to proxy_dir_conf
  *
  */
 
@@ -127,7 +128,7 @@
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20051115
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 10                    /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 11                    /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a

Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c?rev=608191&r1=608190&r2=608191&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c Wed Jan  2 11:25:08 2008
@@ -1024,6 +1024,9 @@
         = apr_array_append(p, base->cookie_domains, add->cookie_domains);
     new->cookie_path_str = base->cookie_path_str;
     new->cookie_domain_str = base->cookie_domain_str;
+    new->ftp_directory_charset = add->ftp_directory_charset ?
+                                 add->ftp_directory_charset :
+                                 base->ftp_directory_charset;
     return new;
 }
 
@@ -1724,6 +1727,15 @@
     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,
@@ -1931,6 +1943,8 @@
      "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}
 };
 

Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h?rev=608191&r1=608190&r2=608191&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h Wed Jan  2 11:25:08 2008
@@ -212,6 +212,7 @@
     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;
 } proxy_dir_conf;
 
 typedef struct {

Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_ftp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_ftp.c?rev=608191&r1=608190&r2=608191&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_ftp.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_ftp.c Wed Jan  2 11:25:08 2008
@@ -1690,7 +1690,13 @@
 
     /* set content-type */
     if (dirlisting) {
-        ap_set_content_type(r, "text/html");
+        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 :
+                                           "ISO-8859-1",  NULL));
     }
     else {
         if (r->content_type) {



Mime
View raw message