diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-04-07 17:56:35 +0200 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-04-07 17:56:35 +0200 |
| commit | 0e96f49ddb33421efcdd55d543439f622e707164 (patch) | |
| tree | 128a52ac7736a94933128a80842a935ea62619f0 /lib/CommLayer | |
| parent | 72a96c03f783e55daff80d331811bc43198283fd (diff) | |
| download | abrt-0e96f49ddb33421efcdd55d543439f622e707164.tar.gz abrt-0e96f49ddb33421efcdd55d543439f622e707164.tar.xz abrt-0e96f49ddb33421efcdd55d543439f622e707164.zip | |
Fixed dbus commlayer
Diffstat (limited to 'lib/CommLayer')
| -rw-r--r-- | lib/CommLayer/CommLayerServer.h | 7 | ||||
| -rw-r--r-- | lib/CommLayer/CommLayerServerDBus.cpp | 32 | ||||
| -rw-r--r-- | lib/CommLayer/CommLayerServerDBus.h | 7 | ||||
| -rw-r--r-- | lib/CommLayer/DBusServerProxy.h | 2 |
4 files changed, 37 insertions, 11 deletions
diff --git a/lib/CommLayer/CommLayerServer.h b/lib/CommLayer/CommLayerServer.h index e4a5170..fc76cc9 100644 --- a/lib/CommLayer/CommLayerServer.h +++ b/lib/CommLayer/CommLayerServer.h @@ -2,6 +2,7 @@ #include <map> #include <string> #include <sstream> +#include <iostream> #include "MiddleWare.h" #include "Observer.h" @@ -37,7 +38,7 @@ class CCommLayerServer{ */ public: /* just stubs to be called when not implemented in specific comm layer */ - void Crash(const std::string& arg1) {} - void AnalyzeComplete(map_crash_report_t arg1) {} - void Error(const std::string& arg1) {} + virtual void Crash(const std::string& arg1) {} + virtual void AnalyzeComplete(map_crash_report_t arg1) {} + virtual void Error(const std::string& arg1) {} }; diff --git a/lib/CommLayer/CommLayerServerDBus.cpp b/lib/CommLayer/CommLayerServerDBus.cpp index a62ed2e..5bcecf2 100644 --- a/lib/CommLayer/CommLayerServerDBus.cpp +++ b/lib/CommLayer/CommLayerServerDBus.cpp @@ -26,14 +26,19 @@ CCommLayerServerDBus::~CCommLayerServerDBus() delete m_pDispatcher; } -vector_crash_infos_t CCommLayerServerDBus::GetCrashInfos(const std::string &pUID) +vector_crash_infos_t CCommLayerServerDBus::GetCrashInfos(const std::string &pDBusSender) { vector_crash_infos_t retval; - /* vector_crash_infos_t crash_info; - m_pMW->GetCrashInfos("501"); - for (vector_crash_infos_t::iterator it = crash_info.begin(); it!=crash_info.end(); ++it) { - std::cerr << it->m_sExecutable << std::endl; - }*/ + unsigned long unix_uid = m_pConn->sender_unix_uid(pDBusSender.c_str()); + try + { + retval = m_pMW->GetCrashInfos(to_string(unix_uid)); + } + catch(std::string err) + { + std::cerr << err << std::endl; + } + Notify("Sent crash info"); return retval; } @@ -114,3 +119,18 @@ bool CCommLayerServerDBus::DeleteDebugDump(const std::string& pUUID, const std:: } return true; } + +void CCommLayerServerDBus::Crash(const std::string& arg) +{ + CDBusServer_adaptor::Crash(arg); +} + +void CCommLayerServerDBus::AnalyzeComplete(map_crash_report_t arg1) +{ + CDBusServer_adaptor::AnalyzeComplete(arg1); +} + +void CCommLayerServerDBus::Error(const std::string& arg1) +{ + CDBusServer_adaptor::Error(arg1); +} diff --git a/lib/CommLayer/CommLayerServerDBus.h b/lib/CommLayer/CommLayerServerDBus.h index c5715c9..ba730ac 100644 --- a/lib/CommLayer/CommLayerServerDBus.h +++ b/lib/CommLayer/CommLayerServerDBus.h @@ -3,6 +3,7 @@ #include <dbus-c++/dbus.h> #include <dbus-c++/glib-integration.h> #include "DBusServerProxy.h" +#include <iostream> class CCommLayerServerDBus : public CCommLayerServer, @@ -18,10 +19,14 @@ class CCommLayerServerDBus CCommLayerServerDBus(CMiddleWare *m_pMW); virtual ~CCommLayerServerDBus(); - virtual vector_crash_infos_t GetCrashInfos(const std::string &pUID); + virtual vector_crash_infos_t GetCrashInfos(const std::string &pDBusSender); virtual dbus_vector_map_crash_infos_t GetCrashInfosMap(const std::string &pDBusSender); virtual map_crash_report_t CreateReport(const std::string &pUUID,const std::string &pDBusSender); virtual bool Report(map_crash_report_t pReport); virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pDBusSender); + + void Crash(const std::string& arg1); + void AnalyzeComplete(map_crash_report_t arg1); + void Error(const std::string& arg1); }; diff --git a/lib/CommLayer/DBusServerProxy.h b/lib/CommLayer/DBusServerProxy.h index 2d52d15..a79a826 100644 --- a/lib/CommLayer/DBusServerProxy.h +++ b/lib/CommLayer/DBusServerProxy.h @@ -131,7 +131,7 @@ private: DBus::MessageIter ri = call.reader(); std::string argin1; ri >> argin1; - vector_crash_infos_t argout1 = GetCrashInfos(argin1); + vector_crash_infos_t argout1 = GetCrashInfos(call.sender()); DBus::ReturnMessage reply(call); DBus::MessageIter wi = reply.writer(); wi << argout1; |
