remm 2002/11/24 03:56:15
Modified: coyote/src/java/org/apache/coyote ActionCode.java
coyote/src/java/org/apache/coyote/tomcat3
Tomcat3Request.java
coyote/src/java/org/apache/coyote/tomcat4 CoyoteRequest.java
coyote/src/java/org/apache/coyote/tomcat5 CoyoteRequest.java
Log:
- Optmization: lazy evaluation of the remote address.
Revision Changes Path
1.10 +18 -7
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/ActionCode.java
Index: ActionCode.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/ActionCode.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ActionCode.java 21 Sep 2002 04:45:35 -0000 1.9
+++ ActionCode.java 24 Nov 2002 11:56:14 -0000 1.10
@@ -79,8 +79,9 @@
public static final ActionCode ACTION_COMMIT = new ActionCode();
- /* A flush() operation originated by the client ( i.e. a flush() on
- the servlet output stream or writer, called by a servlet ).
+ /**
+ * A flush() operation originated by the client ( i.e. a flush() on
+ * the servlet output stream or writer, called by a servlet ).
*/
public static final ActionCode ACTION_CLIENT_FLUSH = new ActionCode();
@@ -99,23 +100,33 @@
public static final ActionCode ACTION_WEBAPP = new ActionCode();
- /** Hook called after request, but before recycling. Can be used
- for logging, to update counters, custom cleanup - the request
- is still visible
- */
+
+ /**
+ * Hook called after request, but before recycling. Can be used
+ * for logging, to update counters, custom cleanup - the request
+ * is still visible
+ */
public static final ActionCode ACTION_POST_REQUEST = new ActionCode();
/**
- * Callback for lazy evaluation - extract the remote host address.
+ * Callback for lazy evaluation - extract the remote host name.
*/
public static final ActionCode ACTION_REQ_HOST_ATTRIBUTE =
new ActionCode();
/**
+ * Callback for lazy evaluation - extract the remote host address.
+ */
+ public static final ActionCode ACTION_REQ_HOST_ADDR_ATTRIBUTE =
+ new ActionCode();
+
+
+ /**
* Callback for lazy evaluation - extract the SSL-related attributes.
*/
public static final ActionCode ACTION_REQ_SSL_ATTRIBUTE = new ActionCode();
+
/**
* Callback for lazy evaluation - extract the SSL-certificate
1.12 +1 -1
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat3/Tomcat3Request.java
Index: Tomcat3Request.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat3/Tomcat3Request.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Tomcat3Request.java 8 Nov 2002 06:19:51 -0000 1.11
+++ Tomcat3Request.java 24 Nov 2002 11:56:14 -0000 1.12
@@ -210,7 +210,7 @@
public MessageBytes remoteAddr() {
if( remoteAddrMB.isNull() ) {
- coyoteRequest.action( ActionCode.ACTION_REQ_HOST_ATTRIBUTE, coyoteRequest
);
+ coyoteRequest.action( ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE,
coyoteRequest );
}
return remoteAddrMB;
}
1.28 +6 -4
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java
Index: CoyoteRequest.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- CoyoteRequest.java 20 Oct 2002 22:48:49 -0000 1.27
+++ CoyoteRequest.java 24 Nov 2002 11:56:15 -0000 1.28
@@ -1046,6 +1046,8 @@
InetAddress inet = socket.getInetAddress();
remoteAddr = inet.getHostAddress();
} else {
+ coyoteRequest.action
+ (ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE, coyoteRequest);
remoteAddr = coyoteRequest.remoteAddr().toString();
}
}
1.8 +6 -4
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteRequest.java
Index: CoyoteRequest.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteRequest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CoyoteRequest.java 18 Nov 2002 18:36:05 -0000 1.7
+++ CoyoteRequest.java 24 Nov 2002 11:56:15 -0000 1.8
@@ -1034,6 +1034,8 @@
InetAddress inet = socket.getInetAddress();
remoteAddr = inet.getHostAddress();
} else {
+ coyoteRequest.action
+ (ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE, coyoteRequest);
remoteAddr = coyoteRequest.remoteAddr().toString();
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>