Commit ed30280f070a27065685fb21bfca704c4ee3c6fa
1 parent
ca0cf29e
last changes.
Showing
1 changed file
with
8 additions
and
8 deletions
src/clientpaho.cpp
@@ -669,7 +669,7 @@ std::int32_t ClientPaho::publishInternal( const MqttMessage& message, int qos ) | @@ -669,7 +669,7 @@ std::int32_t ClientPaho::publishInternal( const MqttMessage& message, int qos ) | ||
669 | // the insertion of the token into the pending operations. | 669 | // the insertion of the token into the pending operations. |
670 | 670 | ||
671 | // OSDEV_COMPONENTS_LOCKGUARD(m_mutex); | 671 | // OSDEV_COMPONENTS_LOCKGUARD(m_mutex); |
672 | - auto rc = MQTTAsync_sendMessage(m_client, message.topic().c_str(), &msg, &opts); | 672 | + auto rc = MQTTAsync_sendMessage( m_client, message.topic().c_str(), &msg, &opts ); |
673 | if( MQTTASYNC_SUCCESS != rc ) | 673 | if( MQTTASYNC_SUCCESS != rc ) |
674 | { | 674 | { |
675 | LogDebug( "[ClientPaho::publishInterval]", std::string( m_clientId + " - publish on topic " + message.topic() + " failed with code " + pahoAsyncErrorCodeToString( rc ) ) ); | 675 | LogDebug( "[ClientPaho::publishInterval]", std::string( m_clientId + " - publish on topic " + message.topic() + " failed with code " + pahoAsyncErrorCodeToString( rc ) ) ); |
@@ -693,7 +693,7 @@ std::int32_t ClientPaho::subscribeInternal( const std::string& topic, int qos ) | @@ -693,7 +693,7 @@ std::int32_t ClientPaho::subscribeInternal( const std::string& topic, int qos ) | ||
693 | // Need to lock the mutex because it is possible that the callback is faster than | 693 | // Need to lock the mutex because it is possible that the callback is faster than |
694 | // the insertion of the token into the pending operations. | 694 | // the insertion of the token into the pending operations. |
695 | OSDEV_COMPONENTS_LOCKGUARD(m_mutex); | 695 | OSDEV_COMPONENTS_LOCKGUARD(m_mutex); |
696 | - auto rc = MQTTAsync_subscribe(m_client, topic.c_str(), qos, &opts); | 696 | + auto rc = MQTTAsync_subscribe( m_client, topic.c_str(), qos, &opts ); |
697 | if (MQTTASYNC_SUCCESS != rc) | 697 | if (MQTTASYNC_SUCCESS != rc) |
698 | { | 698 | { |
699 | m_pendingSubscriptions.erase( topic ); | 699 | m_pendingSubscriptions.erase( topic ); |
@@ -737,7 +737,7 @@ bool ClientPaho::isOverlappingInternal( const std::string& topic, std::string& e | @@ -737,7 +737,7 @@ bool ClientPaho::isOverlappingInternal( const std::string& topic, std::string& e | ||
737 | 737 | ||
738 | for( const auto& s : m_subscriptions ) | 738 | for( const auto& s : m_subscriptions ) |
739 | { | 739 | { |
740 | - if( testForOverlap(s.first, topic ) ) | 740 | + if( testForOverlap( s.first, topic ) ) |
741 | { | 741 | { |
742 | existingTopic = s.first; | 742 | existingTopic = s.first; |
743 | return true; | 743 | return true; |
@@ -746,9 +746,9 @@ bool ClientPaho::isOverlappingInternal( const std::string& topic, std::string& e | @@ -746,9 +746,9 @@ bool ClientPaho::isOverlappingInternal( const std::string& topic, std::string& e | ||
746 | return false; | 746 | return false; |
747 | } | 747 | } |
748 | 748 | ||
749 | -void ClientPaho::pushIncomingEvent(std::function<void()> ev) | 749 | +void ClientPaho::pushIncomingEvent( std::function<void()> ev ) |
750 | { | 750 | { |
751 | - m_callbackEventQueue.push(ev); | 751 | + m_callbackEventQueue.push( ev ); |
752 | } | 752 | } |
753 | 753 | ||
754 | void ClientPaho::callbackEventHandler() | 754 | void ClientPaho::callbackEventHandler() |
@@ -767,19 +767,19 @@ void ClientPaho::callbackEventHandler() | @@ -767,19 +767,19 @@ void ClientPaho::callbackEventHandler() | ||
767 | ev(); | 767 | ev(); |
768 | } | 768 | } |
769 | } | 769 | } |
770 | - // ("ClientPaho", "%1 - leaving callback event handler", m_clientId); | 770 | + LogDebug( "[ClientPaho::callbackEventHandler]", std::string( m_clientId + " - leaving callback event handler" ) ); |
771 | } | 771 | } |
772 | void ClientPaho::onConnectOnInstance( const std::string& cause ) | 772 | void ClientPaho::onConnectOnInstance( const std::string& cause ) |
773 | { | 773 | { |
774 | (void) cause; | 774 | (void) cause; |
775 | { | 775 | { |
776 | OSDEV_COMPONENTS_LOCKGUARD(m_mutex); | 776 | OSDEV_COMPONENTS_LOCKGUARD(m_mutex); |
777 | - std::copy(m_subscriptions.begin(), m_subscriptions.end(), std::inserter(m_pendingSubscriptions, m_pendingSubscriptions.end())); | 777 | + std::copy( m_subscriptions.begin(), m_subscriptions.end(), std::inserter( m_pendingSubscriptions, m_pendingSubscriptions.end() ) ); |
778 | m_subscriptions.clear(); | 778 | m_subscriptions.clear(); |
779 | m_processPendingPublishes = true; // all publishes are on hold until publishPending is called. | 779 | m_processPendingPublishes = true; // all publishes are on hold until publishPending is called. |
780 | } | 780 | } |
781 | 781 | ||
782 | - setConnectionStatus(ConnectionStatus::Connected); | 782 | + setConnectionStatus( ConnectionStatus::Connected ); |
783 | } | 783 | } |
784 | 784 | ||
785 | void ClientPaho::onConnectSuccessOnInstance() | 785 | void ClientPaho::onConnectSuccessOnInstance() |