* [issue #869] Added 'LWT' to last will topic and improved CPU load
See #869 for discussion on Last Will Topic.
Also changed the way it tried to reconnect to make it return a lot faster when connection is not (yet) possible and call the PubSubClient::loop() at a much slower pace to reduce CPU usage. (See #847)
This higher CPU load was probably introduced when fixing #683.
* [MQTT] Fix error reporting success status with longer payloads
Applied PR https://github.com/knolleary/pubsubclient/pull/360/files
* made MQTT_CALLBACK_SIGNATURE for esp32 functional
Applied PR https://github.com/knolleary/pubsubclient/pull/336
* [crashes] Added constructors to initialize all members in structs
Numerous structs are defined, but none of them have default constructors and there is no guarantee the members will be set when used.
With these default constructors, the parameters at least have an initialized value.
* [PubSubClient] Add bound checks on the internal buffer
Not sure if this was really causing an issue, but proper bound checks are always a good thing.
* [Crash Switch] Disabled delayBackground and added yield() calls
Something really fishy is going on with the delayBackground function, which will result in crashes when pressing the switch multiple times, with Domoticz MQTT enabled as first controller.
Disabled for now and delay(1) added to give background tasks a chance to do their work and make sure the watchdog doesn't perform a reset.
* [CI build errors] Commented out some unused variables
Travis considers them as error and fails the checks.
* [CI check] Out-of-bounds check fix
As discussed in pull request #629 and the new issue #658 and also on https://github.com/knolleary/pubsubclient/issues/375
In short, the PubSubClient does not store the domainname used to connect to, but only a pointer to the string.
However, PubSubClient should not expect this pointer to remain valid, since it is outside its scope. So PubSubClient should keep the domainname stored in its own variables.
This fixes the problem where the MQTT broker is no longer reachable after a while when using DNS instead of IP.