[PubSubClient] Fix Publish_P return value

PR from [PubSubClient PR 600](https://github.com/knolleary/pubsubclient/pull/600)

N.B. we had this fix already present in ESPeasy before update to 2.7
This commit is contained in:
Gijs Noorlander
2019-05-21 20:30:47 +02:00
parent a115415df2
commit 734d0562be
+3 -1
View File
@@ -445,7 +445,9 @@ boolean PubSubClient::publish_P(const char* topic, const uint8_t* payload, unsig
lastOutActivity = millis();
return rc == tlen + 4 + plength;
// Header (1 byte) + llen + identifier (2 bytes) + topic len + payload len
const int expectedLength = 1 + llen + 2 + tlen + plength;
return (rc == expectedLength);
}
boolean PubSubClient::beginPublish(const char* topic, unsigned int plength, boolean retained) {