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:
3
CHANGES
3
CHANGES
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
Changes with Apache 2.3.5
|
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, mod_proxy_connect: Move AllowCONNECT from mod_proxy to
|
||||||
mod_proxy_connect. [Takashi Sato]
|
mod_proxy_connect. [Takashi Sato]
|
||||||
|
|
||||||
|
@@ -374,22 +374,6 @@ response</description>
|
|||||||
</usage>
|
</usage>
|
||||||
</directivesynopsis>
|
</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">
|
<directivesynopsis type="section">
|
||||||
<name>ProxyMatch</name>
|
<name>ProxyMatch</name>
|
||||||
<description>Container for directives applied to regular-expression-matched
|
<description>Container for directives applied to regular-expression-matched
|
||||||
|
@@ -196,5 +196,20 @@
|
|||||||
</usage>
|
</usage>
|
||||||
</directivesynopsis>
|
</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>
|
</modulesynopsis>
|
||||||
|
@@ -208,13 +208,15 @@
|
|||||||
* 20091119.1 (2.3.4-dev) ap_mutex_register(), ap_{proc,global}_mutex_create()
|
* 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
|
* 20091229.0 (2.3.5-dev) Move allowed_connect_ports from proxy_server_conf
|
||||||
* to mod_proxy_connect
|
* 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" */
|
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
|
||||||
|
|
||||||
#ifndef MODULE_MAGIC_NUMBER_MAJOR
|
#ifndef MODULE_MAGIC_NUMBER_MAJOR
|
||||||
#define MODULE_MAGIC_NUMBER_MAJOR 20091229
|
#define MODULE_MAGIC_NUMBER_MAJOR 20091230
|
||||||
#endif
|
#endif
|
||||||
#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */
|
#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */
|
||||||
|
|
||||||
|
@@ -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->cookie_domain_str = base->cookie_domain_str;
|
||||||
new->interpolate_env = (add->interpolate_env == -1) ? base->interpolate_env
|
new->interpolate_env = (add->interpolate_env == -1) ? base->interpolate_env
|
||||||
: add->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
|
new->preserve_host = (add->preserve_host_set == 0) ? base->preserve_host
|
||||||
: add->preserve_host;
|
: add->preserve_host;
|
||||||
new->preserve_host_set = add->preserve_host_set || base->preserve_host_set;
|
new->preserve_host_set = add->preserve_host_set || base->preserve_host_set;
|
||||||
@@ -1890,15 +1887,6 @@ static const char *
|
|||||||
return NULL;
|
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)
|
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,
|
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"),
|
"Configure Status: proxy status to one of: on | off | full"),
|
||||||
AP_INIT_RAW_ARGS("ProxySet", set_proxy_param, NULL, RSRC_CONF|ACCESS_CONF,
|
AP_INIT_RAW_ARGS("ProxySet", set_proxy_param, NULL, RSRC_CONF|ACCESS_CONF,
|
||||||
"A balancer or worker name with list of params"),
|
"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}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -198,7 +198,6 @@ typedef struct {
|
|||||||
apr_array_header_t* cookie_domains;
|
apr_array_header_t* cookie_domains;
|
||||||
const apr_strmatch_pattern* cookie_path_str;
|
const apr_strmatch_pattern* cookie_path_str;
|
||||||
const apr_strmatch_pattern* cookie_domain_str;
|
const apr_strmatch_pattern* cookie_domain_str;
|
||||||
const char *ftp_directory_charset;
|
|
||||||
int interpolate_env;
|
int interpolate_env;
|
||||||
int preserve_host;
|
int preserve_host;
|
||||||
int preserve_host_set;
|
int preserve_host_set;
|
||||||
|
@@ -42,6 +42,7 @@ typedef struct {
|
|||||||
int ftp_list_on_wildcard_set;
|
int ftp_list_on_wildcard_set;
|
||||||
int ftp_escape_wildcards;
|
int ftp_escape_wildcards;
|
||||||
int ftp_escape_wildcards_set;
|
int ftp_escape_wildcards_set;
|
||||||
|
const char *ftp_directory_charset;
|
||||||
} proxy_ftp_dir_conf;
|
} proxy_ftp_dir_conf;
|
||||||
|
|
||||||
static void *create_proxy_ftp_dir_config(apr_pool_t *p, char *dummy)
|
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 ?
|
new->ftp_escape_wildcards_set = add->ftp_escape_wildcards_set ?
|
||||||
1 :
|
1 :
|
||||||
base->ftp_escape_wildcards_set;
|
base->ftp_escape_wildcards_set;
|
||||||
|
new->ftp_directory_charset = add->ftp_directory_charset ?
|
||||||
|
add->ftp_directory_charset :
|
||||||
|
base->ftp_directory_charset;
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,6 +102,15 @@ static const char *set_ftp_escape_wildcards(cmd_parms *cmd, void *dconf,
|
|||||||
return NULL;
|
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
|
* 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 */
|
/* set content-type */
|
||||||
if (dirlisting) {
|
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=",
|
ap_set_content_type(r, apr_pstrcat(p, "text/html;charset=",
|
||||||
dconf->ftp_directory_charset ?
|
fdconf->ftp_directory_charset ?
|
||||||
dconf->ftp_directory_charset :
|
fdconf->ftp_directory_charset :
|
||||||
"ISO-8859-1", NULL));
|
"ISO-8859-1", NULL));
|
||||||
}
|
}
|
||||||
else {
|
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."),
|
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,
|
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."),
|
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}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user