fusesource / mqtt-client

A Java MQTT Client
http://mqtt-client.fusesource.org/
Apache License 2.0
1.27k stars 368 forks source link

PUBLISH.decode() can't decode the frame created via PUBLISH.encode() #46

Closed igarashitm closed 9 years ago

igarashitm commented 9 years ago

PUBLISH.encode() puts 2 Buffer entry here: https://github.com/fusesource/mqtt-client/blob/master/mqtt-client/src/main/java/org/fusesource/mqtt/codec/PUBLISH.java#L85

But PUBLISH.decode() only allows 1 Buffer entry: https://github.com/fusesource/mqtt-client/blob/master/mqtt-client/src/main/java/org/fusesource/mqtt/codec/PUBLISH.java#L54 https://github.com/fusesource/mqtt-client/blob/master/mqtt-client/src/main/java/org/fusesource/mqtt/codec/PUBLISH.java#L57

This causes AssertionError, or payload is simply thrown away if JVM assertion is disabled.

igarashitm commented 9 years ago

merged - fusesource/mqtt-client#47