1. 15 Jan, 2005 1 commit
    • Havoc Pennington's avatar
      2005-01-15 Havoc Pennington <hp@redhat.com> · 9c3d566e
      Havoc Pennington authored
      	* Land the new message args API and type system.
      	This patch is huge, but the public API change is not
      	really large. The set of D-BUS types has changed somewhat,
      	and the arg "getters" are more geared toward language bindings;
      	they don't make a copy, etc.
      	There are also some known issues. See these emails for details
      	on this huge patch:
      	* dbus/dbus-marshal-*: all the new stuff
      	* dbus/dbus-message.c: basically rewritten
      	* dbus/dbus-memory.c (check_guards): with "guards" enabled, init
      	freed blocks to be all non-nul bytes so using freed memory is less
      	likely to work right
      	* dbus/dbus-internals.c (_dbus_test_oom_handling): add
      	DBUS_FAIL_MALLOC=N environment variable, so you can do
      	DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or
      	DBUS_FAIL_MALLOC=10 to make it really, really, really slow and
      	* qt/message.cpp: port to the new message args API
      	(operator<<): use str.utf8() rather than str.unicode()
      	(pretty sure this is right from the Qt docs?)
      	* glib/dbus-gvalue.c: port to the new message args API
      	* bus/dispatch.c, bus/driver.c: port to the new message args API
      	* dbus/dbus-string.c (_dbus_string_init_const_len): initialize the
      	"locked" flag to TRUE and align_offset to 0; I guess we never
      	looked at these anyhow, but seems cleaner.
      	* dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING):
      	move allocation padding macro to this header; use it to implement
      	(_DBUS_STRING_STATIC): ability to declare a static string.
      	* dbus/dbus-message.c (_dbus_message_has_type_interface_member):
      	change to return TRUE if the interface is not set.
      	* dbus/dbus-string.[hc]: move the D-BUS specific validation stuff
      	to dbus-marshal-validate.[hc]
      	* dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from
      	* dbus/Makefile.am: cut over from dbus-marshal.[hc]
      	to dbus-marshal-*.[hc]
      	* dbus/dbus-object-tree.c (_dbus_decompose_path): move this
      	function here from dbus-marshal.c
  2. 03 Jan, 2005 2 commits
  3. 02 Jan, 2005 4 commits
  4. 01 Jan, 2005 3 commits
  5. 30 Dec, 2004 1 commit
    • Havoc Pennington's avatar
      - remove DICT type · daaee020
      Havoc Pennington authored
      - add SIGNATURE type
      - fix max name len of 256, should be 255 so it fits in a byte if it's going to be a number
        near 256
      - generalize some of the recursive type marshaling code to share between arrays and variants
      - just started on implementing variant
  6. 28 Dec, 2004 1 commit
  7. 19 Dec, 2004 2 commits
  8. 10 Aug, 2004 1 commit
  9. 07 Jun, 2004 1 commit
    • Havoc Pennington's avatar
      2004-06-07 Havoc Pennington <hp@redhat.com> · f7beca57
      Havoc Pennington authored
      	* 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
  10. 05 Jun, 2004 1 commit
    • Olivier Andrieu's avatar
      2004-06-05 Olivier Andrieu <oliv__a@users.sourceforge.net> · 96f6740f
      Olivier Andrieu authored
      	* dbus/dbus-connection.h, dbus/dbus-connection.c: have object path
      	registration functions take the path argument as char* instead of
      	* dbus/dbus-marshal.h, dbus/dbus-marshal.c (_dbus_decompose_path):
      	split off the path decompostion part of
      	_dbus_demarshal_object_path. Some misc. fixes to silence compiler
      	* glib/dbus-gobject.c, test/test-service.c: update accordingly.
  11. 28 May, 2004 1 commit
    • Michael Meeks's avatar
      2004-05-28 Michael Meeks <michael@ximian.com> · 0123e6a9
      Michael Meeks authored
      	* glib/dbus-gvalue.c (dbus_gvalue_marshal, dbus_gvalue_demarshal):
      	fix no int64 case.
      	* dbus/dbus-string.c (_dbus_string_parse_basic_type): impl.
      	* dbus/dbus-message.c (_dbus_message_iter_get_basic_type),
      	(_dbus_message_iter_get_basic_type_array): impl.
      	drastically simplify ~all relevant _get methods to use these.
      	(dbus_message_iter_append_basic): impl
      	drastically simplify ~all relevant _append methods to use these.
      	* dbus/dbus-message-builder.c (parse_basic_type)
      	(parse_basic_array, lookup_basic_type): impl.
      	(_dbus_message_data_load): prune scads of duplicate /
      	cut & paste coding.
      	* dbus/dbus-marshal.c (_dbus_demarshal_basic_type_array)
      	(_dbus_demarshal_basic_type): implement,
      	(demarshal_and_validate_len/arg): beef up debug.
      	(_dbus_marshal_basic_type, _dbus_marshal_basic_type_array): impl.
  12. 21 Mar, 2004 1 commit
    • Olivier Andrieu's avatar
      * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): accept empty · eacb2afd
      Olivier Andrieu authored
      * dbus/dbus-message.h, bus/dbus-message.c (dbus_message_iter_init)
      (dbus_message_iter_init_dict_iterator): return a dbus_bool_t to
      indicate whether the iterator is empty
      * dbus/dbus-pending-call.c, dbus/dbus-server.c: silence compiler
  13. 12 Mar, 2004 1 commit
  14. 02 Dec, 2003 1 commit
  15. 22 Oct, 2003 1 commit
  16. 21 Oct, 2003 1 commit
    • Havoc Pennington's avatar
      2003-10-20 Havoc Pennington <hp@redhat.com> · 75742242
      Havoc Pennington authored
              hmm, make check is currently not passing.
      	* doc/dbus-specification.xml: add requirement that custom type
      	names follow the same rules as interface names.
      	* dbus/dbus-protocol.h: change some of the byte codes, to avoid
      	duplication and allow 'c' to be 'custom'; dict is now 'm' for
      	* doc/dbus-specification.xml: update type codes to match
      	dbus-protocol.h, using the ASCII byte values. Rename type NAMED to
      	CUSTOM. Add type OBJECT_PATH to the spec.
      2003-10-17  Havoc Pennington  <hp@redhat.com>
      	* bus/driver.c (create_unique_client_name): use "." as separator
      	in base service names instead of '-'
      	* dbus/dbus-string.c (_dbus_string_get_byte): allow getting nul
      	byte at the end of the string
      	* dbus/dbus-internals.h (_DBUS_LIKELY, _DBUS_UNLIKELY): add
      	optimization macros since string validation seems to be a slow
      	* doc/dbus-specification.xml: restrict valid
      	service/interface/member/error names. Add test suite code for the
      	name validation.
      	* dbus/dbus-string.c: limit service/interface/member/error names
      	to [0-9][A-Z][a-z]_
      	* dbus/dbus-connection.c (dbus_connection_dispatch): add missing
      	format arg to verbose spew
      	* glib/dbus-gproxy.c (dbus_gproxy_call_no_reply): if not out of
      	memory, return instead of g_error
      	* test/test-service.c (path_message_func): support emitting a
      	signal on request
      	* dbus/dbus-bus.c (init_connections_unlocked): only fill in
      	activation bus type if DBUS_BUS_ACTIVATION was set; default to
      	assuming the activation bus was the session bus so that services
      	started manually will still register.
      	(init_connections_unlocked): fix so that in OOM situation we get
      	the same semantics when retrying the function
      	* test/test-service.c (main): change to use path registration, to
      	test those codepaths; register with DBUS_BUS_ACTIVATION rather
      	than DBUS_BUS_SESSION
  17. 12 Oct, 2003 2 commits
    • Havoc Pennington's avatar
      2003-10-12 Havoc Pennington <hp@pobox.com> · 4097e94a
      Havoc Pennington authored
              Added test code that 1) starts an actual bus daemon and 2) uses
      	DBusGProxy; fixed bugs that were revealed by the test. Lots
      	more testing possible, but this is the basic framework.
      	* glib/dbus-gproxy.c (dbus_gproxy_manager_unregister): remove
      	empty proxy lists from the proxy list hash
      	* dbus/dbus-message.c (dbus_message_iter_get_args_valist): add a
      	couple of return_if_fail checks
      	* dbus/dbus-pending-call.c (_dbus_pending_call_new): use dbus_new0
      	to allocate, so everything is cleared to NULL as it should be.
      	* glib/dbus-gmain.c (dbus_connection_setup_with_g_main): pass
      	source as data to dbus_connection_set_timeout_functions() as the
      	timeout functions expected
      	* test/glib/run-test.sh: add a little script to start up a message
      	bus and run tests using it
      	* tools/dbus-launch.1: updates
      	* tools/dbus-launch.c (main): add --config-file option
      	* tools/dbus-launch.c (main): remove confusing else if (runprog)
      	that could never be reached.
      	* dbus/dbus-message.c (dbus_message_new_method_return)
      	(dbus_message_new_error, dbus_message_new_signal): set the
      	no-reply-expected flag on all these. Redundant, but may
      	as well be consistent.
    • Havoc Pennington's avatar
      2003-10-11 Havoc Pennington <hp@pobox.com> · 56cc4ae1
      Havoc Pennington authored
      	* test/decode-gcov.c (function_solve_graph): make broken block
      	graph a nonfatal error since it seems to be broken. Need to debug
      	* dbus/dbus-marshal.c (_dbus_type_is_valid): new function since we
      	can't just check type > INVALID < LAST anymore
      	* dbus/dbus-message.c (dbus_message_get_signature): new function
      	(dbus_message_has_signature): new function
      	(struct DBusMessage): add signature field (right now it isn't sent
      	over the wire, just generated on the fly)
      	(dbus_message_copy): copy the signature, and init strings to
      	proper length to avoid some reallocs
      	(dbus_message_iter_init_array_iterator): return void, since it
      	can't fail
      	(dbus_message_iter_init_dict_iterator): return void since it can't fail
      	(_dbus_message_loader_queue_messages): add silly temporary hack to
      	fill in message->signature on load
      	* dbus/dbus-protocol.h: change DBUS_TYPE_* values to be ASCII
      	characters, so they are relatively human-readable.
  18. 25 Sep, 2003 1 commit
    • Mark McLoughlin's avatar
      2003-09-25 Mark McLoughlin <mark@skynet.ie> · 46c072e1
      Mark McLoughlin authored
      	* doc/dbus-specification.sgml: don't require header fields
      	to be 4-byte aligned and specify that fields should be
      	distinguished from padding by the fact that zero is not
      	a valid field name.
      	* doc/TODO: remove re-alignment item and add item to doc
      	the OBJECT_PATH type.
      	* dbus/dbus-message.c:
      	(HeaderField): rename the original member to value_offset
      	and introduce a name_offset member to keep track of where
      	the field actually begins.
      	(adjust_field_offsets): remove.
      	(append_int_field), (append_uint_field),
      	(append_string_field): don't align the start of the header
      	field to a 4-byte boundary.
      	(get_next_field): impl finding the next marhsalled field
      	after a given field.
      	(re_align_field_recurse): impl re-aligning a number of
      	already marshalled fields.
      	(delete_field): impl deleting a field of any type and
      	re-aligning any following fields.
      	(delete_int_or_uint_field), (delete_string_field): remove.
      	(set_int_field), (set_uint_field): no need to re-check
      	that we have the correct type for the field.
      	(set_string_field): ditto and impl re-aligning any
      	following fields.
      	(decode_header_data): update to take into account that
      	the fields aren't 4-byte aligned any more and the new
      	way to distinguish padding from header fields. Also,
      	don't exit when there is too much header padding.
      	(process_test_subdir): print the directory.
      	(_dbus_message_test): add test to make sure a following
      	field is re-aligned correctly after field deletion.
      	* dbus/dbus-string.[ch]:
      	(_dbus_string_insert_bytes): rename from insert_byte and
      	allow the insert of multiple bytes.
      	(_dbus_string_test): test inserting multiple bytes.
      	* dbus/dbus-marshal.c: (_dbus_marshal_set_string): add
      	warning note to docs about having to re-align any
      	marshalled values following the string.
      	* dbus/dbus-message-builder.c:
      	(append_string_field), (_dbus_message_data_load):
      	don't align the header field.
      	* dbus/dbus-auth.c: (process_test_subdir): print the
      	* test/break-loader.c: (randomly_add_one_byte): upd. for
      	insert_byte change.
      	* test/data/invalid-messages/bad-header-field-alignment.message:
      	new test case.
      	* test/data/valid-messages/unknown-header-field.message: shove
      	a dict in the unknown field.
  19. 07 Sep, 2003 1 commit
  20. 03 Sep, 2003 1 commit
    • Havoc Pennington's avatar
      2003-09-01 Havoc Pennington <hp@pobox.com> · d021cfae
      Havoc Pennington authored
      	* glib/dbus-gparser.c: implement
      	* glib/dbus-gobject.c: start implementing skeletons support
      	* configure.in: when disabling checks/assert, also define
  21. 31 Aug, 2003 2 commits
    • Havoc Pennington's avatar
      2003-08-31 Havoc Pennington <hp@pobox.com> · fdb114e5
      Havoc Pennington authored
      	* fix build with --disable-tests
    • Havoc Pennington's avatar
      2003-08-30 Havoc Pennington <hp@pobox.com> · 5fd1e389
      Havoc Pennington authored
      	* 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/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 to explicitly say it's the sender service
  22. 29 Aug, 2003 1 commit
    • Havoc Pennington's avatar
      2003-08-28 Havoc Pennington <hp@pobox.com> · 8d38a2e2
      Havoc Pennington authored
      	purge DBusObjectID
      	* dbus/dbus-connection.c: port to no ObjectID, create a
      	DBusObjectTree, rename ObjectTree to ObjectPath in public API
      	* dbus/dbus-connection.h (struct DBusObjectTreeVTable): delete
      	everything except UnregisterFunction and MessageFunction
      	* dbus/dbus-marshal.c: port away from DBusObjectID,
      	* dbus/dbus-object-registry.[hc], dbus/dbus-object.[hc],
      	dbus/dbus-objectid.[hc]: remove these, we are moving to
      	path-based object IDs
  23. 02 Aug, 2003 1 commit
    • Havoc Pennington's avatar
      2003-08-01 Havoc Pennington <hp@pobox.com> · fe195a91
      Havoc Pennington authored
      	* dbus/dbus-protocol.h (DBUS_MESSAGE_TYPE_*): introduce
      	a message type enum to distinguish kinds of message
      	(DBUS_HEADER_FLAG_NO_REPLY_EXPECTED): flag for a message
      	that need not be replied to
      2003-08-01  Havoc Pennington  <hp@pobox.com>
      	* dbus/dbus-marshal.c: adapt to DBusObjectID changes
      	(unpack_8_octets): fix no-64-bit-int bug
      	* dbus/dbus-object-registry.c (validate_id): validate the
      	connection ID bits, not just the instance ID.
      	* dbus/dbus-connection.c (_dbus_connection_init_id): initialize
      	the connection-global 33 bits of the object ID
      	* dbus/dbus-object-registry.c (info_from_entry): fill in
      	object ID in the new way
      	* dbus/dbus-objectid.h: rather than high/low bits, specifically
      	define server/client/instance bits.
  24. 07 Jul, 2003 1 commit
    • Havoc Pennington's avatar
      2003-07-06 Havoc Pennington <hp@pobox.com> · 3f1ad214
      Havoc Pennington authored
      	* dbus/dbus-marshal.c (_dbus_marshal_set_object_id): new function
      	(_dbus_marshal_object_id): new
      	(_dbus_demarshal_object_id): new
      	(_dbus_marshal_get_arg_end_pos): support object ID type, and
      	consolidate identical switch cases. Don't conditionalize handling
      	of DBUS_TYPE_UINT64, need to handle the type always.
      	(_dbus_marshal_validate_arg): consolidate identical cases, and
      	handle DBUS_TYPE_OBJECT_ID
      	* dbus/dbus-objectid.c: new file with DBusObjectID data type.
      	* dbus/dbus-protocol.h: add DBUS_TYPE_OBJECT_ID
  25. 28 Jun, 2003 1 commit
  26. 12 May, 2003 1 commit
    • Havoc Pennington's avatar
      2003-05-11 Havoc Pennington <hp@pobox.com> · d4e80132
      Havoc Pennington authored
      	* dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix to avoid
      	calling _dbus_marshal_validate_arg() for every byte in a byte
      	array, etc.
      	* dbus/dbus-message-handler.c: use atomic reference counting to
      	reduce number of locks slightly; the global lock in here sucks
      	* dbus/dbus-connection.c
      	(_dbus_connection_update_dispatch_status_and_unlock): variant of
      	update_dispatch_status that can be called with lock held; then use
      	in a couple places to reduce locking/unlocking
      	(dbus_connection_send): hold the lock over the whole function
      	instead of acquiring it twice.
      	* dbus/dbus-timeout.c (_dbus_timeout_new): handle OOM
      	* bus/connection.c (bus_connections_setup_connection): fix access
      	to already-freed memory.
      	* dbus/dbus-connection.c: keep a little cache of linked list
      	nodes, to avoid using the global linked list alloc lock in the
      	normal send-message case. Instead we just use the connection lock
      	that we already have to take.
      	* dbus/dbus-list.c (_dbus_list_find_last): new function
      	* dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec):
      	change to use a struct for the atomic type; fix docs,
      	they return value before increment, not after increment.
      	* dbus/dbus-string.c (_dbus_string_append_4_aligned)
      	(_dbus_string_append_8_aligned): new functions to try to
      	microoptimize this operation.
      	(reallocate_for_length): break this out of set_length(), to
      	improve profile info, and also so we can consider inlining the
      	set_length() part.
      	* dbus/dbus-message.c (dbus_message_new_empty_header): init data
      	strings with some preallocation, cuts down on our calls to realloc
      	a fair bit. Though if we can get the "move entire string to empty
      	string" optimization below to kick in here, it would be better.
      	* dbus/dbus-string.c (_dbus_string_move): just call
      	(_dbus_string_move_len): add a special case for moving
      	an entire string into an empty string; we can just
      	swap the string data instead of doing any reallocs.
      	(_dbus_string_init_preallocated): new function
  27. 09 May, 2003 1 commit
    • Havoc Pennington's avatar
      2003-05-08 Havoc Pennington <hp@pobox.com> · 27b694f6
      Havoc Pennington authored
      	* dbus/dbus-spawn.c: s/_exit/exit/ because it was keeping gcov
      	data from getting written, and there wasn't a good reason to
      	use _exit really.
      	* test/decode-gcov.c (mark_inside_dbus_build_tests): don't count
      	dbus_verbose lines in test coverage
      	(main): add list of functions sorted by # of untested blocks
      	to the coverage report
      	* dbus/dbus-mempool.c: put some test-only code in DBUS_BUILD_TESTS
      	* dbus/dbus-marshal.c (_dbus_marshal_test): extend test coverage
      	* dbus/dbus-message-handler.c (_dbus_message_handler_test):
      	extend test coverage
      	* test/data/auth/cancel.auth-script: test canceling an
      	* dbus/Makefile.am: remove dbus-server-debug.[hc] for now, as they
      	aren't used. in CVS history if we end up needing them.
  28. 05 May, 2003 1 commit
    • Havoc Pennington's avatar
      2003-05-04 Havoc Pennington <hp@pobox.com> · d1c7eefb
      Havoc Pennington authored
      	* dbus/dbus-message-handler.c (_dbus_message_handler_test): add
      	unit test
      	* dbus/dbus-marshal.c (_dbus_demarshal_string_array): fix this
      	function, which assumed length was in # of strings, not bytes
      	* dbus/dbus-message.c (_dbus_message_test): add tests for some
      	missing coverage
      	* dbus/dbus-connection.c
      	(_dbus_connection_queue_received_message): disable function for
      	now, we are only using it in test mode
      	* dbus/dbus-message.c (_dbus_message_loader_queue_messages):
      	remove a mistaken FIXME
  29. 23 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-22 Havoc Pennington <hp@redhat.com> · b29d0c53
      Havoc Pennington authored
      	* dbus/dbus-message.c, dbus/dbus-marshal.c: add 64-bit integer
      	support, and do some code cleanups to share more code and
      	speed up array marshal/demarshal.
      	* dbus-1.0.pc.in (Cflags): put libdir include file in cflags
      	* configure.in: generate dbus-arch-deps.h
      	* dbus/dbus-protocol.h (DBUS_TYPE_INT64, DBUS_TYPE_UINT64): add
      	64-bit typecodes
  30. 10 Apr, 2003 1 commit
    • Alexander Larsson's avatar
      2003-04-10 Alexander Larsson <alexl@redhat.com> · e84c3a03
      Alexander Larsson authored
      	* dbus/dbus-marshal.[ch]:
      	Add array_type_pos argument to _dbus_marshal_validate_arg.
      	Let you pass a NULL end_pos to _dbus_marshal_validate_type.
      	* dbus/dbus-message.[ch]:
      	Multi-dimensional arrays have full type specification in the
      	outermost array. Iter code re-arranged to handle this.
      	Added some more iter tests.
      	* doc/dbus-specification.sgml:
      	Add me to authors.
      	Remove old FIXME.
      	Update new array encoding description.
      	* test/data/invalid-messages/array-with-mixed-types.message:
      	* test/data/valid-messages/array-of-array-of-uint32.message:
      	Change to the new array format.
      	* test/data/invalid-messages/too-short-dict.message:
      	Fix bug in test.
      	* test/data/valid-messages/recursive-types.message:
      	Fix up and extend test.
  31. 08 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-08 Havoc Pennington <hp@redhat.com> · 03663856
      Havoc Pennington authored
      	* test/data/invalid-messages/array-with-mixed-types.message:
      	regression test that fails for the moment
      	* dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): reorder
      	tests for convenience
      	* dbus/dbus-marshal.c (_dbus_marshal_validate_arg): don't allow
      	array of nil, it broke things.
      	* test/data/invalid-messages/array-of-nil.message: regression test
      	* test/data/valid-messages/array-of-array-of-uint32.message:
      	happened to write this so added it to suite