Changes with Apache 2.3.5
+ *) Turn static function get_server_name_for_url() into public
+ ap_get_server_name_for_url() and use it where appropriate. This
+ fixes mod_rewrite generating invalid URLs for redirects to IPv6
+ literal addresses. [Stefan Fritsch]
+
*) mod_ldap: Introduce new config option LDAPTimeout to set the timeout
for LDAP operations like bind and search. [Stefan Fritsch]
* 20091230.0 (2.3.5-dev) Move ftp_directory_charset from proxy_dir_conf
* to proxy_ftp_dir_conf(mod_proxy_ftp)
* 20091230.1 (2.3.5-dev) add util_ldap_state_t.opTimeout
+ * 20091230.2 (2.3.5-dev) add ap_get_server_name_for_url()
*
*/
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20091230
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
*/
AP_DECLARE(const char *) ap_get_server_name(request_rec *r);
+/**
+ * Get the current server name from the request for the purposes
+ * of using in a URL. If the server name is an IPv6 literal
+ * address, it will be returned in URL format (e.g., "[fe80::1]").
+ * @param r The current request
+ * @return the server name
+ */
+AP_DECLARE(const char *) ap_get_server_name_for_url(request_rec *r);
+
/**
* Get the current server port
* @param r The current request
char *thisport;
int port;
- thisserver = ap_get_server_name(r);
+ thisserver = ap_get_server_name_for_url(r);
port = ap_get_server_port(r);
thisport = ap_is_default_port(port, r)
? ""
*/
/* add the canonical URI of this URL */
- thisserver = ap_get_server_name(r);
+ thisserver = ap_get_server_name_for_url(r);
port = ap_get_server_port(r);
if (ap_is_default_port(port, r)) {
thisport = "";
thisurl = ap_escape_html(r->pool,
apr_psprintf(r->pool, "https://%s%s/",
- ap_get_server_name(r),
+ ap_get_server_name_for_url(r),
thisport));
errmsg = apr_psprintf(r->pool,
* of using in a URL. If the server name is an IPv6 literal
* address, it will be returned in URL format (e.g., "[fe80::1]").
*/
-static const char *get_server_name_for_url(request_rec *r)
+AP_DECLARE(const char *) ap_get_server_name_for_url(request_rec *r)
{
const char *plain_server_name = ap_get_server_name(r);
request_rec *r)
{
unsigned port = ap_get_server_port(r);
- const char *host = get_server_name_for_url(r);
+ const char *host = ap_get_server_name_for_url(r);
if (ap_is_default_port(port, r)) {
return apr_pstrcat(p, ap_http_scheme(r), "://", host, uri, NULL);