remm        02/04/09 10:59:42

  Modified:    http11/src/java/org/apache/coyote/http11
                        Http11Processor.java
  Log:
  - Modify Costin's patch:
    - In HTTP/1.1, we must default to the protocol's default (spec requirement);
      this was fixed recently (bug 6668)
    - In HTTP/1.0, using reasonable defaults looks fine
  
  Revision  Changes    Path
  1.21      +8 -9      
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
  
  Index: Http11Processor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Http11Processor.java      9 Apr 2002 17:23:49 -0000       1.20
  +++ Http11Processor.java      9 Apr 2002 17:59:42 -0000       1.21
  @@ -725,17 +725,17 @@
   
           MessageBytes valueMB = req.getMimeHeaders().getValue("host");
   
  -        // Default is what the socket tells us. Overriden if a host is found/parsed
  -        req.setServerPort( socket.getLocalPort() );
  -        InetAddress localAddress = socket.getLocalAddress();
  -        
           ByteChunk valueBC = null;
           if (valueMB == null) {
  -            // That was in the 3.3 connector. 4.0 let it unset.
  +            // HTTP/1.0
  +            // Default is what the socket tells us. Overriden if a host is 
  +            // found/parsed
  +            req.setServerPort(socket.getLocalPort());
  +            InetAddress localAddress = socket.getLocalAddress();
               // Setting the socket-related fields. The adapter doesn't know about
               // socket.
  -            req.setLocalHost( localAddress.getHostName() );
  -            req.serverName().setString( localAddress.getHostName() );
  +            req.setLocalHost(localAddress.getHostName());
  +            req.serverName().setString(localAddress.getHostName());
               return;
           }
           valueBC = valueMB.getByteChunk();
  @@ -753,8 +753,7 @@
           }
   
           if (colonPos < 0) {
  -            //The info from socket is usually acurate
  -            // req.setServerPort(80);
  +            req.setServerPort(80);
               req.serverName().setBytes( valueB, valueS, valueL);
           } else {
               req.serverName().setBytes( valueB, valueS, colonPos);
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to