Commit graph

6 commits

Author SHA1 Message Date
Mark McLoughlin
daf8d6579e 2003-09-21 Mark McLoughlin <mark@skynet.ie>
* doc/dbus-specification.sgml: Change the header field name
        to be an enum and update the rest of the spec to reference
        the fields using the conventinal name.

        * dbus/dbus-protocol.h: update to reflect the spec.

        * doc/TODO: add item to remove the 4 byte alignment requirement.

        * dbus/dbus-message.c: Remove the code to generalise the
        header/body length and serial number header fields as named
        header fields so we can reference field names using the
        protocol values.
        (append_int_field), (append_uint_field), (append_string_field):
        Append the field name as a byte rather than four chars.
        (delete_int_or_uint_field), (delete_string_field): reflect the
        fact that the field name and typecode now occupy 4 bytes instead
        of 8.
        (decode_string_field), (decode_header_data): update to reflect
        protocol changes and move the field specific encoding from
        decode_string_field() back into decode_header_data().

        * dbus/dbus-internals.[ch]: (_dbus_header_field_to_string):
        Add utility to aid debugging.

        * dbus/dbus-message-builder.c:
        (append_string_field), (_dbus_message_data_load): Update to
        reflect protocol changes; Change the FIELD_NAME directive
        to HEADER_FIELD and allow it to take the field's conventional
        name rather than the actual value.

        * test/data/*/*.message: Update to use HEADER_FIELD instead
        of FIELD_NAME; Always align the header on an 8 byte boundary
        *before* updating the header length.
2003-09-21 18:43:20 +00:00
Havoc Pennington
5fd1e389e1 2003-08-30 Havoc Pennington <hp@pobox.com>
* test/data/valid-config-files/system.d/test.conf: change to
	root for the user so warnings don't get printed

	* dbus/dbus-message.c: add dbus_message_get_path,
	dbus_message_set_path

	* dbus/dbus-object-tree.c (do_test_dispatch): add test of
	dispatching to a path

	* dbus/dbus-string.c (_dbus_string_validate_path): add

	* dbus/dbus-marshal.c (_dbus_demarshal_object_path): implement
	(_dbus_marshal_object_path): implement

	* dbus/dbus-protocol.h (DBUS_HEADER_FIELD_PATH): new header field
	to contain the path to the target object
	(DBUS_HEADER_FIELD_SENDER_SERVICE): rename
	DBUS_HEADER_FIELD_SENDER to explicitly say it's the sender service
2003-08-31 01:51:44 +00:00
Havoc Pennington
68a3c593b9 2003-08-18 Havoc Pennington <hp@redhat.com>
* dbus/dbus-hash.c (_dbus_hash_table_insert_two_strings): fix

	* dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
	dumb bug created earlier (wrong order of args to
	decode_header_data())

	* tools/dbus-send.c: port

	* tools/dbus-print-message.c (print_message): port

        * test/data/*messages: port all messages over

        * dbus/dbus-message-builder.c: support including
	message type

        * bus/driver.c: port over

	* bus/dispatch.c: port over to new stuff

	* dbus/dbus-connection.c (_dbus_connection_new_for_transport):
	rename disconnect signal to "Disconnected"
2003-08-18 22:43:30 +00:00
Alexander Larsson
c5020ac870 2003-04-08 Alexander Larsson <alexl@redhat.com>
Implemented recursive types, named types and new-style iters

	* bus/driver.c:
	* glib/test-thread-client.c: (thread_func):
	* glib/test-thread-server.c: (handle_test_message):
	* test/test-service.c: (handle_echo):
	Update to new api

	* dbus/Makefile.am:
	* dbus/dbus-dict.c:
	* dbus/dbus-dict.h:
	* dbus/dbus.h
	Remove DBusDict

	* dbus/dbus-internals.c: (_dbus_type_to_string):
	Update for new types.

	* dbus/dbus-marshal.[ch]:
	Implement recursive types and the new marshalling format.
	Remove hardcoded dict marshalling.
	Marshal named types.

	* dbus/dbus-message-builder.c:
	Add BYTE_ARRAY.
	Remove references to old types

	* dbus/dbus-message.[ch]:
	New non-refcounted iter API that supports recursive iters.
	Use iters for appending, including support for recursive
	iters.
	Add byte and named type support.
	Update everything to new marshalling formats.
	Add tests for new API.

	* dbus/dbus-protocol.h:
	Remove old array types.
	Add types: BYTE, ARRAY, DICT, NAMED

	* dbus/dbus-string.c:
	* dbus/dbus-sysdeps.c:
	Make parse_double locale safe.

	* dbus/dbus-test-main.c:
	Call setlocale.

	* dbus/dbus-test.c:
	Kill dict test

	* doc/dbus-specification.sgml:
	Update spec

	* test/data/incomplete-messages/missing-body.message:
	* test/data/invalid-messages/bad-boolean.message:
	* test/data/invalid-messages/bad-boolean-array.message:
	* test/data/invalid-messages/boolean-array-length-too-long.message-raw:
	* test/data/invalid-messages/boolean-has-no-value.message-raw:
	* test/data/invalid-messages/too-short-dict.message:
	* test/data/valid-messages/dict-simple.message:
	* test/data/valid-messages/dict.message:
	* test/data/valid-messages/emptiness.message:
	* test/data/valid-messages/lots-of-arguments.message:
	* test/data/valid-messages/no-padding.message:
	* test/data/valid-messages/recursive-types.message:
	Add missing NAME fields
	Fix up dicts & arrays

	* test/data/invalid-messages/dict-with-nil-value.message:
	Removed, this is not invalid anymore.

	* test/data/valid-messages/recursive-types.message:
	Add new test for deeply recursive types.
2003-04-08 15:52:51 +00:00
Havoc Pennington
29560adcc7 2003-03-12 Havoc Pennington <hp@redhat.com>
Mega-patch that gets the message bus daemon initially handling
	out-of-memory. Work still needed. Also lots of random
	moving stuff to DBusError instead of ResultCode.

	* dbus/dbus-list.c (_dbus_list_length_is_one): new function

	* dbus/dbus-connection.c
	(dbus_connection_send_with_reply_and_block): use DBusError

	* dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
	DBusResultCode

	* dbus/dbus-connection.c (dbus_connection_send): drop the result
	code here, as the only failure possible is OOM.

	* bus/connection.c (bus_connection_disconnect):
	rename bus_connection_disconnected as it's a notification only

	* bus/driver.c (bus_driver_handle_acquire_service): don't free
	"name" on get_args failure, should be done by get_args;
	don't disconnect client for bad args, just return an error.
	(bus_driver_handle_service_exists): ditto

	* bus/services.c (bus_services_list): NULL-terminate returned array

	* bus/driver.c (bus_driver_send_service_lost)
	(bus_driver_send_service_acquired): send messages from driver to a
	specific client to the client's unique name, not to the broadcast
	service.

	* dbus/dbus-message.c (decode_header_data): reject messages that
	contain no name field
	(_dbus_message_get_client_serial): rename to
	dbus_message_get_serial and make public
	(_dbus_message_set_serial): rename from set_client_serial
	(_dbus_message_set_reply_serial): make public
	(_dbus_message_get_reply_serial): make public

	* bus/connection.c (bus_connection_foreach): allow stopping
	iteration by returning FALSE from foreach function.

	* dbus/dbus-connection.c (dbus_connection_send_preallocated)
	(dbus_connection_free_preallocated_send)
	(dbus_connection_preallocate_send): new API for sending a message
	without possibility of malloc failure.
	(dbus_connection_send_message): rename to just
	dbus_connection_send (and same for whole function family)

	* dbus/dbus-errors.c (dbus_error_free): make this reinit the error

	* dbus/dbus-sysdeps.c (_dbus_exit): new function

	* bus/activation.c: handle/return errors

	* dbus/dbus-errors.h: add more DBUS_ERROR #define

	* dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
	(_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
	(_dbus_result_from_errno): move to this file
2003-03-13 00:56:43 +00:00
Havoc Pennington
f7d96bdf80 2003-03-02 Havoc Pennington <hp@pobox.com>
* test/break-loader.c (randomly_set_extreme_ints): add test that
	sets really huge and small integers

	* dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
	that length of boolean array fits in the string, and that
	string has room for boolean value in single-bool case.

	* dbus/dbus-message-builder.c (_dbus_message_data_load): add
	optional value to "ALIGN" command which is what to fill the
	alignment with.

	* test/data/valid-messages/no-padding.message: add regression
	test for the message padding problem
2003-03-02 17:34:30 +00:00