summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-message.c
Commit message (Collapse)AuthorAgeFilesLines
* * dbus/dbus-message.c:John (J5) Palmieri2005-06-151-0/+92
| | | | | | | | | | | | | | | | | | | | | | | | | (dbus_message_has_path): New method (dbus_message_has_interface): New method (dbus_message_has_member): New method * dbus/dbus/dbus-sysdeps.c (_dbus_check_dir_is_private_to_user): New method * dbus/dbus-keyring.c (_dbus_keyring_reload): Check to see that the keyring directory is private to the user * doc/TODO: - The convenience functions in dbus-bus.h should perhaps have the signatures that they would have if they were autogenerated stubs. e.g. the acquire service function. We should also evaluate which of these functions to include, in light of the fact that GLib/Qt native stubs will probably also exist.: Punted - add dbus_message_has_path(), maybe has_member/interface: fixed in this patch - in dbus-keyring.c, enforce that the keyring dir is not world readable/writable: Fixed in this patch
* * dbus/dbus-marshal-validate.h: Added a new validationJohn (J5) Palmieri2005-06-151-1/+6
| | | | | | | | | | | | | | | | | | | | | | | error code DBUS_VALIDITY_UNKNOWN_OOM_ERROR = -4 for out of memory errors when validating signitures * dbus/dbus-marshal-header.c: use DBUS_VALIDITY_UNKNOWN_OOM_ERROR in places where we previously used DBUS_VALID and a FALSE return value to indicate OOM * dbus/dbus-marshal-validate.c (_dbus_validate_signature_with_reason): Use a stack to track the number of elements inside containers. The stack values are then used to validate that dict entries have only two elements within them. (validate_body_helper): check the reason for failure when validating varients * dbus/dbus-message.c (load_message): use DBUS_VALIDITY_UNKNOWN_OOM_ERROR in places where we previously used DBUS_VALID and a FALSE return value to indicate OOM * doc/TODO: remove "- validate dict entry number of fields" as this patch fixes it
* 2005-05-11 Colin Walters <walters@verbum.org>Colin Walters2005-05-111-1/+52
| | | | | | | | | | | | | | | | | * dbus/dbus-signature.c (dbus_signature_iter_get_signature): New function, returns signature string for signature iter. * dbus/dbus-signature.h: Prototype it. * dbus/dbus-message.c (dbus_message_iter_get_signature): New function, returns signature string for message iter. (dbus_message_iter_get_array_len): New function, returns length of array. (dbus_message_iter_get_fixed_array): Fix assertion; this function should be used when the iter is pointing to the contents of an array * dbus/dbus-message.h: Prototypes. * dbus/dbus-marshal-recursive.c (_dbus_type_reader_get_array_length): New function; returns length of an array. * dbus/dbus-marshal-recursive.h: Prototype it.
* 2005-04-23 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-04-241-15/+5
| | | | | | | | | | | | | | | | | | | * 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 Colin Walters <walters@verbum.org>Colin Walters2005-03-091-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-gproxy.c (dbus_g_proxy_invoke): New method; calls to this are generated for client-side wrappers. Invokes a D-BUS method and returns reply values. * glib/dbus-binding-tool-glib.c (write_args_sig_for_direction): New function; writes signature string for argument direction. (write_args_for_direction): Change to pass input values directly instead of via address, and fix indentation. (generate_client_glue): Change to invoke dbus_g_proxy_invoke. Also make generated wrappers inlineable. * dbus/dbus-message.c (dbus_message_iter_get_fixed_array): Add note about using dbus_type_is_fixed. * dbus/dbus-marshal-basic.c (_dbus_type_is_fixed): Moved to dbus/dbus-signature.c as dbus_type_is_fixed. All callers updated. * dbus/dbus-signature.c (dbus_type_is_fixed): Moved here from dbus/dbus-marshal-basic.c:_dbus_type_is_fixed. * dbus/dbus-signature.h: Prototype. * glib/dbus-binding-tool-glib.c (compute_marshaller_name): Fix error printf code. * test/glib/test-dbus-glib.c (main): Be sure to clear error as appropriate instead of just freeing it. (main): Free returned strings using g_free. * test/glib/Makefile.am (test-service-glib-glue.h) (test-service-glib-bindings.h): Add dependency on dbus-binding-tool. * glib/dbus-gvalue.c (MAP_BASIC): Refactored from MAP_BASIC_INIT; simply maps a simple D-BUS type to GType. (dbus_dbus_type_to_gtype): Function which maps D-BUS type to GType. (dbus_gvalue_init): Just invoke dbus_dbus_type_to_gtype and initialize the value with it. (dbus_gvalue_binding_type_from_type): Unused, delete. (dbus_gvalue_demarshal): Switch to hardcoding demarshalling for various types instead of unmarshalling to value data directly. Remove can_convert boolean. (dbus_gvalue_marshal): Remove duplicate initialization; switch to returning directly instead of using can_convert boolean. (dbus_gvalue_store): New function; not related to D-BUS per-se. Stores a GValue in a pointer to a value of its corresponding C type. * glib/dbus-gvalue.h: Remove dbus_gvalue_binding_type_from_type, add dbus_gvalue_store.
* 2005-02-25 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | * doc/dbus-specification.xml: document the GUID thing * dbus/dbus-server.c (_dbus_server_init_base): initialize a globally unique ID for the server, and put a "guid=hexencoded" field in the address * dbus/dbus-bus.c: fix missing #include of dbus-threads-internal.h * dbus/dbus-message.c: ditto * dbus/dbus-dataslot.c: ditto * dbus/dbus-list.c: ditto * dbus/dbus-internals.h: wait, just include dbus-threads-internal.h here * dbus/dbus-string.c (_dbus_string_copy_to_buffer): move back for use in main library * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes_buffer): new function
* 2005-02-24 Colin Walters <walters@verbum.org>Colin Walters2005-02-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-signature.c: New file; implements various functions related to type signatures. Includes an interator for parsing, validation functions. (dbus_type_is_basic): Moved here from dbus-marshal-basic.c:_dbus_type_is_basic. (dbus_type_is_container): Moved here from dbus-marshal-basic.c:_dbus_type_is_container. All callers of _dbus_type_is_container and _dbus_type_is_basic updated, and include dbus-signature.h. * dbus/dbus-signature.h: New file; prototypes for the above. * dbus/Makefile.am (DBUS_LIB_SOURCES): Add dbus-signature.c, dbus-signature.h. * dbus/dbus-marshal-basic.c (map_type_char_to_type): New utility function factored out of _dbus_first_type_in_signature. (_dbus_first_type_in_signature_c_str): New function; returns first type code for a type signature character. * dbus/dbus-marshal-basic.h: Prototype _dbus_first_type_in_signature_c_str, handle function moves. * dbus/dbus-marshal-recursive.h: Export _dbus_type_signature_next. * dbus/dbus-marshal-recursive.c (_dbus_type_signature_next): New function; skips to next complete type in type signature. Implemented using previous skip_one_complete_type. Now skip_one_complete_type just delegates to _dbus_type_signature_next. * dbus/dbus-marshal-basic.c (_dbus_type_is_basic): Moved to dbus-signature.c (_dbus_type_is_container): Ditto. * doc/dbus-specification.xml: Update introspection sample to use real type signatures. * dbus/dbus-test.h: Prototype signature test. * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): Run signature tests. * dbus/dbus-protocol.h (DBUS_ERROR_INVALID_SIGNATURE): New error.
* 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-10 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-101-22/+51
| | | | | | | | * dbus/dbus-message-util.c (verify_test_message): tests for string array * dbus/dbus-message.c (dbus_message_append_args_valist): add support for arrays of string/signature/path
* * dbus/dbus-message.c (dbus_message_iter_open_container):John (J5) Palmieri2005-02-101-9/+17
| | | | | | - Removed check for iterator type being an array because get_arg_type does not work with writer iterators - Pass NULL to _dbus_type_writer_recurse if signiture is NULL
* 2005-02-05 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-061-5/+3
| | | | | | | | | | | | | | | | | * dbus/dbus-message-factory.c (generate_special): more test cases, increasing coverage * dbus/dbus-marshal-validate.c (validate_body_helper): return the reason why a signature was invalid * dbus/dbus-marshal-header.c (load_and_validate_field): fix to skip the length of the string before we look at it in validation * dbus/dbus-string-util.c (_dbus_string_test): add tests for equal_substring * dbus/dbus-message.c (_dbus_message_loader_new): default max_message_length to DBUS_MAXIMUM_MESSAGE_LENGTH
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-301-23/+26
| | | | | | | * tools/dbus-names-model.c (have_names_notify): fix this * dbus/dbus-message.c (_dbus_message_iter_get_args_valist): clean up the string array handling a bit
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-301-1/+13
| | | | | | | | | | | | | | | | | | | | * 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-28 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-281-4/+18
| | | | | | | | | | | | | * doc/dbus-specification.xml: update to describe 16-bit types and dict entries * dbus/dbus-marshal-basic.c (_dbus_unpack_uint16): fix broken assertion * dbus/dbus-protocol.h (DBUS_TYPE_DICT_ENTRY): add DICT_ENTRY as a type * dbus/dbus-marshal-recursive.c: implement
* 2005-01-27 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-271-19/+61
| | | | | | | | | | * dbus/dbus-message.c: byteswap the message if you init an iterator to read/write from it * dbus/dbus-marshal-byteswap.c: new file implementing _dbus_marshal_byteswap() * dbus/dbus-marshal-basic.c: add _dbus_swap_array()
* 2005-01-24 Joe Shaw <joeshaw@novell.com>Joe Shaw2005-01-241-1/+1
| | | | | | | | | | * dbus/dbus-connection.c (dbus_connection_dispatch): Print out the signature for the method that can't be found. * dbus/dbus-message.c (dbus_message_iter_init): To check to see if the message has any arguments, we need to call _dbus_type_reader_get_current_type(), not _dbus_type_reader_has_next().
* 2005-01-24 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-241-7/+0
| | | | | | | * dbus/dbus-message-factory.c: more testing of message validation * dbus/dbus-protocol.h (DBUS_MINIMUM_HEADER_SIZE): move to this header
* 2005-01-23 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-231-10/+37
| | | | | * dbus/dbus-message-factory.c, dbus/dbus-message-util.c: get this all working, not many tests in the framework yet though
* 2005-01-21 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-211-24/+30
| | | | | | | | | | | * dbus/dbus-bus.c: add more return_if_fail checks * dbus/dbus-message.c (load_message): have the "no validation" mode (have to edit the code to toggle the mode for now though) * dbus/dbus-marshal-header.c (_dbus_header_load): have a mode that skips all validation; I want to use this at least for benchmark baseline, I'm not sure if it should be a publicly-available switch.
* 2005-01-20 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-211-4/+4
| | | | | | | | | | | | | | * doc/dbus-tutorial.xml: replace > with &gt; * bus/services.c (bus_registry_acquire_service): validate the name and return a better error if it's no good. * doc/dbus-specification.xml: note NO_AUTO_START change * dbus/dbus-protocol.h (DBUS_HEADER_FLAG_NO_AUTO_START): change from AUTO_START, we're toggling the default * bus/dispatch.c: adapt the tests to change of auto-start default
* 2005-01-18 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-181-53/+54
| | | | | | | | | | | | * Throughout, grand renaming to strip out the use of "service", just say "name" instead (or "bus name" when ambiguous). Did not change the internal code of the message bus itself, only the programmer-facing API and messages. * doc/dbus-specification.xml: further update the message bus section * bus/config-parser.c (all_are_equiv): fix bug using freed string in error case
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-1368/+14
| | | | | | | | | | | | | | | | | | | | | | | | This is about it on what can be disabled/deleted from libdbus easily, back below 150K anyhow. Deeper cuts are more work than just turning the code off as I've done here. * dbus/dbus-marshal-basic.c (_dbus_pack_int32): we don't need the signed int convenience funcs * dbus/dbus-internals.c (_dbus_verbose_real): omit when not in verbose mode * dbus/dbus-string-util.c, dbus/dbus-string.c: more breaking things out of libdbus * dbus/dbus-sysdeps.c, dbus/dbus-sysdeps-util.c: same * dbus/dbus-hash.c: purge the TWO_STRINGS crap (well, make it tests-enabled-only, though it should probably be deleted) * dbus/dbus-message-util.c: same stuff * dbus/dbus-auth-util.c: same stuff
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-internals.c (_dbus_real_assert): print the function name the assertion failed in * dbus/dbus-internals.h (_dbus_return_if_fail) (_dbus_return_val_if_fail): assert that the name of the function containing the check doesn't start with '_', since we only want to use checks on public functions * dbus/dbus-connection.c (_dbus_connection_ref_unlocked): change checks to assertions * dbus/dbus-marshal-header.c (_dbus_header_set_field_basic): change checks to asserts for private function * dbus/dbus-message.c (_dbus_message_set_serial): checks to asserts for private function * dbus/dbus-marshal-recursive.c (skip_one_complete_type): remove broken assertion that was breaking make check (_dbus_type_reader_array_is_empty): remove this rather than fix it, was only used in assertions
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-161-14/+17
| | | | | | | | | | | | | | | | | * Add and fix docs according to Doxygen warnings throughout source. * dbus/dbus-marshal-recursive.c (_dbus_type_reader_array_is_empty): change this to just call array_reader_get_array_len() and make it static * dbus/dbus-message.c (dbus_message_iter_get_element_type): rename from get_array_type (dbus_message_iter_init_append): rename from append_iter_init * dbus/dbus-marshal-recursive.c (_dbus_type_reader_get_element_type): rename from _dbus_type_reader_get_array_type
* 2005-01-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-151-4628/+1752
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-12-18 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-12-191-1/+17
| | | | | | | | | | | | * dbus/dbus-string.c (_dbus_string_validate_ascii): use ISASCII macro * dbus/dbus-message.c: fix a comment, and add a still-unused not-implemented function * dbus/dbus-marshal.h: fix comment * dbus/dbus-internals.h (_DBUS_ISASCII): new macro
* 2004-11-27 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-11-271-0/+15
| | | | | | | | | | | | * dbus/dbus-string.h (_dbus_string_get_byte): inline when asserts are disabled (_dbus_string_get_const_data): inline when asserts are disabled * dbus/dbus-message.c: record the _dbus_current_generation of creation so we can complain if dbus_shutdown() is used improperly. Do this only if checks are enabled. * dbus/dbus-connection.c: ditto
* 2004-11-26 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-11-261-5/+12
| | | | | * dbus/dbus-message.c (dbus_message_cache_or_finalize): fix bug where I was trying to cache one too many messages
* 2004-11-26 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-11-261-27/+62
| | | | | * dbus/dbus-message.c: reimplement message cache as an array which makes the cache about twice as fast and saves maybe 1.5% overall
* 2004-11-26 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-11-261-40/+238
| | | | | | | | | | | | * dbus/dbus-message.c (struct DBusMessage): put the locked bit and the "char byte_order" next to each other to save 4 bytes (dbus_message_new_empty_header): reduce preallocation, since the message cache should achieve a similar effect (dbus_message_cache_or_finalize, dbus_message_get_cached): add a message cache that keeps a few DBusMessage around in a pool, another 8% speedup or so. * dbus/dbus-dataslot.c (_dbus_data_slot_list_clear): new function
* 2004-11-25 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-11-261-11/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary change here is to always write() once before adding the write watch, which gives us about a 10% performance increase. * dbus/dbus-transport-unix.c: a number of modifications to cope with removing messages_pending (check_write_watch): properly handle DBUS_AUTH_STATE_WAITING_FOR_MEMORY; adapt to removal of messages_pending stuff (check_read_watch): properly handle WAITING_FOR_MEMORY and AUTHENTICATED cases (unix_handle_watch): after writing, see if the write watch can be removed (unix_do_iteration): assert that write_watch/read_watch are non-NULL rather than testing that they aren't, since they aren't allowed to be NULL. check_write_watch() at the end so we add the watch if we did not finish writing (e.g. got EAGAIN) * dbus/dbus-transport-protected.h: remove messages_pending call, since it resulted in too much inefficient watch adding/removing; instead we now require that the transport user does an iteration after queueing outgoing messages, and after trying the first write() we add a write watch if we got EAGAIN or exceeded our max bytes to write per iteration setting * dbus/dbus-string.c (_dbus_string_validate_signature): add this function * dbus/dbus-server-unix.c (unix_finalize): the socket name was freed and then accessed, valgrind flagged this bug, fix it * dbus/dbus-message.c: fix several bugs where HEADER_FIELD_LAST was taken as the last valid field plus 1, where really it is equal to the last valid field. Corrects some message corruption issues. * dbus/dbus-mainloop.c: verbosity changes * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): handle OOM instead of aborting in one of the test codepaths * dbus/dbus-internals.c (_dbus_verbose_real): fix a bug that caused not printing the pid ever again if a verbose was missing the newline at the end (_dbus_header_field_to_string): add HEADER_FIELD_SIGNATURE * dbus/dbus-connection.c: verbosity changes; (dbus_connection_has_messages_to_send): new function (_dbus_connection_message_sent): no longer call transport->messages_pending (_dbus_connection_send_preallocated_unlocked): do one iteration to try to write() immediately, so we can avoid the write watch. This is the core purpose of this patchset (_dbus_connection_get_dispatch_status_unlocked): if disconnected, dump the outgoing message queue, so nobody will get confused trying to send them or thinking stuff is pending to be sent * bus/test.c: verbosity changes * bus/driver.c: verbosity/assertion changes * bus/dispatch.c: a bunch of little tweaks to get it working again because this patchset changes when/where you need to block.
* 2004-11-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-11-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | * test/glib/test-profile.c: fix this thing up a bit * dbus/dbus-message.c (dbus_message_new_empty_header): increase preallocation sizes by a fair bit; not sure if this will be an overall performance win or not, but it does reduce reallocs. * dbus/dbus-string.c (set_length, reallocate_for_length): ignore the test hack that forced constant realloc if asserts are disabled, so we can profile sanely. Sprinkle in some _DBUS_UNLIKELY() which are probably pointless, but before I noticed the real performance problem I put them in. (_dbus_string_validate_utf8): micro-optimize this thing a little bit, though callgrind says it didn't help; then special-case ascii, which did help a lot; then be sure we detect nul bytes as invalid, which is a bugfix. (align_length_then_lengthen): add some more _DBUS_UNLIKELY superstition; use memset to nul the padding instead of a manual loop. (_dbus_string_get_length): inline this as a macro; it showed up in the profile because it's used for loop tests and so forth
* 2004-11-09 Colin Walters <walters@verbum.org>Colin Walters2004-11-091-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-string.c (_dbus_string_get_length): New function, writes DBusString to C buffer. * dbus/dbus-string.h: Prototype it. * dbus/dbus-message.c (dbus_message_type_to_string): New function, converts message type into C string. * dbus/dbus-message.h: Prototype it. * bus/selinux.c (bus_selinux_check): Take source pid, target pid, and audit data. Pass audit data to avc_has_perm. (log_audit_callback): New function, appends extra audit information. (bus_selinux_allows_acquire_service): Also take service name, add it to audit data. (bus_selinux_allows_send): Also take message type, interface, method member, error name, and destination, and add them to audit data. (log_cb): Initialize func_audit. * bus/selinux.h (bus_selinux_allows_acquire_service) (bus_selinux_allows_send): Update prototypes * bus/services.c (bus_registry_acquire_service): Pass service name to bus_selinux_allows_acquire_service. * bus/bus.c (bus_context_check_security_policy): Pass additional audit data. Move assignment of dest to its own line.
* * bus/bus.c (process_config_first_time_only): get rid of an unusedOlivier Andrieu2004-08-101-2/+4
| | | | | | | | | DBusError that was causing a memoy leak (bug #989). * dbus/dbus-keyring.c, dbus/dbus-message.c: fix compilation on Solaris/Forte C (bug #974) * bus/main.c (main): plug two minuscule memleaks.
* 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.
* * bus/config-loader-libxml.c: complete the implementation of libxmlOlivier Andrieu2004-07-291-1/+17
| | | | | | | | | | | | | | | | | | | | | | backend for config file loader. Doesn't work with full OOM test yet. * configure.in: change error when selecting libxml into a warning. * test/data/invalid-config-files: add two non-well-formed XML files. * glib/Makefile.am: libdbus_gtool always uses expat, not libxml. * dbus/dbus-transport-unix.c (unix_handle_watch): do not disconnect in case of DBUS_WATCH_HANGUP, several do_reading() may be necessary to read all the buffer. (bug #894) * bus/activation.c (bus_activation_activate_service): fix a potential assertion failure (bug #896). Small optimization in the case of auto-activation messages. * dbus/dbus-message.c (verify_test_message, _dbus_message_test): add test case for byte-through-vararg bug (#901). patch by Kimmo Hämäläinen.
* 2004-07-22 Olivier Andrieu <oliv__a@users.sourceforge.net>Olivier Andrieu2004-07-221-4/+3
| | | | | | | | | | | | | | | | | | | | | | * 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.
* * dbus/dbus-message.c: Message counter fix, patch by Christian Hammond ↵Olivier Andrieu2004-07-191-1/+1
| | | | <chipx86@gnupdate.org>
* 2004-06-07 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-06-071-112/+234
| | | | | | | | | | | | | | | | | | | * 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
* 2004-06-02 Kristian Høgsberg <krh@redhat.com>Kristian Høgsberg2004-06-021-0/+2
| | | | | | | | | | | | | * 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-05-28 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-05-281-3/+38
| | | | | | | | | | | | | | | * test/glib/test-service-glib.c (main): remove unused variable * glib/dbus-gidl.c (base_info_ref): fix a silly compiler warning * dbus/dbus-auth.h (enum): remove AUTHENTICATED_WITH_UNUSED_BYTES from the enum, no longer in use. * dbus/dbus-sysdeps.h: include config.h so DBUS_VA_COPY actually works right. * dbus/dbus-message.c: add various _dbus_return_val_if_fail for whether error_name passed in is a valid error name.
* * fix for TODO item:John (J5) Palmieri2004-05-281-0/+21
| | | | | - the varargs dbus_message_get_args() needs to support OBJECT_PATH and OBJECT_PATH_ARRAY
* 2004-05-28 Michael Meeks <michael@ximian.com>Michael Meeks2004-05-281-839/+512
| | | | | | | | | | | | | | | | | | | | | | | | * 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_array), (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.
* Patch from Timo Teräs <ext-timo.teras@nokia.com> (#614):Kristian Høgsberg2004-05-231-6/+3
| | | | | | * dbus/dbus-message.c (dbus_message_iter_get_args_valist): Swap operands to && so we call dbus_message_iter_next () for the last argument also.
* * rename HEADER_FIELD_SERVICE -> HEADER_FIELD_DESTINATIONJohn (J5) Palmieri2004-04-221-9/+9
| | | | | and HEADER_FIELD_SENDER_SERVICE -> HEADER_FIELD_SENDER for both dbus-protocol.h and in the spec
* * dbus/dbus-message.c (decode_header_data, decode_string_field):Olivier Andrieu2004-04-211-3/+3
| | | | | | | | | | | | fix incorrect setting of .name_offset in the HeaderField (it was off by two bytes, positioned right after the name and typecode) * bus/bus.c (bus_context_new, bus_context_unref): test before calling dbus_server_free_data_slot and _dbus_user_database_unref in case of an error. * tools/Makefile.am: add $(DBUS_GLIB_TOOL_LIBS), xml libs needed by libdbus-gtool.
* 2004-03-29 Michael Meeks <michael@ximian.com>Michael Meeks2004-03-291-0/+39
| | | | | | | | | | * dbus/dbus-message.c (dbus_message_new_error_printf): impl. * dbus/dbus-connection.c (dbus_connection_unregister_object_path): fix warning. * configure.in: fix no-mono-installed situation.
* Added InterfaceProxy to Mono bindings to avoid having to generate a proxy ↵Owen Fraser-Green2004-03-231-16/+72
| | | | for every registered object. Also added object_path functions to dbus-message.
* * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): accept emptyOlivier Andrieu2004-03-211-7/+57
| | | | | | | | | | | | arrays * dbus/dbus-message.h, bus/dbus-message.c (dbus_message_iter_init) (dbus_message_iter_init_array_iterator) (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 warnings
* 2004-03-18 Richard Hult <richard@imendio.com>Richard Hult2004-03-181-0/+17
| | | | | * dbus/dbus-message.c (dbus_message_get_auto_activation) (dbus_message_set_auto_activation): Add doxygen docs.