From 76585105247365dd9f84997d933eeabd4303aabd Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 7 Sep 2009 18:36:29 +0200 Subject: preparatory work for proper (i.e. unicast) server->client dbus communication + /* send unicast dbus signal */ + if (!dbus_message_set_destination(msg, pDest)) + die_out_of_memory(); Signed-off-by: Denys Vlasenko --- src/Daemon/Daemon.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Daemon/Daemon.cpp') diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index fc28e8b..149b2bd 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -503,7 +503,8 @@ static gboolean handle_event_cb(GIOChannel *gio, GIOCondition condition, gpointe /* ignore lock files and such */ if (!(event->mask & IN_ISDIR)) { - VERB3 log("File '%s' creation detected, ignoring", name); + // Happens all the time during normal run + //VERB3 log("File '%s' creation detected, ignoring", name); continue; } -- cgit From a4257108013f15653724b5ed3b3c208e071567c5 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 8 Sep 2009 13:16:06 +0200 Subject: abrtd: eliminate g_pending_jobs[] map and all corresponding TODOs :) -6k: text data bss dec hexfilename 194741 2656 2384 199781 30c65abrt.t1/abrt-0.0.8.5/src/Daemon/.libs/abrtd 188316 2648 2320 193284 2f304abrt.t2/abrt-0.0.8.5/src/Daemon/.libs/abrtd Signed-off-by: Denys Vlasenko --- src/Daemon/Daemon.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/Daemon/Daemon.cpp') diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 149b2bd..f680471 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -53,7 +53,7 @@ * v[N]["executable"/"uid"/"kernel"/"backtrace"][N] = "contents" * - CreateReport(UUID): starts creating a report for /var/cache/abrt/DIR with this UUID * Returns job id (uint64) - * - GetJobResult(job_id): returns map_crash_report_t (map_vector_string_t) + * - GetJobResult(UUID): returns map_crash_report_t (map_vector_string_t) * - Report(map_crash_report_t (map_vector_string_t)): * "Please report this crash": calls Report() of all registered reporter plugins * Returns report_status_t (map_vector_string_t) - the status of each call @@ -98,12 +98,7 @@ static GMainLoop* g_pMainloop; int g_verbose; CCommLayerServer* g_pCommLayer; -/* - * Map to cache the results from CreateReport_t - * > - */ -std::map > g_pending_jobs; -/* mutex to protect g_pending_jobs */ + pthread_mutex_t g_pJobsMutex; -- cgit From f3f69b01bc53c21c8ce83dfbd97e05eb7beafc8e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 8 Sep 2009 13:35:45 +0200 Subject: Daemon.cpp: improve dbus API doc in comments. no code changes Signed-off-by: Denys Vlasenko --- src/Daemon/Daemon.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/Daemon/Daemon.cpp') diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index f680471..a7c9737 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -51,8 +51,11 @@ * - GetCrashInfos(): returns a vector_crash_infos_t (vector_map_vector_string_t) * of crashes for given uid * v[N]["executable"/"uid"/"kernel"/"backtrace"][N] = "contents" - * - CreateReport(UUID): starts creating a report for /var/cache/abrt/DIR with this UUID - * Returns job id (uint64) + * - CreateReport(UUID): starts creating a report for /var/cache/abrt/DIR with this UUID. + * Returns job id (uint64). + * Emits JobStarted(client_dbus_ID,job_id) dbus signal. + * After it returns, when report creation thread has finished, + * JobDone(client_dbus_ID,UUID) dbus signal is emitted. * - GetJobResult(UUID): returns map_crash_report_t (map_vector_string_t) * - Report(map_crash_report_t (map_vector_string_t)): * "Please report this crash": calls Report() of all registered reporter plugins @@ -67,7 +70,20 @@ * - SetSettings(map_abrt_settings_t): returns void * * DBus signals we emit: - * - ... + * - Crash(progname,uid) - a new crash occurred (new /var/cache/abrt/DIR is found) + * - JobStarted(client_dbus_ID,job_id) - see CreateReport above. + * 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]) + * - Update(msg,job_id) + * + * 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. */ -- cgit