summaryrefslogtreecommitdiff
path: root/dbus/dbus-object-tree.c
Commit message (Collapse)AuthorAgeFilesLines
* dbus-object-tree test: tolerate OOM in run_decompose_tests()Simon McVittie2017-02-141-1/+5
| | | | | | | | | | | This test is run repeatedly, with simulated out-of-memory conditions at different points. If one of these was during run_decompose_tests(), the test was recorded as failing. Before Philip fixed it, this was masked by the failure not being reported correctly (CID: #54711). Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99758 Reviewed-by: Philip Withnall <withnall@endlessm.com>
* dbus-object-tree: Correctly report failure from an internal testPhilip Withnall2017-02-141-5/+3
| | | | | | | Coverity ID: 54711 Signed-off-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99758 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Remove trailing newlines from _dbus_warn, _dbus_warn_check_failedSimon McVittie2016-09-301-3/+3
| | | | | | | They used to be needed, but are not needed any more, and we were never completely consistent about including them in any case. Signed-off-by: Simon McVittie <smcv@debian.org>
* Remove trailing newlines from _dbus_assert_not_reachedSimon McVittie2016-08-121-1/+1
| | | | | | | | This was never necessary: _dbus_assert_not_reached() always added one. Signed-off-by: Simon McVittie <smcv@debian.org> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97009
* Rename function string_array_length() to _dbus_string_array_length() and ↵Ralf Habacker2016-02-121-15/+7
| | | | | | | move it to dbus-internals.c. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Fix build with --enable-maintainer-mode --disable-embedded-testsThiago Macieira2015-01-271-0/+2
| | | | | | | | Otherwise, we get: dbus/dbus-object-tree.c:323:1: error: 'find_subtree' defined but not used [-Werror=unused-function] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87837 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Merge remote-tracking branch 'fitzsim/fix-parent-removal-fixme'Simon McVittie2013-09-131-36/+403
|\ | | | | | | | | Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60176
| * Don't reference path[1] in warning message if path[0] is NULLThomas Fitzsimmons2013-04-011-1/+1
| |
| * dbus/dbus-object-tree.c: Add test case for parent removal fixThomas Fitzsimmons2013-03-271-0/+10
| |
| * dbus/dbus-object-tree.c: Add test case for parent removal fixThomas Fitzsimmons2013-03-271-0/+83
| |
| * dbus/dbus-object-tree.c: Add test case for parent removal fixThomas Fitzsimmons2013-03-271-0/+25
| |
| * dbus/dbus-object-tree.c: Add test case for parent removal fixThomas Fitzsimmons2013-03-271-0/+11
| |
| * dbus/dbus-object-tree.c: Add test case for parent removal fixThomas Fitzsimmons2013-03-271-0/+15
| |
| * dbus/dbus-object-tree.c: Add test case for parent removal fixThomas Fitzsimmons2013-03-271-0/+24
| |
| * dbus/dbus-object-tree.c: Add test case for parent removal fixThomas Fitzsimmons2013-03-271-0/+24
| |
| * dbus/dbus-object-tree.c (_dbus_object_tree_unregister_and_unlock): Fix FIXMEThomas Fitzsimmons2013-03-271-35/+11
| | | | | | | | | | | | Call unregister_and_free_path_recurse instead of find_subtree. Delete subtree removal logic since it has been refactored into unregister_subtree and attempt_child_removal.
| * dbus/dbus-object-tree.c (unregister_and_free_path_recurse): New functionThomas Fitzsimmons2013-03-271-0/+88
| |
| * dbus/dbus-object-tree.c (attempt_child_removal): New functionThomas Fitzsimmons2013-03-271-0/+46
| |
| * dbus/dbus-object-tree.c (unregister_subtree): New functionThomas Fitzsimmons2013-03-271-0/+45
| |
| * dbus/dbus-object-tree.c: Add reproducer test case for parent removal FIXMEThomas Fitzsimmons2013-03-271-0/+9
| |
| * dbus/dbus-object-tree.c (find_subtree_registered_or_unregistered): New functionThomas Fitzsimmons2013-03-271-0/+11
| |
* | Doc: fix incorrect param names, missing params, non-exist paramsChengwei Yang2013-08-221-0/+1
| | | | | | | | | | | | Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65755
* | tests to embedded tests: replaced in libdbusChengwei Yang2013-06-281-14/+14
|/ | | | | | Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66291
* Merge branch 'dbus-1.4'Simon McVittie2011-07-261-5/+14
|\
| * DBusObjectTree: always access refcount atomicallySimon McVittie2011-07-251-5/+14
| | | | | | | | | | Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38005
* | connection: hook UnknownObject and UnknownInterface up where appropriateLennart Poettering2011-03-111-2/+6
|/ | | | | | | | This makes use of UnknownInterface and UnknownObject where appropriate in the D-Bus core. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34527 Reviewed-By: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Assert in _dbus_decompose_path if path is NULL or len is wrongChristian Dywan2010-07-161-0/+2
|
* Cleaned up _dbus_verbose calls: function names and code line numbers are ↵Ralf Habacker2010-03-271-11/+10
| | | | printed by default.
* Consistently include <config.h> in all C source files and never in header files.Marcus Brinkmann2010-03-191-0/+2
|
* Bug 21161 - Update the FSF addressTobias Mueller2009-07-101-1/+1
| | | | | | No comment. Signed-off-by: Colin Walters <walters@verbum.org>
* _dbus_object_tree_register: don't duplicate check for NULL and use new ↵Simon McVittie2007-10-101-5/+4
| | | | DBUS_ERROR_OBJECT_PATH_IN_USE error, both as per Havoc's review
* Add dbus_connection_try_register_object_path and ↵Simon McVittie2007-10-101-19/+35
| | | | dbus_connection_try_register_fallback, to make object path registration less painful for bindings
* 2007-07-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-141-1/+1
| | | | * Add indent-tabs-mode: nil to all file headers.
* 2006-10-19 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-201-0/+5
| | | | * Fix a pile of Doxygen warnings and missing docs
* * dbus/dbus-object-tree.c (_dbus_object_subtree_new):John (J5) Palmieri2006-08-081-5/+0
| | | | remove dead code
* * dbus/dbus-object-tree.c: Patch by Benjamin OtteJohn (J5) Palmieri2006-08-031-1/+1
| | | | | <in7y118 at public.uni-hamburg dot de> - fix invalid read/write reported by valgrind
* 2005-09-05 Olivier Andrieu <oliv__a@users.sourceforge.net>Olivier Andrieu2005-09-051-71/+53
| | | | | | | | | * dbus/dbus-object-tree.c (find_subtree_recurse): a couple of optimizations (bug #710): - do a binary search in the tree - insert a new child at the right place directly, no need for qsort anymore - do the "double alloc" thing when allocating children
* 2005-04-23 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-04-241-0/+46
| | | | | | | | | | | | | | | | | | | * dbus/dbus-message.c (dbus_message_append_args): fix doc comment, reported by Tony Houghton * test/test-service.c (main): test dbus_connection_get_object_path_data() * dbus/dbus-object-tree.c (find_handler): be sure we always init the exact_match (_dbus_object_tree_get_user_data_unlocked): new function used by dbus_connection_get_object_path_data() (do_register): add assertion test for get_user_data_unlocked (object_tree_test_iteration): more tests * dbus/dbus-connection.c (dbus_connection_get_object_path_data): new function from Dan Reed to let you get the user data from dbus_connection_register_object_path()
* 2005-03-09 Joe Shaw <joeshaw@novell.com>Joe Shaw2005-03-091-1/+5
| | | | | | | * dbus/dbus-object-tree.c (_dbus_object_tree_unregister_and_unlock): If checks are enabled and we try to unregister a path that's not registered, still go through the process of unlocking and don't just return.
* 2005-02-17 Colin Walters <walters@verbum.org>Colin Walters2005-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-protocol.h (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_SERVICE_DBUS. (DBUS_PATH_ORG_FREEDESKTOP_DBUS): Rename to DBUS_PATH_DBUS. (DBUS_PATH_ORG_FREEDESKTOP_LOCAL): Rename to DBUS_PATH_LOCAL. (DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_INTERFACE_DBUS. (DBUS_INTERFACE_ORG_FREEDESKTOP_INTROSPECTABLE): Rename to DBUS_INTERFACE_INTROSPECTABLE. (DBUS_INTERFACE_ORG_FREEDESKTOP_PROPERTIES): Rename to DBUS_INTERFACE_PROPERTIES. (DBUS_INTERFACE_ORG_FREEDESKTOP_PEER): Rename to DBUS_INTERFACE_PEER. (DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL): DBUS_INTERFACE_LOCAL. All other users of those constants have been changed. * bus/driver.c (bus_driver_handle_introspect): Use constants. * glib/dbus-gobject.c (handle_introspect): Use constants. * doc/dbus-faq.xml, doc/dbus-specification.xml: Update for rename.
* 2005-02-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-131-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-object-tree.c (handle_default_introspect_and_unlock): fix a double-unlock * dbus/dbus-connection.c (_dbus_connection_detach_pending_call_unlocked): add this Initial semi-correct pass through to fix thread locking; there are still some issues with the condition variable paths I'm pretty sure * dbus/dbus-server.c: add a mutex on DBusServer and appropriate lock/unlock calls * dbus/dbus-connection.c (_dbus_connection_do_iteration_unlocked): rename to add _unlocked (struct DBusConnection): move "dispatch_acquired" and "io_path_acquired" to use only one bit each. (CONNECTION_LOCK, CONNECTION_UNLOCK): add checks with !DBUS_DISABLE_CHECKS (dbus_connection_set_watch_functions): hacky fix to reentrancy (_dbus_connection_add_watch, _dbus_connection_remove_watch) (_dbus_connection_toggle_watch, _dbus_connection_add_timeout) (_dbus_connection_remove_timeout) (_dbus_connection_toggle_timeout): drop lock when calling out to user functions; done in a hacky/bad way. (_dbus_connection_send_and_unlock): add a missing unlock (_dbus_connection_block_for_reply): add a missing unlock * dbus/dbus-transport.c (_dbus_transport_get_is_authenticated): drop lock in a hacky probably unsafe way to call out to user function
* 2005-02-10 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-101-11/+38
| | | | | | | | | * dbus/dbus-object-tree.c (handle_default_introspect_and_unlock): change to be _and_unlock instead of _unlocked * dbus/dbus-connection.c (_dbus_connection_send_preallocated_unlocked_no_update): rename to have no_update so we can find this bug quickly in future
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-301-0/+30
| | | | | | | | | | | | | | | | | | | | * glib/dbus-gobject.c (introspect_properties): fix the XML generated * dbus/dbus-message.c (dbus_message_unref): add an in_cache flag which effectively detects the use of freed messages * glib/dbus-gobject.c (handle_introspect): modify and return the reply message instead of the incoming message * dbus/dbus-object-tree.c (handle_default_introspect_unlocked): gee, maybe it should SEND THE XML instead of just making a string and freeing it again ;-) * tools/dbus-print-message.c (print_message): improve printing of messages * configure.in: add debug-glib.service to the output
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-301-59/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dbus-viewer introspected and displayed the bus driver * dbus/dbus-object-tree.c (object_tree_test_iteration): add tests for a handler registered on "/" * dbus/dbus-object-tree.c (_dbus_decompose_path): fix to handle path "/" properly (run_decompose_tests): add tests for path decomposition * glib/dbus-gutils.c (_dbus_gutils_split_path): fix to handle "/" properly * glib/dbus-gobject.c (handle_introspect): fix quotes * test/glib/run-test.sh: support launching the bus, then running dbus-viewer * test/glib/test-service-glib.c (main): put in a trivial gobject subclass and register it on the connection * bus/driver.c (bus_driver_handle_introspect): implement introspection of the bus driver service * dbus/dbus-protocol.h: add #defines for the XML namespace, identifiers, doctype decl * bus/driver.c (bus_driver_handle_get_service_owner): handle attempts to get owner of DBUS_SERVICE_ORG_FREEDESKTOP_DBUS by returning the service unchanged. (bus_driver_handle_message): remove old check for reply_serial in method calls, now the message type deals with that (bus_driver_handle_message): handle NULL interface * glib/dbus-gproxy.c (dbus_g_proxy_get_bus_name): new function * glib/dbus-gloader-expat.c (description_load_from_string): allow -1 for len * tools/dbus-viewer.c: add support for introspecting a service on a bus * glib/dbus-gproxy.c (dbus_g_pending_call_ref): add (dbus_g_pending_call_unref): add
* 2005-01-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-151-1/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://lists.freedesktop.org/archives/dbus/2004-December/001836.html http://lists.freedesktop.org/archives/dbus/2005-January/001922.html * 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 thorough. * 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-internals.c * 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
* 2004-08-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-08-101-1/+1
| | | | | * COPYING: switch to Academic Free License version 2.1 instead of 2.0, to resolve complaints about patent termination clause.
* 2004-07-22 Olivier Andrieu <oliv__a@users.sourceforge.net>Olivier Andrieu2004-07-221-7/+6
| | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-sysdeps.c (fill_user_info): fix inexistent label name, breaking build on Solaris, reported by Farhad Saberi on the ML. * dbus/dbus-message.c (dbus_message_append_args_valist): fix the va_arg invocation to account for integer promotion in the case of DBUS_TYPE_BYTE (unsigned char is promoted to int). (bug #901) * bus/services.c (bus_service_remove_owner): fix bug #902, use _dbus_list_get_first_link, not _dbus_list_get_first. * dbus/dbus-bus.c (dbus_bus_service_exists): plug a memory leak. * dbus/dbus-object-tree.c (free_subtree_recurse): always null handler functions so that the asserts in _dbus_object_subtree_unref do not fail. * dbus/dbus-transport-unix.c (do_reading): _dbus_transport_queue_messages return value is of type dbus_bool_t, not DBusDispatchStatus.
* 2004-06-02 Kristian Høgsberg <krh@redhat.com>Kristian Høgsberg2004-06-021-1/+1
| | | | | | | | | | | | | * glib/dbus-gproxy.c, glib/dbus-gmain.c, dbus/dbus-string.c, dbus/dbus-object-tree.c, dbus/dbus-message.c: add comments to quiet doxygen. * Doxyfile.in: remove deprecated options. * dbus/dbus-message-handler.c, dbus/dbus-message-handler.h, glib/test-thread.h, glib/test-thread-client.c, glib/test-thread-server.c, glib/test-profile.c, glib/test-dbus-glib.c: remove these unused files.
* 2004-06-01 Olivier Andrieu <oliv__a@users.sourceforge.net>Olivier Andrieu2004-06-011-84/+123
| | | | | | | | | | * dbus/dbus-object-tree.c (_dbus_object_tree_dispatch_and_unlock): fix dispatch for non-fallback handlers (bug #684). (_dbus_object_subtree_new): initialize invoke_as_fallback field. (find_subtree_recurse): report wether the returned subtree is an exact match or a "fallback" match higher up in the tree. (object_tree_test_iteration): update test case.
* 2004-05-21 Olivier Andrieu <oliv__a@users.sourceforge.net>Olivier Andrieu2004-05-211-3/+60
| | | | | | | | | | * dbus/dbus-object-tree.c (_dbus_object_tree_list_registered_unlock, lookup_subtree): return children even if the requested path isn't registered. (object_tree_test_iteration): test object_tree_list_registered. * configure.in: undefine HAVE_ABSTRACT_SOCKETS instead of defining it to 0.