costin 02/04/08 16:48:22
Modified: http11/src/java/org/apache/coyote/http11
Http11Processor.java
Log:
Add support for the delayed-evaluation of ssl and remote host attributes.
( incomplete )
Revision Changes Path
1.15 +34 -12
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.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Http11Processor.java 5 Apr 2002 17:48:26 -0000 1.14
+++ Http11Processor.java 8 Apr 2002 23:48:22 -0000 1.15
@@ -64,12 +64,14 @@
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.net.Socket;
import org.apache.tomcat.util.buf.ByteChunk;
import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.http.FastHttpDateFormat;
import org.apache.tomcat.util.http.MimeHeaders;
import org.apache.tomcat.util.buf.HexUtils;
+import org.apache.tomcat.util.net.SSLSupport;
import org.apache.coyote.ActionHook;
import org.apache.coyote.ActionCode;
@@ -206,6 +208,11 @@
*/
protected int maxKeepAliveRequests=-1;
+
+ /** SSL support, socket - this is statefull anyway */
+ protected SSLSupport sslSupport;
+ protected Socket socket;
+
// --------------------------------------------------------- Public Methods
@@ -283,6 +290,16 @@
return maxKeepAliveRequests;
}
+ public void setSSLSupport( SSLSupport sslSupport ) {
+ this.sslSupport=sslSupport;
+ }
+
+ public void setSocket( Socket socket )
+ throws IOException
+ {
+ this.socket=socket;
+ }
+
/**
* Process pipelined HTTP requests using the specified input and output
* streams.
@@ -372,6 +389,8 @@
inputBuffer.recycle();
outputBuffer.recycle();
+ // Recycle ssl info
+ sslSupport=null;
}
@@ -455,19 +474,22 @@
started = false;
- } else if (actionCode == ActionCode.ACTION_REQ_ATTRIBUTE ) {
+ } else if (actionCode == ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) {
+ Request req=(Request)param;
+ try {
+ if( sslSupport != null ) {
+ // if(key.equals("javax.servlet.request.cipher_suite"))
+ //sslSupport.getCipherSuite();
+ // if(key.equals("javax.servlet.request.X509Certificate"))
+ //sslSupport.getPeerCertificateChain();
+ }
+ } catch (Exception e){
+ //log("Exception getting SSL attribute " + key,e,Log.WARNING);
+ }
+ } else if (actionCode == ActionCode.ACTION_REQ_HOST_ATTRIBUTE ) {
+ Request req=(Request)param;
- // XXX Will be fixed if we replace ActionCode/Action with TcHandler,
- // the context can be used to pass and return information
-// try {
-// if(key.equals("javax.servlet.request.cipher_suite"))
-// return httpReq.sslSupport.getCipherSuite();
-// if(key.equals("javax.servlet.request.X509Certificate"))
-// return httpReq.sslSupport.getPeerCertificateChain();
-// } catch (Exception e){
-// log.warn("Exception getting SSL attribute " + key,e);
-// return null;
-// }
+
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>