eclipse-paho / eclipse-paho/paho.mqtt.java
decode receiveMaximum use readShort cause the problem
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 919
- PR merge metrics
- No merged PRs in 30d
Description
when send only one message to broker,there is error as follow。
正在进行过多的发布
(32202)
at org.eclipse.paho.mqttv5.client.internal.ClientState.send(ClientState.java:544)
at org.eclipse.paho.mqttv5.client.internal.ClientComms.internalSend(ClientComms.java:155)
at org.eclipse.paho.mqttv5.client.internal.ClientComms.sendNoWait(ClientComms.java:218)
at org.eclipse.paho.mqttv5.client.MqttAsyncClient.publish(MqttAsyncClient.java:1530)
at org.eclipse.paho.mqttv5.client.MqttAsyncClient.publish(MqttAsyncClient.java:1499)
the reason is the server return receiveMaximum as 65535, and MqttProperties#decodeProperties use readShort to read value ,the result is -1, so cause the problem。 shoule use readUnsignShort instead to read receiveMaximum value
Contributor guide
Research direction
Start by locating MqttProperties#decodeProperties and inspect how the receiveMaximum property is decoded. Reproduce the case with a broker returning receiveMaximum 65535, then verify the client accepts that value and no longer reports excessive publishing; add or run the relevant MQTT property decoding tests if present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100