summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-marshal.c
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@codefactory.se>2003-01-24 23:34:01 +0000
committerAnders Carlsson <andersca@codefactory.se>2003-01-24 23:34:01 +0000
commitdc6a61a15b2d9cdc6504753fa9eb0a718f99d6d8 (patch)
tree49c51aef2648d20651c44b63071ccfa441ae4f48 /dbus/dbus-marshal.c
parentc514c719ec52bba3ad359580c989d0944d2f6ffe (diff)
2003-01-25 Anders Carlsson <andersca@codefactory.se>
* 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.
Diffstat (limited to 'dbus/dbus-marshal.c')
-rw-r--r--dbus/dbus-marshal.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/dbus/dbus-marshal.c b/dbus/dbus-marshal.c
index 148ce08e..9b9e9e62 100644
--- a/dbus/dbus-marshal.c
+++ b/dbus/dbus-marshal.c
@@ -718,9 +718,9 @@ _dbus_demarshal_string_array (DBusString *str,
{
int len, i, j;
char **retval;
-
+
len = _dbus_demarshal_uint32 (str, byte_order, pos, &pos);
-
+
retval = dbus_new (char *, len);
if (!retval)
@@ -734,6 +734,12 @@ _dbus_demarshal_string_array (DBusString *str,
goto error;
}
+ if (new_pos)
+ *new_pos = pos;
+
+ if (array_len)
+ *array_len = len;
+
return retval;
error:
@@ -1033,7 +1039,6 @@ _dbus_marshal_test (void)
/* Marshal signed integer arrays */
if (!_dbus_marshal_int32_array (&str, DBUS_BIG_ENDIAN, array1, 3))
_dbus_assert_not_reached ("could not marshal integer array");
- _dbus_verbose_bytes_of_string (&str, 0, _dbus_string_get_length (&str));
array2 = _dbus_demarshal_int32_array (&str, DBUS_BIG_ENDIAN, pos, &pos, &len);
printf ("length is: %d\n", len);
if (len != 3)