You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/08/03 01:01:24 UTC

[2/2] activemq-artemis git commit: Fix ExtraStompTest

Fix ExtraStompTest


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

Branch: refs/heads/master
Commit: df193060e61f5e49dc6a1de4238fa991dc63f8ac
Parents: e8e871c
Author: jbertram <jb...@apache.org>
Authored: Tue Aug 2 16:37:32 2016 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Aug 2 21:01:14 2016 -0400

----------------------------------------------------------------------
 .../activemq/artemis/core/protocol/stomp/StompSession.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/df193060/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
index 2a853a0..1ab7c42 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
@@ -45,6 +45,7 @@ import org.apache.activemq.artemis.core.server.impl.ServerSessionImpl;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.spi.core.protocol.SessionCallback;
 import org.apache.activemq.artemis.spi.core.remoting.ReadyListener;
+import org.apache.activemq.artemis.utils.ByteUtil;
 import org.apache.activemq.artemis.utils.ConfigurationHelper;
 import org.apache.activemq.artemis.utils.PendingTask;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
@@ -149,7 +150,7 @@ public class StompSession implements SessionCallback {
             ActiveMQBuffer qbuff = newServerMessage.getBodyBuffer();
             int bytesToRead = qbuff.writerIndex() - MessageImpl.BODY_OFFSET;
             Inflater inflater = new Inflater();
-            inflater.setInput(qbuff.readBytes(bytesToRead).toByteBuffer().array());
+            inflater.setInput(ByteUtil.getActiveArray(qbuff.readBytes(bytesToRead).toByteBuffer()));
 
             //get the real size of large message
             long sizeBody = newServerMessage.getLongProperty(Message.HDR_LARGE_BODY_SIZE);
@@ -193,6 +194,9 @@ public class StompSession implements SessionCallback {
          return length;
       }
       catch (Exception e) {
+         if (ActiveMQStompProtocolLogger.LOGGER.isDebugEnabled()) {
+            ActiveMQStompProtocolLogger.LOGGER.debug(e);
+         }
          return 0;
       }
       finally {