提交 5714645c 编写于 作者: I Ian Craggs

fix for bug 460389 - send loop uses wrong length

Bug: 460389
上级 0ee27376
......@@ -13,6 +13,7 @@
* Contributors:
* Ian Craggs - initial API and implementation and/or initial documentation
* Ian Craggs - fix for bug 458512 - QoS 2 messages
* Ian Craggs - fix for bug 460389 - send loop uses wrong length
*******************************************************************************/
#if !defined(MQTTCLIENT_H)
......@@ -323,7 +324,7 @@ int MQTT::Client<Network, Timer, a, b>::sendPacket(int length, Timer& timer)
while (sent < length && !timer.expired())
{
rc = ipstack.write(&sendbuf[sent], length, timer.left_ms());
rc = ipstack.write(&sendbuf[sent], length - sent, timer.left_ms());
if (rc < 0) // there was an error writing the data
break;
sent += rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册