You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bi...@apache.org on 2003/05/16 06:22:02 UTC
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java CoyoteRequest.java
billbarker 2003/05/15 21:22:02
Modified: catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java CoyoteRequest.java
Log:
Changing to do lazy evaluation of the Servlet-Spec's SSL-attributes.
With Jean-Francois' changes to the RequestDispacher, this should work now. Of course, it is easy enough to back-out if I'm wrong ;-). I'm nearly 100% certain that this should work very well with JK-Coyote. Committing to the 5.0 branch only so that I can get more eyes to see potential problems with the Standalone HTTP connector.
Revision Changes Path
1.6 +4 -14 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
Index: CoyoteAdapter.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CoyoteAdapter.java 3 May 2003 07:44:42 -0000 1.5
+++ CoyoteAdapter.java 16 May 2003 04:22:01 -0000 1.6
@@ -263,16 +263,6 @@
throw new IOException("Invalid URI");
}
- // Set the SSL properties
- if( request.isSecure() ) {
- res.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,
- request.getCoyoteRequest());
- //Set up for getAttributeNames
- request.getAttribute(Globals.CERTIFICATES_ATTR);
- request.getAttribute(Globals.CIPHER_SUITE_ATTR);
- request.getAttribute(Globals.KEY_SIZE_ATTR);
- }
-
// Set the remote principal
String principal = req.getRemoteUser().toString();
if (principal != null) {
1.3 +29 -4 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java
Index: CoyoteRequest.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CoyoteRequest.java 1 May 2003 15:02:00 -0000 1.2
+++ CoyoteRequest.java 16 May 2003 04:22:01 -0000 1.3
@@ -930,10 +930,35 @@
attr = getAttribute(Globals.CERTIFICATES_ATTR);
if(attr != null)
attributes.put(name, attr);
+ } else if( isSSLAttribute(name) ) {
+ coyoteRequest.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,
+ coyoteRequest);
+ attr = coyoteRequest.getAttribute(Globals.CERTIFICATES_ATTR);
+ if( attr != null) {
+ attributes.put(Globals.CERTIFICATES_ATTR, attr);
+ }
+ attr = coyoteRequest.getAttribute(Globals.CIPHER_SUITE_ATTR);
+ if(attr != null) {
+ attributes.put(Globals.CIPHER_SUITE_ATTR, attr);
+ }
+ attr = coyoteRequest.getAttribute(Globals.KEY_SIZE_ATTR);
+ if(attr != null) {
+ attributes.put(Globals.KEY_SIZE_ATTR, attr);
+ }
+ attr = attributes.get(name);
}
return attr;
}
+
+ /**
+ * Test if a given name is one of the special Servlet-spec SSL attributes.
+ */
+ static boolean isSSLAttribute(String name) {
+ return Globals.CERTIFICATES_ATTR.equals(name) ||
+ Globals.CIPHER_SUITE_ATTR.equals(name) ||
+ Globals.KEY_SIZE_ATTR.equals(name);
+ }
/**
* Return the names of all request attributes for this Request, or an
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org