Let the protocol converter handle setting the version after it forwards the CONNECTED frame. 

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1398833 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2012-10-16 14:59:37 +00:00
parent 47ee52e5d3
commit 46824cedc7
1 changed files with 4 additions and 7 deletions

View File

@ -16,10 +16,6 @@
*/
package org.apache.activemq.transport.stomp;
import org.apache.activemq.transport.tcp.TcpTransport;
import org.apache.activemq.util.ByteArrayOutputStream;
import org.apache.activemq.util.DataByteArrayInputStream;
import java.io.ByteArrayInputStream;
import java.util.Arrays;
import java.util.Collections;
@ -27,6 +23,10 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import org.apache.activemq.transport.tcp.TcpTransport;
import org.apache.activemq.util.ByteArrayOutputStream;
import org.apache.activemq.util.DataByteArrayInputStream;
public class StompCodec {
final static byte[] crlfcrlf = new byte[]{'\r','\n','\r','\n'};
@ -64,9 +64,6 @@ public class StompCodec {
action = wf.parseAction(data);
headers = wf.parseHeaders(data);
try {
if (action.equals(Stomp.Commands.CONNECT) || action.equals(Stomp.Commands.STOMP)) {
wf.setStompVersion(detectVersion(headers));
}
String contentLengthHeader = headers.get(Stomp.Headers.CONTENT_LENGTH);
if ((action.equals(Stomp.Commands.SEND) || action.equals(Stomp.Responses.MESSAGE)) && contentLengthHeader != null) {
contentLength = wf.parseContentLength(contentLengthHeader);