diff options
-rw-r--r-- | lib/CommLayer/CommLayerInner.cpp | 10 | ||||
-rw-r--r-- | src/Daemon/CommLayerServer.h | 1 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 10 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerDBus.h | 1 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerSocket.cpp | 5 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerSocket.h | 2 | ||||
-rw-r--r-- | src/Daemon/Daemon.cpp | 6 |
7 files changed, 11 insertions, 24 deletions
diff --git a/lib/CommLayer/CommLayerInner.cpp b/lib/CommLayer/CommLayerInner.cpp index 5450b41c..b5b8db78 100644 --- a/lib/CommLayer/CommLayerInner.cpp +++ b/lib/CommLayer/CommLayerInner.cpp @@ -44,7 +44,10 @@ void warn_client(const std::string& pMessage) const char* peer = (ki != s_mapClientID.end() ? ki->second.c_str() : NULL); pthread_mutex_unlock(&s_map_mutex); - s_pObs->Warning(pMessage, peer, key); + if (peer) + s_pObs->Warning(pMessage, peer, key); + else /* Bug: someone tries to warn_client() without set_client_name()!? */ + log("Hmm, stray %s: '%s'", __func__, pMessage.c_str()); } void update_client(const std::string& pMessage) @@ -59,5 +62,8 @@ void update_client(const std::string& pMessage) const char* peer = (ki != s_mapClientID.end() ? ki->second.c_str() : NULL); pthread_mutex_unlock(&s_map_mutex); - s_pObs->Status(pMessage, peer, key); + if (peer) + s_pObs->Status(pMessage, peer, key); + else + log("Hmm, stray %s: '%s'", __func__, pMessage.c_str()); } diff --git a/src/Daemon/CommLayerServer.h b/src/Daemon/CommLayerServer.h index 0b1027ac..e87c5c4b 100644 --- a/src/Daemon/CommLayerServer.h +++ b/src/Daemon/CommLayerServer.h @@ -17,7 +17,6 @@ class CCommLayerServer { virtual void JobDone(const char* pDest, const char* pUUID) = 0; virtual void JobStarted(const char* pDest) {}; - virtual void Error(const std::string& pMessage, const char* peer) {} virtual void Update(const std::string& pMessage, const char* peer, uint64_t pJobID) {}; virtual void Warning(const std::string& pMessage, const char* peer, uint64_t pJobID) {}; }; diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index c6908f5f..eb1d133f 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -393,16 +393,6 @@ void CCommLayerServerDBus::JobDone(const char* peer, const char* pUUID) send_flush_and_unref(msg); } -void CCommLayerServerDBus::Error(const std::string& pMessage, const char* peer) -{ - DBusMessage* msg = new_signal_msg("Error", peer); - const char* c_message = pMessage.c_str(); - dbus_message_append_args(msg, - DBUS_TYPE_STRING, &c_message, - DBUS_TYPE_INVALID); - send_flush_and_unref(msg); -} - void CCommLayerServerDBus::Update(const std::string& pMessage, const char* peer, uint64_t job_id) { DBusMessage* msg = new_signal_msg("Update", peer); diff --git a/src/Daemon/CommLayerServerDBus.h b/src/Daemon/CommLayerServerDBus.h index 3a8822de..e1185c5c 100644 --- a/src/Daemon/CommLayerServerDBus.h +++ b/src/Daemon/CommLayerServerDBus.h @@ -15,7 +15,6 @@ class CCommLayerServerDBus virtual void JobStarted(const char* pDest); virtual void JobDone(const char* pDest, const char* pUUID); - virtual void Error(const std::string& pMessage, const char* peer); virtual void Update(const std::string& pMessage, const char* peer, uint64_t pJobID); virtual void Warning(const std::string& pMessage, const char* peer, uint64_t pJobID); }; diff --git a/src/Daemon/CommLayerServerSocket.cpp b/src/Daemon/CommLayerServerSocket.cpp index 8f1fd4fe..b643aaa9 100644 --- a/src/Daemon/CommLayerServerSocket.cpp +++ b/src/Daemon/CommLayerServerSocket.cpp @@ -245,8 +245,3 @@ void CCommLayerServerSocket::Crash(const std::string& arg1) { //Send("(CRASH)New Crash Detected: " + arg1); } - -void CCommLayerServerSocket::Error(const std::string& arg1, const char* peer) -{ - //Send("(ERROR)Error: " + arg1); -} diff --git a/src/Daemon/CommLayerServerSocket.h b/src/Daemon/CommLayerServerSocket.h index 0ee47014..f598841b 100644 --- a/src/Daemon/CommLayerServerSocket.h +++ b/src/Daemon/CommLayerServerSocket.h @@ -32,6 +32,4 @@ class CCommLayerServerSocket : public CCommLayerServer virtual void Crash(const std::string& arg1); virtual void JobStarted(const char* pDest) {}; - - virtual void Error(const std::string& arg1, const char* peer); }; diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index a7c97372..28a6c8a2 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -75,12 +75,12 @@ * Sent as unicast to the client which did CreateReport. * - JobDone(client_dbus_ID,UUID) - see CreateReport above. * Sent as unicast to the client which did CreateReport. - * - Error(msg) - * - Warning(msg[,job_id]) + * - Warning(msg,job_id) * - Update(msg,job_id) + * Both are sent as unicast to last client set by set_client_name(name). + * If set_client_name(NULL) was done, they are not sent. * * TODO: - * - Error/Warning/Update dbus signals must be unicast too * - API does not really need JobStarted dbus signal at all, and JobDone signal * does not need to pass any parameters - out clients never sent multiple * CreateReport's. |