summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Bouchet-Valat <nalimilan@club.fr>2010-08-19 22:31:38 +0200
committerMilan Bouchet-Valat <nalimilan@club.fr>2010-08-20 11:49:51 +0200
commit64526025f39e13934f566ad30f118a64a84d783e (patch)
treec23a99e519705a783b4508f2e8aecb38618738a6
parentdc7ef9dbc145fe3d56a11d2e6745e252ebcf3b34 (diff)
Set D-Bus timeout to max for replies from modules
Some tasks can take a long time to complete, and modules don't reply until they are done. Increase the timeout to avoid sending an error to the clients in that case. Clients can still use a short timeout if they want, and they'll get the same error message. liboobs 2.31.91 takes advantage of this with oobs_object_commit_async(), by setting a long timeout too.
-rw-r--r--dispatcher/dispatcher.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dispatcher/dispatcher.c b/dispatcher/dispatcher.c
index 6047734..23dea17 100644
--- a/dispatcher/dispatcher.c
+++ b/dispatcher/dispatcher.c
@@ -480,7 +480,10 @@ dispatch_stb_message (StbDispatcher *dispatcher,
/* forward the message to the corresponding service */
dbus_message_set_destination (copy, destination);
- dbus_connection_send_with_reply (priv->connection, copy, &pending_call, -1);
+
+ /* Ideally, modules should reply quickly, possibly saying operation is still pending.
+ * Since they currently block without replying, set the timeout to something long. */
+ dbus_connection_send_with_reply (priv->connection, copy, &pending_call, INT_MAX);
if (pending_call)
{