activemq-artemis git commit: ARTEMIS-1166 Test client WS transport needs to handle continuations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

activemq-artemis git commit: ARTEMIS-1166 Test client WS transport needs to handle continuations

tabish
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 39fc8cf14 -> 1463a5116


ARTEMIS-1166 Test client WS transport needs to handle continuations

Ensure that the test client WS transport handles continuation frames so
that partial binary payloads aren't dropped.

Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/1463a511
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/1463a511
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/1463a511

Branch: refs/heads/master
Commit: 1463a51164633dcfa1b6996ffe56ef3b23f0990b
Parents: 39fc8cf
Author: Timothy Bish <[hidden email]>
Authored: Tue May 16 11:10:11 2017 -0400
Committer: Timothy Bish <[hidden email]>
Committed: Tue May 16 11:10:11 2017 -0400

----------------------------------------------------------------------
 .../transport/amqp/client/transport/NettyWSTransport.java       | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1463a511/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/transport/NettyWSTransport.java
----------------------------------------------------------------------
diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/transport/NettyWSTransport.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/transport/NettyWSTransport.java
index b96fc71..9b0e6e2 100644
--- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/transport/NettyWSTransport.java
+++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/transport/NettyWSTransport.java
@@ -34,6 +34,7 @@ import io.netty.handler.codec.http.HttpClientCodec;
 import io.netty.handler.codec.http.HttpObjectAggregator;
 import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
 import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame;
+import io.netty.handler.codec.http.websocketx.ContinuationWebSocketFrame;
 import io.netty.handler.codec.http.websocketx.PingWebSocketFrame;
 import io.netty.handler.codec.http.websocketx.PongWebSocketFrame;
 import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
@@ -154,6 +155,10 @@ public class NettyWSTransport extends NettyTcpTransport {
             BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame;
             LOG.trace("WebSocket Client received data: {} bytes", binaryFrame.content().readableBytes());
             listener.onData(binaryFrame.content());
+         } else if (frame instanceof ContinuationWebSocketFrame) {
+            ContinuationWebSocketFrame continuationFrame = (ContinuationWebSocketFrame) frame;
+            LOG.trace("WebSocket Client received data continuation: {} bytes", continuationFrame.content().readableBytes());
+            listener.onData(continuationFrame.content());
          } else if (frame instanceof PingWebSocketFrame) {
             LOG.trace("WebSocket Client received ping, response with pong");
             ch.write(new PongWebSocketFrame(frame.content()));