From 2d1b1780bea76d3cb86c0845bcc5b88fb7d2dd5a Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 27 Dec 2003 06:23:48 +0000 Subject: [PATCH] Fix UseCanonicalCase off case where it'd improperly examine port number. parsed_uri.port is only valid iff parsed_uri.port_str != NULL. Old code simply checked if it was non-zero, not if it was *valid* Backport of server/core.c r1.248 from httpd-2.1 Submitted by: Jim Jagielski Reviewed by: Brad Nicholes, Jim Jagielski, Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@102116 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ server/core.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 96b59f1946b..7c4eee7d6a2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.49 + *) Correct UseCanonicalName Off to properly check incoming port number. + [Jim Jagielski] + *) Fix slow graceful restarts with prefork MPM. [Joe Orton] *) Fix a problem with namespace mappings being dropped in mod_dav_fs; diff --git a/server/core.c b/server/core.c index d79bb2d6c57..c51892b819b 100644 --- a/server/core.c +++ b/server/core.c @@ -935,7 +935,7 @@ AP_DECLARE(apr_port_t) ap_get_server_port(const request_rec *r) * URLs using the hostname and port supplied by the client if * any are supplied (otherwise it will use the canonical name). */ - port = r->parsed_uri.port ? r->parsed_uri.port : + port = r->parsed_uri.port_str ? r->parsed_uri.port : r->server->port ? r->server->port : ap_default_port(r); } -- 2.47.2