Skip to content

Commit 3516774

Browse files
committed
updated libs
1 parent c7cc3e2 commit 3516774

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/MQTTClient.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Contributors:
1414
* Ian Craggs - initial API and implementation and/or initial documentation
1515
* Ian Craggs - fix for bug 458512 - QoS 2 messages
16+
* Ian Craggs - fix for bug 460389 - send loop uses wrong length
1617
*******************************************************************************/
1718

1819
#if !defined(MQTTCLIENT_H)
@@ -323,7 +324,7 @@ int MQTT::Client<Network, Timer, a, b>::sendPacket(int length, Timer& timer)
323324

324325
while (sent < length && !timer.expired())
325326
{
326-
rc = ipstack.write(&sendbuf[sent], length, timer.left_ms());
327+
rc = ipstack.write(&sendbuf[sent], length - sent, timer.left_ms());
327328
if (rc < 0) // there was an error writing the data
328329
break;
329330
sent += rc;

0 commit comments

Comments
 (0)