diff options
author | Mike Gorse <mgorse@novell.com> | 2012-01-15 12:29:56 -0600 |
---|---|---|
committer | Mike Gorse <mgorse@novell.com> | 2012-01-15 12:29:56 -0600 |
commit | 2291c9e97f9fad6cd7de746e5521b90ddbb56233 (patch) | |
tree | 6ba62e1a12935f2f0d03664bbc0f387630348bd0 /dbind | |
parent | 9fb0a92c4e05a962d235042e83b0aae5130c34cf (diff) | |
download | at-spi2-core-2291c9e97f9fad6cd7de746e5521b90ddbb56233.tar.gz |
Avoid making calls on processes thought to be hung
If a method call times out, record the process as being hung, and send a
ping. Consider the process to be no longer hung when a response to the
ping is received.
Hopefully this will prevent long delays if an AT makes consecutive calls
on an application that is not responding.
Diffstat (limited to 'dbind')
-rw-r--r-- | dbind/dbind.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/dbind/dbind.c b/dbind/dbind.c index 167c3e87..3989bb66 100644 --- a/dbind/dbind.c +++ b/dbind/dbind.c @@ -87,12 +87,18 @@ dbind_send_and_allow_reentry (DBusConnection * bus, DBusMessage * message, DBusE dbus_pending_call_ref (pending); while (!closure->reply) { - if (!dbus_connection_read_write_dispatch (bus, dbind_timeout) || - time_elapsed (&tv) > dbind_timeout) + if (!dbus_connection_read_write_dispatch (bus, dbind_timeout)) { dbus_pending_call_unref (pending); return NULL; } + if (time_elapsed (&tv) > dbind_timeout) + { + dbus_pending_call_unref (pending); + dbus_set_error_const (error, "org.freedesktop.DBus.Error.NoReply", + "timeout from dbind"); + return NULL; + } } ret = closure->reply; |