summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-17 13:47:27 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-02-17 13:47:27 +0100
commit1d877ab64664cec3050fd71476bd91a5880db06f (patch)
treee41922209adb8ecc943c586e4c20b57fde3d438f
parent0646606c561cb614583585d107b959fc4c2a38a8 (diff)
downloadabrt-1d877ab64664cec3050fd71476bd91a5880db06f.tar.gz
abrt-1d877ab64664cec3050fd71476bd91a5880db06f.tar.xz
abrt-1d877ab64664cec3050fd71476bd91a5880db06f.zip
added a comment about dbus disconnect handling
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--src/Daemon/CommLayerServerDBus.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp
index 6dfc48b7..36bda965 100644
--- a/src/Daemon/CommLayerServerDBus.cpp
+++ b/src/Daemon/CommLayerServerDBus.cpp
@@ -575,6 +575,27 @@ CCommLayerServerDBus::CCommLayerServerDBus()
VERB3 log("dbus_bus_get");
conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
handle_dbus_err(conn == NULL, &err);
+ // dbus api says:
+ // "If dbus_bus_get obtains a new connection object never before returned
+ // from dbus_bus_get(), it will call dbus_connection_set_exit_on_disconnect(),
+ // so the application will exit if the connection closes. You can undo this
+ // by calling dbus_connection_set_exit_on_disconnect() yourself after you get
+ // the connection."
+ // ...
+ // "When a connection is disconnected, you are guaranteed to get a signal
+ // "Disconnected" from the interface DBUS_INTERFACE_LOCAL, path DBUS_PATH_LOCAL"
+ //
+ // dbus-daemon drops connections if it recvs a malformed message
+ // (we actually observed this when we sent bad UTF-8 string).
+ // Currently, in this case abrtd just exits with exitcode 1.
+ // (symptom: last two log messages are "abrtd: remove_watch()")
+ // If we want to have better logging or other nontrivial handling,
+ // here we need to do:
+ //
+ //dbus_connection_set_exit_on_disconnect(conn, FALSE);
+ //dbus_connection_add_filter(conn, handle_message, NULL, NULL);
+ //
+ // and need to code up handle_message to check for "Disconnected" dbus signal
attach_dbus_conn_to_glib_main_loop(conn, "/com/redhat/abrt", message_received);