JBossWeb SVN: r2536 - branches/7.5.x/src/main/java/org/jboss/web/rewrite.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-29 06:04:49 -0400 (Wed, 29 Oct 2014)
New Revision: 2536
Modified:
branches/7.5.x/src/main/java/org/jboss/web/rewrite/RewriteValve.java
Log:
BZ1158385: C= should actually be CO=.
Modified: branches/7.5.x/src/main/java/org/jboss/web/rewrite/RewriteValve.java
===================================================================
--- branches/7.5.x/src/main/java/org/jboss/web/rewrite/RewriteValve.java 2014-10-24 12:11:17 UTC (rev 2535)
+++ branches/7.5.x/src/main/java/org/jboss/web/rewrite/RewriteValve.java 2014-10-29 10:04:49 UTC (rev 2536)
@@ -622,12 +622,12 @@
protected static void parseRuleFlag(String line, RewriteRule rule, String flag) {
if (flag.equals("chain") || flag.equals("C")) {
rule.setChain(true);
- } else if (flag.startsWith("cookie=") || flag.startsWith("C=")) {
+ } else if (flag.startsWith("cookie=") || flag.startsWith("CO=")) {
rule.setCookie(true);
if (flag.startsWith("cookie")) {
flag = flag.substring("cookie=".length());
- } else if (flag.startsWith("C=")) {
- flag = flag.substring("C=".length());
+ } else if (flag.startsWith("CO=")) {
+ flag = flag.substring("CO=".length());
}
StringTokenizer tokenizer = new StringTokenizer(flag, ":");
if (tokenizer.countTokens() < 2) {
10 years, 1 month
JBossWeb SVN: r2535 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-24 08:11:17 -0400 (Fri, 24 Oct 2014)
New Revision: 2535
Added:
tags/JBOSSWEB_7_5_0_BETA4/
Log:
Web 7.5.0 Beta 4
10 years, 2 months
JBossWeb SVN: r2534 - branches/7.5.x.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-24 08:09:52 -0400 (Fri, 24 Oct 2014)
New Revision: 2534
Modified:
branches/7.5.x/pom.xml
Log:
Web 7.5.0 Beta 4
Modified: branches/7.5.x/pom.xml
===================================================================
--- branches/7.5.x/pom.xml 2014-10-23 12:06:30 UTC (rev 2533)
+++ branches/7.5.x/pom.xml 2014-10-24 12:09:52 UTC (rev 2534)
@@ -33,7 +33,7 @@
<groupId>org.jboss.web</groupId>
<artifactId>jbossweb</artifactId>
- <version>7.5.0.Beta3</version>
+ <version>7.5.0.Beta4</version>
<name>JBoss Web</name>
<description>Servlet 3.0 container</description>
10 years, 2 months
JBossWeb SVN: r2533 - branches/7.5.x/src/main/java/org/apache/tomcat/websocket.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-23 08:06:30 -0400 (Thu, 23 Oct 2014)
New Revision: 2533
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java
Log:
Port websocket patch: use a PA to create client threads.
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java 2014-10-22 16:05:37 UTC (rev 2532)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java 2014-10-23 12:06:30 UTC (rev 2533)
@@ -20,6 +20,8 @@
import java.io.IOException;
import java.nio.channels.AsynchronousChannelGroup;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
@@ -104,12 +106,21 @@
private AtomicInteger count = new AtomicInteger(0);
@Override
- public Thread newThread(Runnable r) {
- Thread t = new Thread(r);
- t.setName("WebSocketClient-AsyncIO-" + count.incrementAndGet());
- t.setContextClassLoader(this.getClass().getClassLoader());
- t.setDaemon(true);
- return t;
+ public Thread newThread(final Runnable r) {
+ // Create the new Thread within a doPrivileged block to ensure that
+ // the thread inherits the current ProtectionDomain which is
+ // essential to be able to use this with a Java Applet. See
+ // https://issues.apache.org/bugzilla/show_bug.cgi?id=57091
+ return AccessController.doPrivileged(new PrivilegedAction<Thread>() {
+ @Override
+ public Thread run() {
+ Thread t = new Thread(r);
+ t.setName("WebSocketClient-AsyncIO-" + count.incrementAndGet());
+ t.setContextClassLoader(this.getClass().getClassLoader());
+ t.setDaemon(true);
+ return t;
+ }
+ });
}
}
}
10 years, 2 months
JBossWeb SVN: r2532 - in branches/7.5.x/src/main/java/org: apache/tomcat/websocket/server and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-22 12:05:37 -0400 (Wed, 22 Oct 2014)
New Revision: 2532
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java
branches/7.5.x/src/main/java/org/jboss/web/WebsocketsMessages.java
Log:
Port websocket patches.
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java 2014-10-22 13:58:11 UTC (rev 2531)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java 2014-10-22 16:05:37 UTC (rev 2532)
@@ -120,6 +120,9 @@
public void sendBytes(ByteBuffer data) throws IOException {
+ if (data == null) {
+ throw MESSAGES.invalidNullData();
+ }
stateMachine.binaryStart();
startMessageBlock(Constants.OPCODE_BINARY, data, true);
stateMachine.complete(true);
@@ -134,6 +137,12 @@
public void sendBytesByCompletion(ByteBuffer data, SendHandler handler) {
+ if (data == null) {
+ throw MESSAGES.invalidNullData();
+ }
+ if (handler == null) {
+ throw MESSAGES.invalidNullHandler();
+ }
StateUpdateSendHandler sush = new StateUpdateSendHandler(handler);
stateMachine.binaryStart();
startMessage(Constants.OPCODE_BINARY, data, true, sush);
@@ -142,6 +151,9 @@
public void sendPartialBytes(ByteBuffer partialByte, boolean last)
throws IOException {
+ if (partialByte == null) {
+ throw MESSAGES.invalidNullData();
+ }
stateMachine.binaryPartialStart();
startMessageBlock(Constants.OPCODE_BINARY, partialByte, last);
stateMachine.complete(last);
@@ -163,6 +175,9 @@
public void sendString(String text) throws IOException {
+ if (text == null) {
+ throw MESSAGES.invalidNullData();
+ }
stateMachine.textStart();
sendPartialString(CharBuffer.wrap(text), true);
}
@@ -176,6 +191,12 @@
public void sendStringByCompletion(String text, SendHandler handler) {
+ if (text == null) {
+ throw MESSAGES.invalidNullData();
+ }
+ if (handler == null) {
+ throw MESSAGES.invalidNullHandler();
+ }
stateMachine.textStart();
TextMessageSendHandler tmsh = new TextMessageSendHandler(handler,
CharBuffer.wrap(text), true, encoder, encoderBuffer, this);
@@ -186,6 +207,9 @@
public void sendPartialString(String fragment, boolean isLast)
throws IOException {
+ if (fragment == null) {
+ throw MESSAGES.invalidNullData();
+ }
stateMachine.textPartialStart();
sendPartialString(CharBuffer.wrap(fragment), isLast);
}
@@ -484,14 +508,21 @@
}
- public void sendObject(Object obj) throws IOException {
+ public void sendObject(Object obj) throws IOException, EncodeException {
Future<Void> f = sendObjectByFuture(obj);
try {
f.get();
} catch (InterruptedException e) {
throw new IOException(e);
} catch (ExecutionException e) {
- throw new IOException(e);
+ Throwable cause = e.getCause();
+ if (cause instanceof IOException) {
+ throw (IOException) cause;
+ } else if (cause instanceof EncodeException) {
+ throw (EncodeException) cause;
+ } else {
+ throw new IOException(e);
+ }
}
}
@@ -505,6 +536,13 @@
@SuppressWarnings({"unchecked", "rawtypes"})
public void sendObjectByCompletion(Object obj, SendHandler completion) {
+ if (obj == null) {
+ throw MESSAGES.invalidNullData();
+ }
+ if (completion == null) {
+ throw MESSAGES.invalidNullHandler();
+ }
+
if (Util.isPrimitive(obj.getClass())) {
String msg = obj.toString();
sendStringByCompletion(msg, completion);
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 2014-10-22 13:58:11 UTC (rev 2531)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 2014-10-22 16:05:37 UTC (rev 2532)
@@ -161,6 +161,7 @@
ClientEndpointConfig config = builder.
decoders(Arrays.asList(annotation.decoders())).
encoders(Arrays.asList(annotation.encoders())).
+ preferredSubprotocols(Arrays.asList(annotation.subprotocols())).
build();
return connectToServer(ep, config, path);
}
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java 2014-10-22 13:58:11 UTC (rev 2531)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java 2014-10-22 16:05:37 UTC (rev 2532)
@@ -181,10 +181,10 @@
getWebSocketAccept(key));
if (subProtocol != null && subProtocol.length() > 0) {
// RFC6455 4.2.2 explicitly states "" is not valid here
- resp.setHeader("Sec-WebSocket-Protocol", subProtocol);
+ resp.setHeader(Constants.WS_PROTOCOL_HEADER_NAME, subProtocol);
}
if (!transformations.isEmpty()) {
- resp.setHeader("Sec-WebSocket-Extensions", responseHeaderExtensions.toString());
+ resp.setHeader(Constants.WS_EXTENSIONS_HEADER_NAME, responseHeaderExtensions.toString());
}
WsHandshakeRequest wsRequest = new WsHandshakeRequest(req);
Modified: branches/7.5.x/src/main/java/org/jboss/web/WebsocketsMessages.java
===================================================================
--- branches/7.5.x/src/main/java/org/jboss/web/WebsocketsMessages.java 2014-10-22 13:58:11 UTC (rev 2531)
+++ branches/7.5.x/src/main/java/org/jboss/web/WebsocketsMessages.java 2014-10-22 16:05:37 UTC (rev 2532)
@@ -338,4 +338,10 @@
@Message(id = 8600, value = "Incompatible RSV bit usage")
String incompatibleRsvBitUsage();
+ @Message(id = 8601, value = "Null data")
+ IllegalArgumentException invalidNullData();
+
+ @Message(id = 8602, value = "Null handler")
+ IllegalArgumentException invalidNullHandler();
+
}
10 years, 2 months
JBossWeb SVN: r2531 - in branches/7.4.x/src: main/java/org/apache/jasper/compiler and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: aogburn
Date: 2014-10-22 09:58:11 -0400 (Wed, 22 Oct 2014)
New Revision: 2531
Modified:
branches/7.4.x/src/
branches/7.4.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java
branches/7.4.x/src/main/java/org/jboss/web/JasperMessages.java
Log:
[JBWEB-305] Add file name information in detail error when compiling the java file
Property changes on: branches/7.4.x/src
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/8.0.x/src:2529
Modified: branches/7.4.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java 2014-10-22 13:54:07 UTC (rev 2530)
+++ branches/7.4.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java 2014-10-22 13:58:11 UTC (rev 2531)
@@ -76,7 +76,7 @@
buf.append(details[i].getJspExtract());
} else {
buf.append("\n\n");
- buf.append(MESSAGES.errorInJavaFile(details[i].getJavaLineNumber()));
+ buf.append(MESSAGES.errorInJavaFile(details[i].getJavaLineNumber(), details[i].getJavaFileName()));
buf.append("\n");
buf.append(details[i].getErrorMessage());
}
Modified: branches/7.4.x/src/main/java/org/jboss/web/JasperMessages.java
===================================================================
--- branches/7.4.x/src/main/java/org/jboss/web/JasperMessages.java 2014-10-22 13:54:07 UTC (rev 2530)
+++ branches/7.4.x/src/main/java/org/jboss/web/JasperMessages.java 2014-10-22 13:58:11 UTC (rev 2531)
@@ -220,8 +220,8 @@
@Message(id = 4060, value = "An error occurred at line: %s in the jsp file: %s")
String errorInJspFile(int line, String fileName);
- @Message(id = 4061, value = "An error occurred at line: %s in the generated java file")
- String errorInJavaFile(int line);
+ @Message(id = 4061, value = "An error occurred at line: %s in the generated java file: %s")
+ String errorInJavaFile(int line, String fileName);
@Message(id = 4062, value = "Unable to compile class for JSP: %s")
String failedClassCompilation(String errorReport);
10 years, 2 months
JBossWeb SVN: r2530 - in branches/7.5.x/src: main/java/org/apache/catalina/authenticator and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: aogburn
Date: 2014-10-22 09:54:07 -0400 (Wed, 22 Oct 2014)
New Revision: 2530
Modified:
branches/7.5.x/src/
branches/7.5.x/src/main/java/org/apache/catalina/authenticator/DigestAuthenticator.java
branches/7.5.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java
branches/7.5.x/src/main/java/org/jboss/web/JasperMessages.java
Log:
[JBWEB-305] Add file name information in detail error when compiling the java file
Property changes on: branches/7.5.x/src
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/8.0.x/src:2529
Property changes on: branches/7.5.x/src/main/java/org/apache/catalina/authenticator/DigestAuthenticator.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/src/main/java/org/apache/catalina/authenticator/DigestAuthenticator.java:2485
+ /branches/7.4.x/src/main/java/org/apache/catalina/authenticator/DigestAuthenticator.java:2485
/branches/8.0.x/src/main/java/org/apache/catalina/authenticator/DigestAuthenticator.java:2529
Modified: branches/7.5.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java 2014-10-22 13:50:30 UTC (rev 2529)
+++ branches/7.5.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java 2014-10-22 13:54:07 UTC (rev 2530)
@@ -76,7 +76,7 @@
buf.append(details[i].getJspExtract());
} else {
buf.append("\n\n");
- buf.append(MESSAGES.errorInJavaFile(details[i].getJavaLineNumber()));
+ buf.append(MESSAGES.errorInJavaFile(details[i].getJavaLineNumber(), details[i].getJavaFileName()));
buf.append("\n");
buf.append(details[i].getErrorMessage());
}
Modified: branches/7.5.x/src/main/java/org/jboss/web/JasperMessages.java
===================================================================
--- branches/7.5.x/src/main/java/org/jboss/web/JasperMessages.java 2014-10-22 13:50:30 UTC (rev 2529)
+++ branches/7.5.x/src/main/java/org/jboss/web/JasperMessages.java 2014-10-22 13:54:07 UTC (rev 2530)
@@ -220,8 +220,8 @@
@Message(id = 4060, value = "An error occurred at line: %s in the jsp file: %s")
String errorInJspFile(int line, String fileName);
- @Message(id = 4061, value = "An error occurred at line: %s in the generated java file")
- String errorInJavaFile(int line);
+ @Message(id = 4061, value = "An error occurred at line: %s in the generated java file: %s")
+ String errorInJavaFile(int line, String fileName);
@Message(id = 4062, value = "Unable to compile class for JSP: %s")
String failedClassCompilation(String errorReport);
10 years, 2 months
JBossWeb SVN: r2529 - in branches/8.0.x/src/main/java/org: jboss/web and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: aogburn
Date: 2014-10-22 09:50:30 -0400 (Wed, 22 Oct 2014)
New Revision: 2529
Modified:
branches/8.0.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java
branches/8.0.x/src/main/java/org/jboss/web/JasperMessages.java
Log:
[JBWEB-305] Add file name information in detail error when compiling the java file
Modified: branches/8.0.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java
===================================================================
--- branches/8.0.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java 2014-10-22 13:39:40 UTC (rev 2528)
+++ branches/8.0.x/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java 2014-10-22 13:50:30 UTC (rev 2529)
@@ -76,7 +76,7 @@
buf.append(details[i].getJspExtract());
} else {
buf.append("\n\n");
- buf.append(MESSAGES.errorInJavaFile(details[i].getJavaLineNumber()));
+ buf.append(MESSAGES.errorInJavaFile(details[i].getJavaLineNumber(), details[i].getJavaFileName()));
buf.append("\n");
buf.append(details[i].getErrorMessage());
}
Modified: branches/8.0.x/src/main/java/org/jboss/web/JasperMessages.java
===================================================================
--- branches/8.0.x/src/main/java/org/jboss/web/JasperMessages.java 2014-10-22 13:39:40 UTC (rev 2528)
+++ branches/8.0.x/src/main/java/org/jboss/web/JasperMessages.java 2014-10-22 13:50:30 UTC (rev 2529)
@@ -220,8 +220,8 @@
@Message(id = 4060, value = "An error occurred at line: %s in the jsp file: %s")
String errorInJspFile(int line, String fileName);
- @Message(id = 4061, value = "An error occurred at line: %s in the generated java file")
- String errorInJavaFile(int line);
+ @Message(id = 4061, value = "An error occurred at line: %s in the generated java file: %s")
+ String errorInJavaFile(int line, String fileName);
@Message(id = 4062, value = "Unable to compile class for JSP: %s")
String failedClassCompilation(String errorReport);
10 years, 2 months
JBossWeb SVN: r2528 - in trunk/java/org/apache/jasper: resources and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: aogburn
Date: 2014-10-22 09:39:40 -0400 (Wed, 22 Oct 2014)
New Revision: 2528
Modified:
trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java
trunk/java/org/apache/jasper/resources/LocalStrings.properties
trunk/java/org/apache/jasper/resources/LocalStrings_es.properties
Log:
[JBWEB-305] Add file name information in detail error when compiling the java file
Modified: trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java 2014-10-21 14:36:24 UTC (rev 2527)
+++ trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java 2014-10-22 13:39:40 UTC (rev 2528)
@@ -80,7 +80,8 @@
buf.append(details[i].getJspExtract());
} else {
args = new Object[] {
- new Integer(details[i].getJavaLineNumber()) };
+ new Integer(details[i].getJavaLineNumber()),
+ details[i].getJavaFileName() };
buf.append("\n\n");
buf.append(Localizer.getMessage("jsp.error.java.line.number",
args));
Modified: trunk/java/org/apache/jasper/resources/LocalStrings.properties
===================================================================
--- trunk/java/org/apache/jasper/resources/LocalStrings.properties 2014-10-21 14:36:24 UTC (rev 2527)
+++ trunk/java/org/apache/jasper/resources/LocalStrings.properties 2014-10-22 13:39:40 UTC (rev 2528)
@@ -311,7 +311,7 @@
#Error when compiling, used for jsp line number error messages
jsp.error.single.line.number=An error occurred at line: {0} in the jsp file: {1}
jsp.error.multiple.line.number=\n\nAn error occurred between lines: {0} and {1} in the jsp file: {2}\n\n
-jsp.error.java.line.number=An error occurred at line: {0} in the generated java file
+jsp.error.java.line.number=An error occurred at line: {0} in the generated java file: {1}
jsp.error.corresponding.servlet=Generated servlet error:\n
jsp.error.empty.body.not.allowed=Empty body not allowed for {0}
jsp.error.jspbody.required=Must use jsp:body to specify tag body for {0} if jsp:attribute is used.
Modified: trunk/java/org/apache/jasper/resources/LocalStrings_es.properties
===================================================================
--- trunk/java/org/apache/jasper/resources/LocalStrings_es.properties 2014-10-21 14:36:24 UTC (rev 2527)
+++ trunk/java/org/apache/jasper/resources/LocalStrings_es.properties 2014-10-22 13:39:40 UTC (rev 2528)
@@ -328,7 +328,7 @@
\n\
Ha tenido lugar un error entre las l\u00EDneas\: {0} y {1} en el archivo jsp\: {2}\n\
\n
-jsp.error.java.line.number = Ha tenido lugar un error en la l\u00EDnea\: {0} en el fichero java generado
+jsp.error.java.line.number = Ha tenido lugar un error en la l\u00EDnea\: {0} en el fichero java generado: {1}
jsp.error.corresponding.servlet = Error de servlet generado\:\n
jsp.error.empty.body.not.allowed = Cuerpo vac\u00EDo no permitido para {0}
jsp.error.jspbody.required = Se debe de usar jsp\:body para especificar cuerpo tag para {0} si se usa jsp\:attribute.
10 years, 2 months
JBossWeb SVN: r2527 - branches/7.5.x/src/main/java/org/apache/tomcat/util/net/jsse.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-21 10:36:24 -0400 (Tue, 21 Oct 2014)
New Revision: 2527
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/util/net/jsse/JSSEUtils.java
Log:
BZ1123356: Fix use of single cipher. Submitted by Emmanuel Hugonnet.
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/util/net/jsse/JSSEUtils.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/util/net/jsse/JSSEUtils.java 2014-10-16 13:41:28 UTC (rev 2526)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/util/net/jsse/JSSEUtils.java 2014-10-21 14:36:24 UTC (rev 2527)
@@ -40,17 +40,17 @@
Set<String> result = new LinkedHashSet<String>();
if (cipherSuites.length == 1) {
List<String> enabledCiphers = OpenSSLCipherConfigurationParser.parseExpression(cipherSuites[0]);
- for (String enabledCipher : enabledCiphers) {
- if (supportedCiphers.contains(enabledCipher)) {
- result.add(enabledCipher);
+ if (enabledCiphers.isEmpty()) {
+ result.addAll(filter(Arrays.asList(cipherSuites), supportedCiphers));
+ } else {
+ for (String enabledCipher : enabledCiphers) {
+ if (supportedCiphers.contains(enabledCipher)) {
+ result.add(enabledCipher);
+ }
}
}
} else {
- for (String enabledCipher : cipherSuites) {
- if (supportedCiphers.contains(enabledCipher)) {
- result.add(enabledCipher);
- }
- }
+ result.addAll(filter(Arrays.asList(cipherSuites), supportedCiphers));
}
if (!result.isEmpty()) {
StringBuilder builder = new StringBuilder(result.size() * 16);
@@ -62,4 +62,14 @@
}
return result.toArray(new String[result.size()]);
}
+
+ private static Set<String> filter(final List<String> enabledCiphers, final Set<String> supportedCiphers) {
+ Set<String> result = new LinkedHashSet<String>();
+ for (String enabledCipher : enabledCiphers) {
+ if (supportedCiphers.contains(enabledCipher)) {
+ result.add(enabledCipher);
+ }
+ }
+ return result;
+ }
}
10 years, 2 months