Skip to content

Commit d79fcf4

Browse files
authored
Merge branch 'master' into master
2 parents 1077b28 + 30880ad commit d79fcf4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=TBPubSubClient
22
version=2.9.4
3-
author=Nick O'Leary <nick.oleary@gmail.com>
3+
author=ThingsBoard <info@thingsboard.io>
44
maintainer=ThingsBoard Team
55
sentence=A client library for MQTT messaging.
66
paragraph=MQTT is a lightweight messaging protocol ideal for small devices. This library allows you to send and receive MQTT messages. It supports the latest MQTT 3.1.1 protocol and can be configured to use the older MQTT 3.1 if needed. It supports all Arduino Ethernet Client compatible hardware, including the Intel Galileo/Edison, ESP8266 and TI CC3000.

src/PubSubClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ boolean PubSubClient::loop() {
445445
loop_read();
446446
if (connected()) {
447447
unsigned long t = millis();
448-
if ((t - lastInActivity > this->keepAlive*1000UL) || (t - lastOutActivity > this->keepAlive*1000UL)) {
448+
if (((t - lastInActivity > this->keepAlive*1000UL) || (t - lastOutActivity > this->keepAlive*1000UL)) && keepAlive != 0) {
449449
if (pingOutstanding) {
450450
this->_state = MQTT_CONNECTION_TIMEOUT;
451451
_client->stop();
@@ -504,7 +504,7 @@ boolean PubSubClient::publish(const char* topic, const uint8_t* payload, unsigne
504504
}
505505

506506
boolean PubSubClient::publish_P(const char* topic, const char* payload, boolean retained) {
507-
return publish_P(topic, (const uint8_t*)payload, payload ? strnlen(payload, this->bufferSize) : 0, retained);
507+
return publish_P(topic, (const uint8_t*)payload, payload ? strnlen_P(payload, this->bufferSize) : 0, retained);
508508
}
509509

510510
boolean PubSubClient::publish_P(const char* topic, const uint8_t* payload, unsigned int plength, boolean retained) {

0 commit comments

Comments
 (0)