1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

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
This commit is contained in:
Takashi Sato
2009-12-30 00:51:46 +00:00
parent 6902a7ea7f
commit 92cf9b940e
7 changed files with 38 additions and 38 deletions

View File

@@ -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]

View 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

View File

@@ -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>

View File

@@ -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 */

View 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}
};

View 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;

View 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}
};