diff -Naur --exclude '*.swp' dbus-1.2.14.orig/dbus/dbus-connection.c dbus-1.2.14.bug-19796-v2/dbus/dbus-connection.c --- dbus-1.2.14.orig/dbus/dbus-connection.c 2009-05-06 17:51:18.000000000 +0100 +++ dbus-1.2.14.bug-19796-v2/dbus/dbus-connection.c 2009-06-04 18:04:51.000000000 +0100 @@ -3167,12 +3167,25 @@ * @returns #FALSE if no memory, #TRUE otherwise. * */ + +DBUS_DEPRECATED dbus_bool_t dbus_connection_send_with_reply (DBusConnection *connection, DBusMessage *message, DBusPendingCall **pending_return, int timeout_milliseconds) { + return dbus_connection_send_with_reply_setup (connection, message, pending_return, NULL, NULL, timeout_milliseconds); +} + +dbus_bool_t +dbus_connection_send_with_reply_setup (DBusConnection *connection, + DBusMessage *message, + DBusPendingCall **pending_return, + DBusPendingCallSetup pending_setup, + void *setup_user_data, + int timeout_milliseconds) +{ DBusPendingCall *pending; dbus_int32_t serial = -1; DBusDispatchStatus status; @@ -3181,6 +3194,11 @@ _dbus_return_val_if_fail (message != NULL, FALSE); _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE); + if (pending_return && (!pending_setup)) + { + _dbus_warn ("Using **pending_return in dbus_connection_send_with_reply_setup() without pending_setup is deprecated and strongly discouraged\n"); + } + if (pending_return) *pending_return = NULL; @@ -3189,7 +3207,6 @@ if (!_dbus_connection_get_is_connected_unlocked (connection)) { CONNECTION_UNLOCK (connection); - return TRUE; } @@ -3222,6 +3239,9 @@ pending)) goto error; + if (pending_setup) + pending_setup(pending, setup_user_data); + if (!_dbus_connection_send_unlocked_no_update (connection, message, NULL)) { _dbus_connection_detach_pending_call_and_unlock (connection, @@ -3300,8 +3320,8 @@ _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, NULL); _dbus_return_val_if_error_is_set (error, NULL); - if (!dbus_connection_send_with_reply (connection, message, - &pending, timeout_milliseconds)) + if (!dbus_connection_send_with_reply_setup (connection, message, + &pending, NULL, NULL, timeout_milliseconds)) { _DBUS_SET_OOM (error); return NULL; diff -Naur --exclude '*.swp' dbus-1.2.14.orig/dbus/dbus-connection.h dbus-1.2.14.bug-19796-v2/dbus/dbus-connection.h --- dbus-1.2.14.orig/dbus/dbus-connection.h 2009-04-17 20:45:29.000000000 +0100 +++ dbus-1.2.14.bug-19796-v2/dbus/dbus-connection.h 2009-06-04 17:45:02.000000000 +0100 @@ -47,6 +47,7 @@ typedef struct DBusPreallocatedSend DBusPreallocatedSend; /** Opaque type representing a method call that has not yet received a reply. */ typedef struct DBusPendingCall DBusPendingCall; +typedef void (*DBusPendingCallSetup)(DBusPendingCall *pending, void *user_data); /** Opaque type representing a connection to a remote application and associated incoming/outgoing message queues. */ typedef struct DBusConnection DBusConnection; /** Set of functions that must be implemented to handle messages sent to a particular object path. */ @@ -199,10 +200,17 @@ dbus_bool_t dbus_connection_send (DBusConnection *connection, DBusMessage *message, dbus_uint32_t *client_serial); +DBUS_DEPRECATED dbus_bool_t dbus_connection_send_with_reply (DBusConnection *connection, DBusMessage *message, DBusPendingCall **pending_return, int timeout_milliseconds); +dbus_bool_t dbus_connection_send_with_reply_setup (DBusConnection *connection, + DBusMessage *message, + DBusPendingCall **pending_return, + DBusPendingCallSetup pending_setup, + void *setup_user_data, + int timeout_milliseconds); DBusMessage * dbus_connection_send_with_reply_and_block (DBusConnection *connection, DBusMessage *message, int timeout_milliseconds,