From dc6a61a15b2d9cdc6504753fa9eb0a718f99d6d8 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Fri, 24 Jan 2003 23:34:01 +0000 Subject: 2003-01-25 Anders Carlsson * dbus/dbus-connection.c: (dbus_connection_send_message): Unlock the message in case it was sent earlier. (dbus_connection_send_message_with_reply_and_block): Remove the reply message from the list. * dbus/dbus-marshal.c: (_dbus_demarshal_string_array): Set array_len and new_pos correctly. (_dbus_marshal_test): Remove debug output. * dbus/dbus-message-internal.h: * dbus/dbus-message.c: (_dbus_message_get_reply_serial): New function that returns the reply serial. (_dbus_message_unlock): New function that unlocks a message and resets its header. (dbus_message_append_string_array), (dbus_message_get_fields_valist), (dbus_message_iter_get_field_type), (dbus_message_iter_get_string_array), (dbus_message_get_fields), (dbus_message_append_fields_valist): Handle string arrays. (dbus_message_set_sender): Make this function public since the bus daemon needs it. (decode_header_data): Set the reply serial to -1 initially. * dbus/dbus-message.h: Add dbus_message_set_sender. --- dbus/dbus-connection.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'dbus/dbus-connection.c') diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index e8ff5b6a..9fcabb9c 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -644,6 +644,9 @@ dbus_connection_send_message (DBusConnection *connection, _dbus_verbose ("Message %p added to outgoing queue, %d pending to send\n", message, connection->n_outgoing); + /* Unlock the message, resetting its header. */ + _dbus_message_unlock (message); + serial = _dbus_connection_get_next_client_serial (connection); _dbus_message_set_client_serial (message, serial); @@ -728,9 +731,6 @@ dbus_connection_send_message_with_reply (DBusConnection *connection, * time. I think there probably has to be a loop: "while (!timeout_elapsed) * { check_for_reply_in_queue(); iterate_with_remaining_timeout(); }" * - * @todo need to remove the reply from the message queue, or someone - * else might process it again later. - * * @param connection the connection * @param message the message to send * @param timeout_milliseconds timeout in milliseconds or -1 for default @@ -771,6 +771,7 @@ dbus_connection_send_message_with_reply_and_block (DBusConnection *connectio if (_dbus_message_get_reply_serial (reply) == client_serial) { + _dbus_list_remove (&connection->incoming_messages, link); dbus_message_ref (message); if (result) -- cgit