summaryrefslogtreecommitdiff
path: root/dbind
diff options
context:
space:
mode:
authorMike Gorse <mgorse@novell.com>2012-01-15 12:29:56 -0600
committerMike Gorse <mgorse@novell.com>2012-01-15 12:29:56 -0600
commit2291c9e97f9fad6cd7de746e5521b90ddbb56233 (patch)
tree6ba62e1a12935f2f0d03664bbc0f387630348bd0 /dbind
parent9fb0a92c4e05a962d235042e83b0aae5130c34cf (diff)
downloadat-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.c10
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;