diff options
author | Havoc Pennington <hp@redhat.com> | 2004-06-07 19:27:51 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2004-06-07 19:27:51 +0000 |
commit | f7beca572b341c4cabf2f97a9f0d6d763e6acb40 (patch) | |
tree | 9e82c7e0ceedf9a97fa3e68175bd3170afc83900 /dbus/dbus-message-builder.c | |
parent | 41a369c333a2b60deaed307c22c88395f4d12cf6 (diff) |
2004-06-07 Havoc Pennington <hp@redhat.com>
* dbus/dbus-message-builder.c (_dbus_message_data_load): append
random signature when using REQUIRED_FIELDS (this hack won't work
in the long term)
* dbus/dbus-message.c: change the signature to be a header field,
instead of message->signature special-case string. Incremental
step forward. Then we can fix up code to send the signature in the
message, then fix up code to validate said signature, then fix up
code to not put the typecodes inline, etc.
(load_one_message): don't make up the signature after the fact
(decode_header_data): require signature field for the known
message types
* dbus/dbus-marshal.c (_dbus_marshal_string_len): new
* dbus/dbus-protocol.h: add DBUS_HEADER_FIELD_SIGNATURE
Diffstat (limited to 'dbus/dbus-message-builder.c')
-rw-r--r-- | dbus/dbus-message-builder.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/dbus/dbus-message-builder.c b/dbus/dbus-message-builder.c index 2ff13b21..4e1502a6 100644 --- a/dbus/dbus-message-builder.c +++ b/dbus/dbus-message-builder.c @@ -1,7 +1,7 @@ /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-message-builder.c Build messages from text files for testing (internal to D-BUS implementation) * - * Copyright (C) 2003 Red Hat, Inc. + * Copyright (C) 2003, 2004 Red Hat, Inc. * * Licensed under the Academic Free License version 2.0 * @@ -723,6 +723,15 @@ _dbus_message_data_load (DBusString *dest, DBUS_TYPE_OBJECT_PATH, "/blah/blah/path")) goto parse_failed; + + /* FIXME later we'll validate this, and then it will break + * and the .message files will have to include the right thing + */ + if (!append_string_field (dest, endian, + DBUS_HEADER_FIELD_SIGNATURE, + DBUS_TYPE_STRING, + "iii")) + goto parse_failed; } else if (_dbus_string_starts_with_c_str (&line, "BIG_ENDIAN")) @@ -884,6 +893,8 @@ _dbus_message_data_load (DBusString *dest, field = DBUS_HEADER_FIELD_DESTINATION; else if (_dbus_string_starts_with_c_str (&line, "SENDER")) field = DBUS_HEADER_FIELD_SENDER; + else if (_dbus_string_starts_with_c_str (&line, "SIGNATURE")) + field = DBUS_HEADER_FIELD_SIGNATURE; else if (_dbus_string_starts_with_c_str (&line, "UNKNOWN")) field = 22; /* random unknown header field */ else |