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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]