diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index a960a99..bf7e4c9 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -1950,7 +1950,7 @@ _dbus_connection_send_preallocated_unlocked_no_update (DBusConnection *con if (dbus_message_get_serial (message) == 0) { serial = _dbus_connection_get_next_client_serial (connection); - _dbus_message_set_serial (message, serial); + dbus_message_set_serial (message, serial); if (client_serial) *client_serial = serial; } @@ -3208,7 +3208,7 @@ dbus_connection_send_with_reply (DBusConnection *connection, if (serial == 0) { serial = _dbus_connection_get_next_client_serial (connection); - _dbus_message_set_serial (message, serial); + dbus_message_set_serial (message, serial); } if (!_dbus_pending_call_set_timeout_error_unlocked (pending, message, serial)) diff --git a/dbus/dbus-message-factory.c b/dbus/dbus-message-factory.c index ceffc76..ef73a2a 100644 --- a/dbus/dbus-message-factory.c +++ b/dbus/dbus-message-factory.c @@ -222,7 +222,7 @@ generate_from_message (DBusString *data, DBusValidity *expected_validity, DBusMessage *message) { - _dbus_message_set_serial (message, 1); + dbus_message_set_serial (message, 1); _dbus_message_lock (message); *expected_validity = DBUS_VALID; diff --git a/dbus/dbus-message-internal.h b/dbus/dbus-message-internal.h index 7661585..2e995b4 100644 --- a/dbus/dbus-message-internal.h +++ b/dbus/dbus-message-internal.h @@ -37,8 +37,6 @@ void _dbus_message_get_network_data (DBusMessage *message, void _dbus_message_lock (DBusMessage *message); void _dbus_message_unlock (DBusMessage *message); -void _dbus_message_set_serial (DBusMessage *message, - dbus_uint32_t serial); dbus_bool_t _dbus_message_add_size_counter (DBusMessage *message, DBusCounter *counter); void _dbus_message_add_size_counter_link (DBusMessage *message, diff --git a/dbus/dbus-message-util.c b/dbus/dbus-message-util.c index 562190a..1e0b141 100644 --- a/dbus/dbus-message-util.c +++ b/dbus/dbus-message-util.c @@ -949,7 +949,7 @@ _dbus_message_test (const char *test_data_dir) "TestMethod")); _dbus_assert (strcmp (dbus_message_get_path (message), "/org/freedesktop/TestPath") == 0); - _dbus_message_set_serial (message, 1234); + dbus_message_set_serial (message, 1234); /* string length including nul byte not a multiple of 4 */ if (!dbus_message_set_sender (message, "org.foo.bar1")) @@ -1041,7 +1041,7 @@ _dbus_message_test (const char *test_data_dir) "/org/freedesktop/TestPath", "Foo.TestInterface", "TestMethod"); - _dbus_message_set_serial (message, 1); + dbus_message_set_serial (message, 1); dbus_message_set_reply_serial (message, 5678); v_INT16 = -0x123; diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index 2871e5f..cfb73e6 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -163,12 +163,16 @@ _dbus_message_get_network_data (DBusMessage *message, * Sets the serial number of a message. * This can only be done once on a message. * + * D-Bus will set this value for you when marshalling a message. + * This function will generally only be required when encapsulating D-Bus + * in another protocol. + * * @param message the message * @param serial the serial */ -void -_dbus_message_set_serial (DBusMessage *message, - dbus_uint32_t serial) +void +dbus_message_set_serial (DBusMessage *message, + dbus_uint32_t serial) { _dbus_assert (message != NULL); _dbus_assert (!message->locked); diff --git a/dbus/dbus-message.h b/dbus/dbus-message.h index d4e0799..081d9fa 100644 --- a/dbus/dbus-message.h +++ b/dbus/dbus-message.h @@ -131,6 +131,8 @@ dbus_bool_t dbus_message_has_sender (DBusMessage *message, dbus_bool_t dbus_message_has_signature (DBusMessage *message, const char *signature); dbus_uint32_t dbus_message_get_serial (DBusMessage *message); +void dbus_message_set_serial (DBusMessage *message, + dbus_uint32_t serial); dbus_bool_t dbus_message_set_reply_serial (DBusMessage *message, dbus_uint32_t reply_serial); dbus_uint32_t dbus_message_get_reply_serial (DBusMessage *message);