packages: dbus/dbus-broken-timeout.patch (NEW) - fixes https://bugs.freedes...

megabajt megabajt at pld-linux.org
Thu Oct 1 19:01:40 CEST 2009


Author: megabajt                     Date: Thu Oct  1 17:01:40 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- fixes https://bugs.freedesktop.org/show_bug.cgi?id=24254

---- Files affected:
packages/dbus:
   dbus-broken-timeout.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/dbus/dbus-broken-timeout.patch
diff -u /dev/null packages/dbus/dbus-broken-timeout.patch:1.1
--- /dev/null	Thu Oct  1 19:01:40 2009
+++ packages/dbus/dbus-broken-timeout.patch	Thu Oct  1 19:01:35 2009
@@ -0,0 +1,76 @@
+From 03cc20707a3e7b2d8629e84d7a766f41edb8b444 Mon Sep 17 00:00:00 2001
+From: James Westby <jw+debian at jameswestby.net>
+Date: Thu, 01 Oct 2009 14:09:54 +0000
+Subject: Correct timeout handling
+
+The timeout handling code subtracts the elapsed time from the timeout
+each time a message is received, which drastically reduces the timeout
+in circumstances such as service activation.
+
+Correct so that the timeout is never modified, and the elapsed time
+instead subtracted where necessary.
+
+Signed-off-by: James Westby <jw+debian at jameswestby.net>
+Signed-off-by: Scott James Remnant <scott at ubuntu.com>
+---
+diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
+index a59b1a0..31edd61 100644
+--- a/dbus/dbus-connection.c
++++ b/dbus/dbus-connection.c
+@@ -2392,7 +2392,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *pending)
+            */
+           _dbus_verbose ("dbus_connection_send_with_reply_and_block() waiting for more memory\n");
+ 
+-          _dbus_memory_pause_based_on_timeout (timeout_milliseconds);
++          _dbus_memory_pause_based_on_timeout (timeout_milliseconds - elapsed_milliseconds);
+         }
+       else
+         {          
+@@ -2400,7 +2400,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *pending)
+           _dbus_connection_do_iteration_unlocked (connection,
+                                                   DBUS_ITERATION_DO_READING |
+                                                   DBUS_ITERATION_BLOCK,
+-                                                  timeout_milliseconds);
++                                                  timeout_milliseconds - elapsed_milliseconds);
+         }
+ 
+       goto recheck_status;
+@@ -2409,9 +2409,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *pending)
+     _dbus_verbose ("dbus_connection_send_with_reply_and_block(): clock set backward\n");
+   else if (elapsed_milliseconds < timeout_milliseconds)
+     {
+-      timeout_milliseconds -= elapsed_milliseconds;
+-      _dbus_verbose ("dbus_connection_send_with_reply_and_block(): %d milliseconds remain\n", timeout_milliseconds);
+-      _dbus_assert (timeout_milliseconds >= 0);
++      _dbus_verbose ("dbus_connection_send_with_reply_and_block(): %d milliseconds remain\n", timeout_milliseconds - elapsed_milliseconds);
+       
+       if (status == DBUS_DISPATCH_NEED_MEMORY)
+         {
+@@ -2421,7 +2419,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *pending)
+            */
+           _dbus_verbose ("dbus_connection_send_with_reply_and_block() waiting for more memory\n");
+ 
+-          _dbus_memory_pause_based_on_timeout (timeout_milliseconds);
++          _dbus_memory_pause_based_on_timeout (timeout_milliseconds - elapsed_milliseconds);
+         }
+       else
+         {          
+@@ -2429,14 +2427,14 @@ _dbus_connection_block_pending_call (DBusPendingCall *pending)
+           _dbus_connection_do_iteration_unlocked (connection,
+                                                   DBUS_ITERATION_DO_READING |
+                                                   DBUS_ITERATION_BLOCK,
+-                                                  timeout_milliseconds);
++                                                  timeout_milliseconds - elapsed_milliseconds);
+         }
+ 
+       goto recheck_status;
+     }
+ 
+   _dbus_verbose ("dbus_connection_send_with_reply_and_block(): Waited %ld milliseconds and got no reply\n",
+-                 (tv_sec - start_tv_sec) * 1000 + (tv_usec - start_tv_usec) / 1000);
++                 elapsed_milliseconds);
+ 
+   _dbus_assert (!_dbus_pending_call_get_completed_unlocked (pending));
+   
+--
+cgit v0.8.2
================================================================


More information about the pld-cvs-commit mailing list