JBossWeb SVN: r2526 - in branches/7.5.x/src/main/java: org/apache/tomcat/websocket and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-16 09:41:28 -0400 (Thu, 16 Oct 2014)
New Revision: 2526
Modified:
branches/7.5.x/src/main/java/javax/websocket/Session.java
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsSession.java
Log:
BZ1152526: Downgrade to the Websocket 1.0 signature.
Modified: branches/7.5.x/src/main/java/javax/websocket/Session.java
===================================================================
--- branches/7.5.x/src/main/java/javax/websocket/Session.java 2014-10-09 13:28:38 UTC (rev 2525)
+++ branches/7.5.x/src/main/java/javax/websocket/Session.java 2014-10-16 13:41:28 UTC (rev 2526)
@@ -31,22 +31,8 @@
*/
WebSocketContainer getContainer();
- /**
- * Registers a {@link MessageHandler} for incoming messages. Only one
- * {@link MessageHandler} may be registered for each message type (text,
- * binary, pong). The message type will be derived at runtime from the
- * provided {@link MessageHandler} instance. It is not always possible to do
- * this so it is better to use
- * {@link #addMessageHandler(Class, javax.websocket.MessageHandler.Partial)}
- * or
- * {@link #addMessageHandler(Class, javax.websocket.MessageHandler.Whole)}.
- *
- * @param listener The message handler for a incoming message
- *
- * @throws IllegalStateException If a message handler has already been
- * registered for the associated message type
- */
- void addMessageHandler(MessageHandler listener) throws IllegalStateException;
+ void addMessageHandler(MessageHandler listener)
+ throws IllegalStateException;
Set<MessageHandler> getMessageHandlers();
@@ -140,34 +126,4 @@
* this session is associated with.
*/
Set<Session> getOpenSessions();
-
- /**
- * Registers a {@link MessageHandler} for partial incoming messages. Only
- * one {@link MessageHandler} may be registered for each message type (text
- * or binary, pong messages are never presented as partial messages).
- *
- * @param clazz The type of message that the given handler is intended
- * for
- * @param listener The message handler for a incoming message
- *
- * @throws IllegalStateException If a message handler has already been
- * registered for the associated message type
- */
- <T> void addMessageHandler(Class<T> clazz, MessageHandler.Partial<T> handler)
- throws IllegalStateException;
-
- /**
- * Registers a {@link MessageHandler} for whole incoming messages. Only
- * one {@link MessageHandler} may be registered for each message type (text,
- * binary, pong).
- *
- * @param clazz The type of message that the given handler is intended
- * for
- * @param listener The message handler for a incoming message
- *
- * @throws IllegalStateException If a message handler has already been
- * registered for the associated message type
- */
- <T> void addMessageHandler(Class<T> clazz, MessageHandler.Whole<T> handler)
- throws IllegalStateException;
}
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsSession.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsSession.java 2014-10-09 13:28:38 UTC (rev 2525)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsSession.java 2014-10-16 13:41:28 UTC (rev 2526)
@@ -170,14 +170,12 @@
}
- @Override
public <T> void addMessageHandler(Class<T> clazz, Partial<T> handler)
throws IllegalStateException {
doAddMessageHandler(clazz, handler);
}
- @Override
public <T> void addMessageHandler(Class<T> clazz, Whole<T> handler)
throws IllegalStateException {
doAddMessageHandler(clazz, handler);
10 years, 2 months
JBossWeb SVN: r2525 - in branches/7.5.x/src/main/java/org/apache/catalina: core and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-09 09:28:38 -0400 (Thu, 09 Oct 2014)
New Revision: 2525
Modified:
branches/7.5.x/src/main/java/org/apache/catalina/Lifecycle.java
branches/7.5.x/src/main/java/org/apache/catalina/core/StandardContext.java
branches/7.5.x/src/main/java/org/apache/catalina/startup/ContextConfig.java
Log:
JBWEB-304: Add load on startup hack hooks. Submitted by Chao Wang.
Modified: branches/7.5.x/src/main/java/org/apache/catalina/Lifecycle.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/catalina/Lifecycle.java 2014-10-09 12:05:29 UTC (rev 2524)
+++ branches/7.5.x/src/main/java/org/apache/catalina/Lifecycle.java 2014-10-09 13:28:38 UTC (rev 2525)
@@ -89,6 +89,24 @@
public static final String PERIODIC_EVENT = "periodic";
+ /**
+ * The LifecycleEvent type for the "component before load on startup" event.
+ */
+ public static final String BEFORE_LOAD_ON_STARTUP_EVENT = "before_load_on_startup";
+
+
+ /**
+ * The LifecycleEvent type for the "component after load on startup" event.
+ */
+ public static final String AFTER_LOAD_ON_STARTUP_EVENT = "after_load_on_startup";
+
+
+ /**
+ * The LifecycleEvent type for the "component load on startup" event.
+ */
+ public static final String LOAD_ON_STARTUP_EVENT = "load_on_startup";
+
+
// --------------------------------------------------------- Public Methods
Modified: branches/7.5.x/src/main/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/catalina/core/StandardContext.java 2014-10-09 12:05:29 UTC (rev 2524)
+++ branches/7.5.x/src/main/java/org/apache/catalina/core/StandardContext.java 2014-10-09 13:28:38 UTC (rev 2525)
@@ -3588,7 +3588,10 @@
for (ArrayList<Wrapper> list : map.values()) {
for (Wrapper wrapper : list) {
try {
+ String servletClass = wrapper.getServletClass();
+ lifecycle.fireLifecycleEvent(Lifecycle.BEFORE_LOAD_ON_STARTUP_EVENT, servletClass);
wrapper.load();
+ lifecycle.fireLifecycleEvent(Lifecycle.AFTER_LOAD_ON_STARTUP_EVENT, servletClass);
} catch (ServletException e) {
getLogger().error(MESSAGES.errorLoadingServlet(wrapper.getName()), StandardWrapper.getRootCause(e));
// NOTE: load errors (including a servlet that throws
@@ -3795,6 +3798,7 @@
// Load and initialize all "load on startup" servlets
if (ok) {
+ lifecycle.fireLifecycleEvent(LOAD_ON_STARTUP_EVENT, null);
loadOnStartup(findChildren());
}
Modified: branches/7.5.x/src/main/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/catalina/startup/ContextConfig.java 2014-10-09 12:05:29 UTC (rev 2524)
+++ branches/7.5.x/src/main/java/org/apache/catalina/startup/ContextConfig.java 2014-10-09 13:28:38 UTC (rev 2525)
@@ -172,6 +172,12 @@
init();
} else if (event.getType().equals(Lifecycle.DESTROY_EVENT)) {
destroy();
+ } else if (event.getType().equals(Lifecycle.LOAD_ON_STARTUP_EVENT)) {
+ loadOnStartup();
+ } else if (event.getType().equals(Lifecycle.BEFORE_LOAD_ON_STARTUP_EVENT)) {
+ beforeLoadOnStartup(event.getData());
+ } else if (event.getType().equals(Lifecycle.AFTER_LOAD_ON_STARTUP_EVENT)) {
+ afterLoadOnStartup(event.getData());
}
}
@@ -411,6 +417,18 @@
}
+ protected void loadOnStartup() {
+
+ }
+
+ protected void beforeLoadOnStartup(Object data) {
+
+ }
+
+ protected void afterLoadOnStartup(Object data) {
+
+ }
+
/**
* Process a "stop" event for this Context.
*/
10 years, 2 months
JBossWeb SVN: r2524 - 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-09 08:05:29 -0400 (Thu, 09 Oct 2014)
New Revision: 2524
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java
Log:
Port window size validation fix.
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2014-10-08 21:56:30 UTC (rev 2523)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2014-10-09 12:05:29 UTC (rev 2524)
@@ -91,9 +91,13 @@
// Java SE API (as of Java 8) does not expose the API to
// control the Window size. It is effectively hard-coded
// to 15
- if (serverMaxWindowBits != 15) {
+ if (isServer && serverMaxWindowBits != 15) {
ok = false;
break;
+ // Note server window size is not an issue for the
+ // client since the client will assume 15 and if the
+ // server uses a smaller window everything will
+ // still work
}
} else {
// Duplicate definition
@@ -114,9 +118,17 @@
Integer.valueOf(clientMaxWindowBits));
}
}
- // Not a problem is client specified a window size less
- // than 15 since the server will always use a larger
- // window it will still work.
+ // Java SE API (as of Java 8) does not expose the API to
+ // control the Window size. It is effectively hard-coded
+ // to 15
+ if (!isServer && clientMaxWindowBits != 15) {
+ ok = false;
+ break;
+ // Note client window size is not an issue for the
+ // server since the server will assume 15 and if the
+ // client uses a smaller window everything will
+ // still work
+ }
} else {
// Duplicate definition
throw MESSAGES.duplicateDeflateParameter(CLIENT_MAX_WINDOW_BITS);
10 years, 2 months
JBossWeb SVN: r2523 - 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-08 17:56:30 -0400 (Wed, 08 Oct 2014)
New Revision: 2523
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.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 additional websocket patches.
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2014-10-08 18:19:05 UTC (rev 2522)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2014-10-08 21:56:30 UTC (rev 2523)
@@ -198,8 +198,8 @@
}
}
} else if (written == 0) {
- if (fin && (isServer && !serverContextTakeover ||
- !isServer && !clientContextTakeover)) {
+ if (fin && (isServer && !clientContextTakeover ||
+ !isServer && !serverContextTakeover)) {
inflater.reset();
}
return TransformationResult.END_OF_FRAME;
@@ -411,7 +411,7 @@
private void startNewMessage() {
firstCompressedFrameWritten = false;
- if (isServer && !clientContextTakeover || !isServer && !serverContextTakeover) {
+ if (isServer && !serverContextTakeover || !isServer && !clientContextTakeover) {
deflater.reset();
}
}
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.java 2014-10-08 18:19:05 UTC (rev 2522)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.java 2014-10-08 21:56:30 UTC (rev 2523)
@@ -331,21 +331,23 @@
throws DeploymentException{
List<DecoderEntry> result = new ArrayList<DecoderEntry>();
- for (Class<? extends Decoder> decoderClazz : decoderClazzes) {
- // Need to instantiate decoder to ensure it is valid and that
- // deployment can be failed if it is not
- @SuppressWarnings("unused")
- Decoder instance;
- try {
- instance = decoderClazz.newInstance();
- } catch (InstantiationException e) {
- throw new DeploymentException(MESSAGES.cannotInstatiateDecoder(decoderClazz.getName()), e);
- } catch (IllegalAccessException e) {
- throw new DeploymentException(MESSAGES.cannotInstatiateDecoder(decoderClazz.getName()), e);
+ if (decoderClazzes != null) {
+ for (Class<? extends Decoder> decoderClazz : decoderClazzes) {
+ // Need to instantiate decoder to ensure it is valid and that
+ // deployment can be failed if it is not
+ @SuppressWarnings("unused")
+ Decoder instance;
+ try {
+ instance = decoderClazz.newInstance();
+ } catch (InstantiationException e) {
+ throw new DeploymentException(MESSAGES.cannotInstatiateDecoder(decoderClazz.getName()), e);
+ } catch (IllegalAccessException e) {
+ throw new DeploymentException(MESSAGES.cannotInstatiateDecoder(decoderClazz.getName()), e);
+ }
+ DecoderEntry entry = new DecoderEntry(
+ Util.getDecoderType(decoderClazz), decoderClazz);
+ result.add(entry);
}
- DecoderEntry entry = new DecoderEntry(
- Util.getDecoderType(decoderClazz), decoderClazz);
- result.add(entry);
}
return result;
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-08 18:19:05 UTC (rev 2522)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java 2014-10-08 21:56:30 UTC (rev 2523)
@@ -169,8 +169,7 @@
// Now we have the full pipeline, validate the use of the RSV bits.
if (transformation != null && !transformation.validateRsvBits(0)) {
- // TODO i18n
- throw new ServletException("Incompatible RSV bit usage");
+ throw new ServletException(MESSAGES.incompatibleRsvBitUsage());
}
// If we got this far, all is good. Accept the connection.
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-08 18:19:05 UTC (rev 2522)
+++ branches/7.5.x/src/main/java/org/jboss/web/WebsocketsMessages.java 2014-10-08 21:56:30 UTC (rev 2523)
@@ -335,4 +335,7 @@
@Message(id = 8599, value = "Client requested parameters it could not support")
String unsupportedParameters();
+ @Message(id = 8600, value = "Incompatible RSV bit usage")
+ String incompatibleRsvBitUsage();
+
}
10 years, 2 months
JBossWeb SVN: r2522 - 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-08 14:19:05 -0400 (Wed, 08 Oct 2014)
New Revision: 2522
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Constants.java
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/TransformationFactory.java
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsFrameClient.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 patch adding client support for deflate.
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Constants.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Constants.java 2014-10-07 15:34:13 UTC (rev 2521)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Constants.java 2014-10-08 18:19:05 UTC (rev 2522)
@@ -61,6 +61,8 @@
WS_PROTOCOL_HEADER_NAME.toLowerCase(Locale.ENGLISH);
public static final String WS_EXTENSIONS_HEADER_NAME =
"Sec-WebSocket-Extensions";
+ public static final String WS_EXTENSIONS_HEADER_NAME_LOWER =
+ WS_EXTENSIONS_HEADER_NAME.toLowerCase(Locale.ENGLISH);
public static final boolean STRICT_SPEC_COMPLIANCE =
Boolean.getBoolean(
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2014-10-07 15:34:13 UTC (rev 2521)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2014-10-08 18:19:05 UTC (rev 2522)
@@ -46,6 +46,7 @@
private final int serverMaxWindowBits;
private final boolean clientContextTakeover;
private final int clientMaxWindowBits;
+ private final boolean isServer;
private final Inflater inflater = new Inflater(true);
private final ByteBuffer readBuffer = ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
private final Deflater deflater = new Deflater(Deflater.DEFAULT_COMPRESSION, true);
@@ -56,8 +57,8 @@
private volatile ByteBuffer writeBuffer = ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
private volatile boolean firstCompressedFrameWritten = false;
- static PerMessageDeflate negotiate(List<List<Parameter>> preferences) {
- // Accept the first preference that the server is able to support
+ static PerMessageDeflate negotiate(List<List<Parameter>> preferences, boolean isServer) {
+ // Accept the first preference that the endpoint is able to support
for (List<Parameter> preference : preferences) {
boolean ok = true;
boolean serverContextTakeover = true;
@@ -127,7 +128,7 @@
}
if (ok) {
return new PerMessageDeflate(serverContextTakeover, serverMaxWindowBits,
- clientContextTakeover, clientMaxWindowBits);
+ clientContextTakeover, clientMaxWindowBits, isServer);
}
}
// Failed to negotiate agreeable terms
@@ -136,11 +137,12 @@
private PerMessageDeflate(boolean serverContextTakeover, int serverMaxWindowBits,
- boolean clientContextTakeover, int clientMaxWindowBits) {
+ boolean clientContextTakeover, int clientMaxWindowBits, boolean isServer) {
this.serverContextTakeover = serverContextTakeover;
this.serverMaxWindowBits = serverMaxWindowBits;
this.clientContextTakeover = clientContextTakeover;
this.clientMaxWindowBits = clientMaxWindowBits;
+ this.isServer = isServer;
}
@@ -196,7 +198,8 @@
}
}
} else if (written == 0) {
- if (fin && !serverContextTakeover) {
+ if (fin && (isServer && !serverContextTakeover ||
+ !isServer && !clientContextTakeover)) {
inflater.reset();
}
return TransformationResult.END_OF_FRAME;
@@ -408,7 +411,7 @@
private void startNewMessage() {
firstCompressedFrameWritten = false;
- if (!clientContextTakeover) {
+ if (isServer && !clientContextTakeover || !isServer && !serverContextTakeover) {
deflater.reset();
}
}
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/TransformationFactory.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/TransformationFactory.java 2014-10-07 15:34:13 UTC (rev 2521)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/TransformationFactory.java 2014-10-08 18:19:05 UTC (rev 2522)
@@ -34,9 +34,10 @@
return factory;
}
- public Transformation create(String name, List<List<Extension.Parameter>> preferences) {
+ public Transformation create(String name, List<List<Extension.Parameter>> preferences,
+ boolean isServer) {
if (PerMessageDeflate.NAME.equals(name)) {
- return PerMessageDeflate.negotiate(preferences);
+ return PerMessageDeflate.negotiate(preferences, isServer);
}
throw MESSAGES.unsupportedExtension(name);
}
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsFrameClient.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsFrameClient.java 2014-10-07 15:34:13 UTC (rev 2521)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsFrameClient.java 2014-10-08 18:19:05 UTC (rev 2522)
@@ -31,9 +31,8 @@
private ByteBuffer response;
public WsFrameClient(ByteBuffer response, AsyncChannelWrapper channel,
- WsSession wsSession) {
- // TODO Add support for extensions to the client side code
- super(wsSession, null);
+ WsSession wsSession, Transformation transformation) {
+ super(wsSession, transformation);
this.response = response;
this.channel = channel;
this.handler = new WsFrameClientCompletionHandler();
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-07 15:34:13 UTC (rev 2521)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 2014-10-08 18:19:05 UTC (rev 2522)
@@ -272,6 +272,9 @@
ByteBuffer response;
String subProtocol;
boolean success = false;
+ List<Extension> extensionsAgreed = new ArrayList<Extension>();
+ Transformation transformation = null;
+
try {
fConnect.get(timeout, TimeUnit.MILLISECONDS);
@@ -299,15 +302,43 @@
// Sub-protocol
// Header names are always stored in lower case
- List<String> values = handshakeResponse.getHeaders().get(
+ List<String> protocolHeaders = handshakeResponse.getHeaders().get(
Constants.WS_PROTOCOL_HEADER_NAME_LOWER);
- if (values == null || values.size() == 0) {
+ if (protocolHeaders == null || protocolHeaders.size() == 0) {
subProtocol = null;
- } else if (values.size() == 1) {
- subProtocol = values.get(0);
+ } else if (protocolHeaders.size() == 1) {
+ subProtocol = protocolHeaders.get(0);
} else {
throw new DeploymentException(MESSAGES.invalidProtocolHeader());
}
+
+ // Extensions
+ // Should normally only be one header but handle the case of
+ // multiple headers
+ List<String> extHeaders = handshakeResponse.getHeaders().get(
+ Constants.WS_EXTENSIONS_HEADER_NAME_LOWER);
+ if (extHeaders != null) {
+ for (String extHeader : extHeaders) {
+ Util.parseExtensionHeader(extensionsAgreed, extHeader);
+ }
+ }
+
+ // Build the transformations
+ TransformationFactory factory = TransformationFactory.getInstance();
+ for (Extension extension : extensionsAgreed) {
+ List<List<Extension.Parameter>> wrapper = new ArrayList<List<Extension.Parameter>>(1);
+ wrapper.add(extension.getParameters());
+ Transformation t = factory.create(extension.getName(), wrapper, false);
+ if (t == null) {
+ throw new DeploymentException(MESSAGES.unsupportedParameters());
+ }
+ if (transformation == null) {
+ transformation = t;
+ } else {
+ transformation.setNext(t);
+ }
+ }
+
success = true;
} catch (ExecutionException e) {
throw new DeploymentException(MESSAGES.httpRequestFailed(), e);
@@ -329,12 +360,12 @@
WsRemoteEndpointImplClient wsRemoteEndpointClient = new WsRemoteEndpointImplClient(channel);
WsSession wsSession = new WsSession(endpoint, wsRemoteEndpointClient,
- this, null, null, null, null, null, Collections.<Extension>emptyList(),
+ this, null, null, null, null, null, extensionsAgreed,
subProtocol, Collections.<String,String>emptyMap(), secure,
clientEndpointConfiguration);
WsFrameClient wsFrameClient = new WsFrameClient(response, channel,
- wsSession);
+ wsSession, transformation);
// WsFrame adds the necessary final transformations. Copy the
// completed transformation chain to the remote end point.
wsRemoteEndpointClient.setTransformation(wsFrameClient.getTransformation());
@@ -466,6 +497,7 @@
header.append(value);
}
}
+ result.add(header.toString());
}
return result;
}
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-07 15:34:13 UTC (rev 2521)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java 2014-10-08 18:19:05 UTC (rev 2522)
@@ -260,7 +260,7 @@
for (Map.Entry<String,List<List<Extension.Parameter>>> entry :
extensionPreferences.entrySet()) {
- Transformation transformation = factory.create(entry.getKey(), entry.getValue());
+ Transformation transformation = factory.create(entry.getKey(), entry.getValue(), true);
if (transformation != null) {
result.add(transformation);
}
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-07 15:34:13 UTC (rev 2521)
+++ branches/7.5.x/src/main/java/org/jboss/web/WebsocketsMessages.java 2014-10-08 18:19:05 UTC (rev 2522)
@@ -332,4 +332,7 @@
@Message(id = 8598, value = "Invalid token value %s")
IllegalArgumentException invalidTokenValue(String value);
+ @Message(id = 8599, value = "Client requested parameters it could not support")
+ String unsupportedParameters();
+
}
10 years, 2 months
JBossWeb SVN: r2521 - branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-07 11:34:13 -0400 (Tue, 07 Oct 2014)
New Revision: 2521
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java
Log:
Port cosmetic use of constants from Tomcat.
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-07 06:07:54 UTC (rev 2520)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java 2014-10-07 15:34:13 UTC (rev 2521)
@@ -115,7 +115,7 @@
}
// Sub-protocols
List<String> subProtocols = getTokensFromHeader(req,
- "Sec-WebSocket-Protocol");
+ Constants.WS_PROTOCOL_HEADER_NAME);
subProtocol = sec.getConfigurator().getNegotiatedSubprotocol(
sec.getSubprotocols(), subProtocols);
@@ -123,7 +123,7 @@
// Should normally only be one header but handle the case of multiple
// headers
List<Extension> extensionsRequested = new ArrayList<Extension>();
- Enumeration<String> extHeaders = req.getHeaders("Sec-WebSocket-Extensions");
+ Enumeration<String> extHeaders = req.getHeaders(Constants.WS_EXTENSIONS_HEADER_NAME);
while (extHeaders.hasMoreElements()) {
Util.parseExtensionHeader(extensionsRequested, extHeaders.nextElement());
}
10 years, 2 months
JBossWeb SVN: r2520 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-07 02:07:54 -0400 (Tue, 07 Oct 2014)
New Revision: 2520
Added:
tags/JBOSSWEB_7_5_0_BETA3/
Log:
Beta3 build.
10 years, 2 months
JBossWeb SVN: r2519 - branches/7.5.x.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-07 02:07:24 -0400 (Tue, 07 Oct 2014)
New Revision: 2519
Modified:
branches/7.5.x/pom.xml
Log:
Beta3 build.
Modified: branches/7.5.x/pom.xml
===================================================================
--- branches/7.5.x/pom.xml 2014-10-06 18:45:20 UTC (rev 2518)
+++ branches/7.5.x/pom.xml 2014-10-07 06:07:24 UTC (rev 2519)
@@ -33,7 +33,7 @@
<groupId>org.jboss.web</groupId>
<artifactId>jbossweb</artifactId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.Beta3</version>
<name>JBoss Web</name>
<description>Servlet 3.0 container</description>
10 years, 2 months
JBossWeb SVN: r2518 - branches/7.5.x/src/main/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-06 14:45:20 -0400 (Mon, 06 Oct 2014)
New Revision: 2518
Modified:
branches/7.5.x/src/main/java/org/apache/coyote/http11/Constants.java
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java
Log:
Fix regression with timeout handling with java.io (change back the default too, since it got changed maybe due to some confusion).
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Constants.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Constants.java 2014-10-06 14:52:34 UTC (rev 2517)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Constants.java 2014-10-06 18:45:20 UTC (rev 2518)
@@ -45,7 +45,7 @@
public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
public static final boolean DEFAULT_TCP_NO_DELAY = true;
public static final boolean DEFAULT_DISABLE_UPLOAD_TIMEOUT = Boolean.valueOf(
- System.getProperty("org.apache.coyote.http11.DEFAULT_DISABLE_UPLOAD_TIMEOUT", "false"))
+ System.getProperty("org.apache.coyote.http11.DEFAULT_DISABLE_UPLOAD_TIMEOUT", "true"))
.booleanValue();
public static final boolean DISABLE_KEEPALIVE_ON_CONCLOSE =
Boolean.valueOf(System.getProperty("org.apache.coyote.http11.DISABLE_KEEPALIVE_ON_CONCLOSE", "false")).booleanValue();
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java 2014-10-06 14:52:34 UTC (rev 2517)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java 2014-10-06 18:45:20 UTC (rev 2518)
@@ -840,8 +840,8 @@
}
request.setStartTime(System.currentTimeMillis());
keptAlive = true;
- if (!disableUploadTimeout) {
- Socket.timeoutSet(socket, timeout * 1000);
+ if (!disableUploadTimeout && soTimeout > 0) {
+ Socket.timeoutSet(socket, soTimeout * 1000);
}
inputBuffer.parseHeaders();
} catch (IOException e) {
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java 2014-10-06 14:52:34 UTC (rev 2517)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java 2014-10-06 18:45:20 UTC (rev 2518)
@@ -283,7 +283,7 @@
// Parsing the request header
try {
if (!disableUploadTimeout && keptAlive && soTimeout > 0) {
- endpoint.setSoTimeout(soTimeout * 1000);
+ endpoint.setSoTimeout(soTimeout);
}
if (!inputBuffer.parseRequestLine(keptAlive)) {
@@ -319,8 +319,8 @@
request.setStartTime(System.currentTimeMillis());
keptAlive = true;
- if (!disableUploadTimeout) {
- endpoint.setSoTimeout(timeout * 1000);
+ if (!disableUploadTimeout && soTimeout > 0) {
+ endpoint.setSoTimeout(soTimeout);
}
inputBuffer.parseHeaders();
} catch (IOException e) {
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java 2014-10-06 14:52:34 UTC (rev 2517)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java 2014-10-06 18:45:20 UTC (rev 2518)
@@ -812,16 +812,15 @@
if (keptAlive) {
if (keepAliveTimeout > 0) {
socket.setSoTimeout(keepAliveTimeout);
- }
- else if (soTimeout > 0) {
+ } else if (soTimeout > 0) {
socket.setSoTimeout(soTimeout);
}
}
inputBuffer.parseRequestLine();
request.setStartTime(System.currentTimeMillis());
keptAlive = true;
- if (!disableUploadTimeout) {
- socket.setSoTimeout(timeout);
+ if (!disableUploadTimeout && soTimeout > 0) {
+ socket.setSoTimeout(soTimeout);
}
inputBuffer.parseHeaders();
} catch (IOException e) {
10 years, 2 months
JBossWeb SVN: r2517 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-06 10:52:34 -0400 (Mon, 06 Oct 2014)
New Revision: 2517
Added:
tags/JBOSSWEB_7_5_0_BETA2/
Log:
New beta2 build.
10 years, 2 months