2006-10-13 Havoc Pennington <hp@redhat.com>
authorHavoc Pennington <hp@redhat.com>
Fri, 13 Oct 2006 16:26:47 +0000 (16:26 +0000)
committerHavoc Pennington <hp@redhat.com>
Fri, 13 Oct 2006 16:26:47 +0000 (16:26 +0000)
* dbus/dbus-connection.c
(dbus_connection_send_with_reply_and_block): fix to handle closed
connections, from Tambet Ingo bug #8631

ChangeLog
dbus/dbus-connection.c

index 615be30..9dec4b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-13  Havoc Pennington  <hp@redhat.com>
+
+       * dbus/dbus-connection.c
+       (dbus_connection_send_with_reply_and_block): fix to handle closed
+       connections, from Tambet Ingo bug #8631
+
 2006-10-11  John (J5) Palmieri  <johnp@redhat.com>
 
        * configure.in: use AC_TRY_COMPILE for dirfd instead of AC_TRY_RUN
index a94e0b2..7a38a0a 100644 (file)
@@ -2619,7 +2619,7 @@ reply_handler_timeout (void *data)
  * 
  * @param connection the connection
  * @param message the message to send
- * @param pending_return return location for a #DBusPendingCall object, or #NULLif connection is disconnected
+ * @param pending_return return location for a #DBusPendingCall object, or #NULL if connection is disconnected
  * @param timeout_milliseconds timeout in milliseconds or -1 for default
  * @returns #FALSE if no memory, #TRUE otherwise.
  *
@@ -3089,7 +3089,11 @@ dbus_connection_send_with_reply_and_block (DBusConnection     *connection,
       return NULL;
     }
 
-  _dbus_assert (pending != NULL);
+  if (pending == NULL)
+    {
+      dbus_set_error (error, DBUS_ERROR_DISCONNECTED, "Connection is closed");
+      return NULL;
+    }
   
   dbus_pending_call_block (pending);