From 299410820e92797abbf00db5c97827d37d1c2052 Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Thu, 2 Apr 2015 09:09:06 -0400 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-5155 Attempt to fix additional EOF problem --- .../apache/activemq/transport/ws/jetty8/StompSocket.java | 6 +++--- .../apache/activemq/transport/ws/jetty9/StompSocket.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/StompSocket.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/StompSocket.java index fb1c8d4ab0..39cf0dbd4f 100644 --- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/StompSocket.java +++ b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/StompSocket.java @@ -76,11 +76,11 @@ class StompSocket extends TransportSupport implements WebSocket.OnTextMessage, S try { if (data != null) { - if (data.startsWith("\n")) { + if (data.equals("\n")) { sendToActiveMQ(new KeepAliveInfo()); + } else { + protocolConverter.onStompCommand((StompFrame)wireFormat.unmarshal(new ByteSequence(data.getBytes("UTF-8")))); } - - protocolConverter.onStompCommand((StompFrame)wireFormat.unmarshal(new ByteSequence(data.getBytes("UTF-8")))); } } catch (Exception e) { onException(IOExceptionSupport.create(e)); diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/StompSocket.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/StompSocket.java index 3b04677729..8969b560d0 100644 --- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/StompSocket.java +++ b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/StompSocket.java @@ -136,11 +136,11 @@ class StompSocket extends TransportSupport implements WebSocketListener, StompTr try { if (data != null) { - if (data.startsWith("\n")) { + if (data.equals("\n")) { sendToActiveMQ(new KeepAliveInfo()); + } else { + protocolConverter.onStompCommand((StompFrame)wireFormat.unmarshal(new ByteSequence(data.getBytes("UTF-8")))); } - - protocolConverter.onStompCommand((StompFrame)wireFormat.unmarshal(new ByteSequence(data.getBytes("UTF-8")))); } } catch (Exception e) { onException(IOExceptionSupport.create(e));