Better content-length handling.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@389845 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-03-29 17:52:01 +00:00
parent c80b084cdc
commit 38d8b832ef
2 changed files with 4 additions and 0 deletions

View File

@ -112,6 +112,9 @@ class Send implements StompCommand {
msg.setPersistent(asBool(persistent));
}
// No need to carry the content length in the JMS headers.
headers.remove(Stomp.Headers.CONTENT_LENGTH);
// now the general headers
msg.setProperties(headers);

View File

@ -81,6 +81,7 @@ public class Subscription {
ActiveMQBytesMessage msg = (ActiveMQBytesMessage)m;
byte[] data = new byte[(int)msg.getBodyLength()];
msg.readBytes(data);
builder.addHeader(Stomp.Headers.CONTENT_LENGTH, data.length);
builder.setBody(data);
}