Author: remy.maucherat(a)jboss.com
Date: 2011-10-21 06:17:39 -0400 (Fri, 21 Oct 2011)
New Revision: 1854
Added:
trunk/java/org/apache/tomcat/util/net/Constants.java
Modified:
trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
trunk/java/org/apache/coyote/ajp/AjpProcessor.java
trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
trunk/webapps/docs/changelog.xml
Log:
- Add a flag for optional blocking in the thread pool, which can help testing.
- Move some constants.
Modified: trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java 2011-10-20 17:40:18 UTC (rev
1853)
+++ trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java 2011-10-21 10:17:39 UTC (rev
1854)
@@ -631,7 +631,7 @@
log.error(sm.getString("ajpprocessor.certs.fail"), e);
return;
}
- request.setAttribute(AprEndpoint.CERTIFICATE_KEY, jsseCerts);
+
request.setAttribute(org.apache.tomcat.util.net.Constants.CERTIFICATE_KEY, jsseCerts);
}
} else if (actionCode == ActionCode.ACTION_REQ_HOST_ATTRIBUTE) {
@@ -844,19 +844,19 @@
case Constants.SC_A_SSL_CIPHER :
request.scheme().setString("https");
requestHeaderMessage.getBytes(tmpMB);
- request.setAttribute(AprEndpoint.CIPHER_SUITE_KEY,
+
request.setAttribute(org.apache.tomcat.util.net.Constants.CIPHER_SUITE_KEY,
tmpMB.toString());
break;
case Constants.SC_A_SSL_SESSION :
request.scheme().setString("https");
requestHeaderMessage.getBytes(tmpMB);
- request.setAttribute(AprEndpoint.SESSION_ID_KEY,
+
request.setAttribute(org.apache.tomcat.util.net.Constants.SESSION_ID_KEY,
tmpMB.toString());
break;
case Constants.SC_A_SSL_KEY_SIZE :
- request.setAttribute(AprEndpoint.KEY_SIZE_KEY,
+ request.setAttribute(org.apache.tomcat.util.net.Constants.KEY_SIZE_KEY,
new Integer(requestHeaderMessage.getInt()));
break;
Modified: trunk/java/org/apache/coyote/ajp/AjpProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpProcessor.java 2011-10-20 17:40:18 UTC (rev 1853)
+++ trunk/java/org/apache/coyote/ajp/AjpProcessor.java 2011-10-21 10:17:39 UTC (rev 1854)
@@ -645,7 +645,7 @@
log.error(sm.getString("ajpprocessor.certs.fail"), e);
return;
}
- request.setAttribute(JIoEndpoint.CERTIFICATE_KEY, jsseCerts);
+
request.setAttribute(org.apache.tomcat.util.net.Constants.CERTIFICATE_KEY, jsseCerts);
}
} else if (actionCode == ActionCode.ACTION_REQ_HOST_ATTRIBUTE) {
@@ -858,19 +858,19 @@
case Constants.SC_A_SSL_CIPHER :
request.scheme().setString("https");
requestHeaderMessage.getBytes(tmpMB);
- request.setAttribute(JIoEndpoint.CIPHER_SUITE_KEY,
+
request.setAttribute(org.apache.tomcat.util.net.Constants.CIPHER_SUITE_KEY,
tmpMB.toString());
break;
case Constants.SC_A_SSL_SESSION :
request.scheme().setString("https");
requestHeaderMessage.getBytes(tmpMB);
- request.setAttribute(JIoEndpoint.SESSION_ID_KEY,
+
request.setAttribute(org.apache.tomcat.util.net.Constants.SESSION_ID_KEY,
tmpMB.toString());
break;
case Constants.SC_A_SSL_KEY_SIZE :
- request.setAttribute(JIoEndpoint.KEY_SIZE_KEY,
+ request.setAttribute(org.apache.tomcat.util.net.Constants.KEY_SIZE_KEY,
new Integer(requestHeaderMessage.getInt()));
break;
Modified: trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2011-10-20 17:40:18 UTC
(rev 1853)
+++ trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2011-10-21 10:17:39 UTC
(rev 1854)
@@ -1176,7 +1176,7 @@
// Cipher suite
Object sslO = SSLSocket.getInfoS(socket, SSL.SSL_INFO_CIPHER);
if (sslO != null) {
- request.setAttribute(AprEndpoint.CIPHER_SUITE_KEY, sslO);
+
request.setAttribute(org.apache.tomcat.util.net.Constants.CIPHER_SUITE_KEY, sslO);
}
// Get client certificate and the certificate chain if present
// certLength == -1 indicates an error
@@ -1193,15 +1193,15 @@
}
}
if (certs != null) {
- request.setAttribute(AprEndpoint.CERTIFICATE_KEY, certs);
+
request.setAttribute(org.apache.tomcat.util.net.Constants.CERTIFICATE_KEY, certs);
}
// User key size
sslO = new Integer(SSLSocket.getInfoI(socket,
SSL.SSL_INFO_CIPHER_USEKEYSIZE));
- request.setAttribute(AprEndpoint.KEY_SIZE_KEY, sslO);
+
request.setAttribute(org.apache.tomcat.util.net.Constants.KEY_SIZE_KEY, sslO);
// SSL session ID
sslO = SSLSocket.getInfoS(socket, SSL.SSL_INFO_SESSION_ID);
if (sslO != null) {
- request.setAttribute(AprEndpoint.SESSION_ID_KEY, sslO);
+
request.setAttribute(org.apache.tomcat.util.net.Constants.SESSION_ID_KEY, sslO);
}
} catch (Exception e) {
log.warn(sm.getString("http11processor.socket.ssl"), e);
@@ -1240,7 +1240,7 @@
}
}
if (certs != null) {
- request.setAttribute(AprEndpoint.CERTIFICATE_KEY, certs);
+
request.setAttribute(org.apache.tomcat.util.net.Constants.CERTIFICATE_KEY, certs);
}
}
} catch (Exception e) {
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2011-10-20 17:40:18 UTC (rev
1853)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2011-10-21 10:17:39 UTC (rev
1854)
@@ -65,28 +65,6 @@
StringManager.getManager("org.apache.tomcat.util.net.res");
- /**
- * The Request attribute key for the cipher suite.
- */
- public static final String CIPHER_SUITE_KEY =
"javax.servlet.request.cipher_suite";
-
- /**
- * The Request attribute key for the key size.
- */
- public static final String KEY_SIZE_KEY =
"javax.servlet.request.key_size";
-
- /**
- * The Request attribute key for the client certificate chain.
- */
- public static final String CERTIFICATE_KEY =
"javax.servlet.request.X509Certificate";
-
- /**
- * The Request attribute key for the session id.
- * This one is a Tomcat extension to the Servlet spec.
- */
- public static final String SESSION_ID_KEY =
"javax.servlet.request.ssl_session";
-
-
// ----------------------------------------------------------------- Fields
@@ -953,7 +931,8 @@
protected Worker getWorkerThread() {
// Allocate a new worker thread
Worker workerThread = createWorkerThread();
- if (org.apache.tomcat.util.Constants.LOW_MEMORY) {
+ if (org.apache.tomcat.util.net.Constants.WAIT_FOR_THREAD
+ || org.apache.tomcat.util.Constants.LOW_MEMORY) {
while (workerThread == null) {
try {
synchronized (workers) {
Added: trunk/java/org/apache/tomcat/util/net/Constants.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/Constants.java (rev 0)
+++ trunk/java/org/apache/tomcat/util/net/Constants.java 2011-10-21 10:17:39 UTC (rev
1854)
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.tomcat.util.net;
+
+/**
+ * Constants.
+ *
+ * @author Remy Maucherat
+ */
+public final class Constants {
+
+
+ public static final boolean WAIT_FOR_THREAD =
+
Boolean.valueOf(System.getProperty("org.apache.tomcat.util.net.WAIT_FOR_THREAD",
"false")).booleanValue();
+
+ /**
+ * The Request attribute key for the cipher suite.
+ */
+ public static final String CIPHER_SUITE_KEY =
"javax.servlet.request.cipher_suite";
+
+ /**
+ * The Request attribute key for the key size.
+ */
+ public static final String KEY_SIZE_KEY =
"javax.servlet.request.key_size";
+
+ /**
+ * The Request attribute key for the client certificate chain.
+ */
+ public static final String CERTIFICATE_KEY =
"javax.servlet.request.X509Certificate";
+
+ /**
+ * The Request attribute key for the session id.
+ * This one is a Tomcat extension to the Servlet spec.
+ */
+ public static final String SESSION_ID_KEY =
"javax.servlet.request.ssl_session";
+
+
+}
Modified: trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2011-10-20 17:40:18 UTC (rev
1853)
+++ trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2011-10-21 10:17:39 UTC (rev
1854)
@@ -60,28 +60,6 @@
StringManager.getManager("org.apache.tomcat.util.net.res");
- /**
- * The Request attribute key for the cipher suite.
- */
- public static final String CIPHER_SUITE_KEY =
"javax.servlet.request.cipher_suite";
-
- /**
- * The Request attribute key for the key size.
- */
- public static final String KEY_SIZE_KEY =
"javax.servlet.request.key_size";
-
- /**
- * The Request attribute key for the client certificate chain.
- */
- public static final String CERTIFICATE_KEY =
"javax.servlet.request.X509Certificate";
-
- /**
- * The Request attribute key for the session id.
- * This one is a Tomcat extension to the Servlet spec.
- */
- public static final String SESSION_ID_KEY =
"javax.servlet.request.ssl_session";
-
-
// ----------------------------------------------------------------- Fields
@@ -1211,7 +1189,8 @@
protected Worker getWorkerThread() {
// Allocate a new worker thread
Worker workerThread = createWorkerThread();
- if (org.apache.tomcat.util.Constants.LOW_MEMORY) {
+ if (org.apache.tomcat.util.net.Constants.WAIT_FOR_THREAD
+ || org.apache.tomcat.util.Constants.LOW_MEMORY) {
while (workerThread == null) {
try {
synchronized (workers) {
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-10-20 17:40:18 UTC (rev 1853)
+++ trunk/webapps/docs/changelog.xml 2011-10-21 10:17:39 UTC (rev 1854)
@@ -22,8 +22,22 @@
<fix>
Improve DIGEST authentication security. (remm)
</fix>
+ <fix>
+ <jira>AS7-2073</jira>: Delegate connector lifecycle handling if in
delay mode. (jfclere, remm)
+ </fix>
</changelog>
</subsection>
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ Possible exception parsing invalid chunk headers. (remm)
+ </fix>
+ <fix>
+ Add org.apache.tomcat.util.net.WAIT_FOR_THREAD system property to bring back
optional
+ blocking for the thread pool. (remm)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 7.0.2.Final (remm)">