tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Gomez <hgo...@apache.org>
Subject Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Processor.java
Date Wed, 01 Oct 2003 09:47:08 GMT
hgomez@apache.org a écrit :
> hgomez      2003/10/01 00:54:09
> 
>   Modified:    http11/src/java/org/apache/coyote/http11
>                         Http11Processor.java
>   Log:
>   More setters for gzip compression support.

Here is the correction for getRemoteAddr(), getRemoteHost(), 
getRemotePort().

I detected that I got null instead of IP address while playing with 
Coyote 2 HTTP 1.1 connector with Tomcat 3.3.2-dev.

Thanks to verify it didn't break anything with TC 4.1.x and 5.0.x :)

Also here is an example of gzip settings in Coyote2 Connector :

         <CoyoteConnector2   port="8081"
			   secure="false"
			   maxThreads="100"
			   maxSpareThreads="50"
			   minSpareThreads="10"
			   compression="on"
			   compressionMinSize="2048"
			   noCompressionUserAgents="gozilla, reloo"
			   compressableMimeType="text/html,text/xml" />

Regards :-)

>    
>        /**
>   @@ -885,29 +925,32 @@
>    
>            } else if (actionCode == ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE) {
>    
>   -            if ((remoteAddr == null) && (socket != null)) {
>   +            if ((remoteAddr == null) && (socket != null))
>                    remoteAddr = socket.getInetAddress().getHostAddress();
>   -                request.remoteAddr().setString(remoteAddr);
>   -            }
>   +
>   +            request.remoteAddr().setString(remoteAddr);
>    
>            } else if (actionCode == ActionCode.ACTION_REQ_HOST_ATTRIBUTE) {
>    
>   -            if (remoteAddr == null) {
>   +            if (remoteAddr == null)
>                    remoteAddr = socket.getInetAddress().getHostAddress();
>   -                request.remoteAddr().setString(remoteAddr);
>   -            }
>   -            if (remoteHost == null) {
>   +            
>   +			request.remoteAddr().setString(remoteAddr);
>   +            
>   +            if (remoteHost == null)
>                    remoteHost = socket.getInetAddress().getHostName();
>   -                request.remoteHost().setString(remoteHost);
>   -            }           
>   -            if (remotePort == -1){
>   +
>   +			request.remoteHost().setString(remoteHost);
>   +                       
>   +            if (remotePort == -1)
>                    remotePort = socket.getPort();
>   -                request.setRemotePort(remotePort);
>   -            }            
>   -            if (localAddr == null){
>   +                
>   +            request.setRemotePort(remotePort);
>   +                        
>   +            if (localAddr == null)
>                   localAddr = socket.getLocalAddress().getHostAddress();
>   -               request.localAddr().setString(localAddr);
>   -            }
>   +
>   +			request.localAddr().setString(localAddr);
>    
>            } else if (actionCode == ActionCode.ACTION_REQ_SSL_CERTIFICATE) {
>                if( sslSupport != null) { 
>   @@ -1230,6 +1273,7 @@
>                    request.getMimeHeaders().getValue("user-agent");
>                String userAgentValue = userAgentValueMB.toString();
>    
>   +			// TODO: Use regexp instead of simple string compare (cf: Apache 2.x)
>            	if (inStringArray(noCompressionUserAgents, userAgentValue))
>            		return false;
>            }
>   
>   
>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message