diff --git a/libs/main/io_devices/pipeer.cpp b/libs/main/io_devices/pipeer.cpp index c121dfea..0cf8bd6a 100644 --- a/libs/main/io_devices/pipeer.cpp +++ b/libs/main/io_devices/pipeer.cpp @@ -623,7 +623,10 @@ bool PIPeer::dataRead(const uchar * readed, ssize_t size) { return true; } cnt++; - if (cnt > _PIPEER_MSG_TTL || from == dp->name) return true; + if (cnt > _PIPEER_MSG_TTL || from == dp->name) { + eth_mutex.unlock(); + return true; + } sba << type << from << to << cnt << pba; // piCout << "translate packet" << from << "->" << to << ", ttl =" << cnt; sendToNeighbour(dp, sba); diff --git a/libs/mqtt_client/pimqttclient.cpp b/libs/mqtt_client/pimqttclient.cpp index 60ffb958..133639e5 100644 --- a/libs/mqtt_client/pimqttclient.cpp +++ b/libs/mqtt_client/pimqttclient.cpp @@ -60,7 +60,7 @@ STATIC_INITIALIZER_END PRIVATE_DEFINITION_START(PIMQTT::Client) MQTTClient client = nullptr; - bool connected = false; + std::atomic connected{false}; PIProtectedVariable endpoints;