From e542f27f5b4e0c6184f2e4892a6419d3f98abfbd Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 5 Jun 2011 09:43:55 +0000 Subject: [PATCH] Fully align parseHost - remove unnecessary code from BIO - improve comment for all git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1132356 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/coyote/http11/Http11AprProcessor.java | 5 +++-- java/org/apache/coyote/http11/Http11NioProcessor.java | 5 +++-- java/org/apache/coyote/http11/Http11Processor.java | 9 +++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/java/org/apache/coyote/http11/Http11AprProcessor.java b/java/org/apache/coyote/http11/Http11AprProcessor.java index 583e25613..5e0c52c86 100644 --- a/java/org/apache/coyote/http11/Http11AprProcessor.java +++ b/java/org/apache/coyote/http11/Http11AprProcessor.java @@ -833,8 +833,9 @@ public class Http11AprProcessor extends AbstractHttp11Processor { if (valueMB == null || valueMB.isNull()) { // HTTP/1.0 - // Default is what the socket tells us. Overridden if a host is - // found/parsed + // If no host header, use the port info from the endpoint + // The host will be obtained lazily from the socket if required + // using ActionCode#REQ_LOCAL_NAME_ATTRIBUTE request.setServerPort(endpoint.getPort()); return; } diff --git a/java/org/apache/coyote/http11/Http11NioProcessor.java b/java/org/apache/coyote/http11/Http11NioProcessor.java index b717faf12..3a669cff4 100644 --- a/java/org/apache/coyote/http11/Http11NioProcessor.java +++ b/java/org/apache/coyote/http11/Http11NioProcessor.java @@ -876,8 +876,9 @@ public class Http11NioProcessor extends AbstractHttp11Processor { if (valueMB == null || valueMB.isNull()) { // HTTP/1.0 - // Default is what the socket tells us. Overridden if a host is - // found/parsed + // If no host header, use the port info from the endpoint + // The host will be obtained lazily from the socket if required + // using ActionCode#REQ_LOCAL_NAME_ATTRIBUTE request.setServerPort(endpoint.getPort()); return; } diff --git a/java/org/apache/coyote/http11/Http11Processor.java b/java/org/apache/coyote/http11/Http11Processor.java index 2ddbf65ed..520732ec1 100644 --- a/java/org/apache/coyote/http11/Http11Processor.java +++ b/java/org/apache/coyote/http11/Http11Processor.java @@ -794,13 +794,10 @@ public class Http11Processor extends AbstractHttp11Processor { if (valueMB == null || valueMB.isNull()) { // HTTP/1.0 - // Default is what the socket tells us. Overridden if a host is - // found/parsed + // If no host header, use the port info from the endpoint + // The host will be obtained lazily from the socket if required + // using ActionCode#REQ_LOCAL_NAME_ATTRIBUTE request.setServerPort(endpoint.getPort()); - InetAddress localAddress = socket.getSocket().getLocalAddress(); - // Setting the socket-related fields. The adapter doesn't know - // about socket. - request.serverName().setString(localAddress.getHostName()); return; } -- 2.11.0