Fixed bug in Publish Encoder/Decoder

This commit is contained in:
selva.andre
2012-07-26 23:29:01 +02:00
parent 275b6fc1e1
commit 530704d31e
3 changed files with 48 additions and 6 deletions
@@ -37,9 +37,9 @@ public class PublishEncoder implements MessageEncoder<PublishMessage> {
byte flags = Utils.encodeFlags(message);
IoBuffer buff = IoBuffer.allocate(4 + variableHeaderSize);
IoBuffer buff = IoBuffer.allocate(2 + variableHeaderSize);
buff.put((byte) (AbstractMessage.PUBLISH << 4 | flags));
buff.put(Utils.encodeRemainingLength(4 + variableHeaderSize));
buff.put(Utils.encodeRemainingLength(variableHeaderSize));
buff.put(variableHeaderBuff).flip();
out.write(buff);