summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-message.c
Commit message (Collapse)AuthorAgeFilesLines
* 2003-04-03 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-031-0/+39
| | | | | | | | | | * bus/activation.c (load_directory): fix up memleaks (bus_activation_entry_free): free the entry * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if we get one from the message bus; fix memleaks. * dbus/dbus-message.c (dbus_set_error_from_message): new function
* 2003-03-31 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-03-311-42/+30
| | | | | | | | | | | | Fix some annoying DBusString API and fix all affected code. * dbus/dbus-string.c (_dbus_string_init): get rid of annoying max_length argument (_dbus_string_get_data): change to return string instead of using an out param (_dbus_string_get_const_data): ditto (_dbus_string_get_data_len): ditto (_dbus_string_get_const_data_len): ditto
* 2003-03-24 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-03-251-19/+14
| | | | | | | | | | | | | | | | * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this file * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow NULL argument for "message" if the error is a well-known one, fill in a generic message in this case. * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in favor of DBusError * bus/test.c (bus_test_flush_bus): add * bus/policy.c (bus_policy_test): test code stub
* 2003-03-20 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-201-0/+61
| | | | | | | | | | | | | * bus/connection.c (bus_connection_send_oom_error): assert that message has a sender (connection_execute_transaction): ditto (bus_connection_preallocate_oom_error): fix to set the sender, and set recipient to the destination service, not the bus driver * bus/policy.c: hacking * dbus/dbus-message.c (dbus_message_service_is): new function (dbus_message_sender_is): new
* 2003-03-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-03-171-1/+1
| | | | | | | | | | | | * dbus/dbus-internals.h: add gcc attributes so that our printf-style functions warn on bad arguments to format * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf format bug * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix printf format bug
* 2003-03-16 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | * bus/activation.c: (bus_pending_activation_entry_free), (bus_pending_activation_free), (bus_activation_new), (bus_activation_unref), (bus_activation_service_created), (bus_activation_activate_service): * bus/activation.h: * bus/bus.c: (bus_context_new): * bus/desktop-file.c: (new_section): * bus/driver.c: (bus_driver_send_service_deleted), (bus_driver_handle_activate_service): * bus/services.c: (bus_registry_new), (bus_registry_ensure): * bus/services.h: * dbus/dbus-connection.c: (dbus_connection_send_with_reply_and_block): * dbus/dbus-message.c: (dbus_message_append_args_valist): * dbus/dbus-protocol.h: Make activation work better. Now pending activations will be queued and the daemon won't try to activate services that are already registered.
* 2003-03-16 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-161-22/+59
| | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak this. always run the test suite before commit... * bus/*: adapt to DBusConnection API changes * glib/dbus-gmain.c: adapt to DBusConnection API changes, requires renaming stuff to avoid dbus_connection_dispatch name conflict. * dbus/dbus-transport.c (_dbus_transport_queue_messages): new function * dbus/dbus-message.c (_dbus_message_loader_queue_messages): separate from _dbus_message_loader_return_buffer() * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove this, because it's now always broken to use; the number of messages in queue vs. the number still buffered by the message loader is undefined/meaningless. Should use dbus_connection_get_dispatch_state(). (dbus_connection_dispatch): rename from dbus_connection_dispatch_message
* 2003-03-16 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-03-161-35/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-connection.c: (dbus_connection_send_with_reply_and_block): Decrease connection->n_incoming when removing an entry from the list. * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array), (dbus_dict_set_uint32_array), (dbus_dict_set_double_array), (dbus_dict_set_byte_array), (dbus_dict_set_string_array), (dbus_dict_get_boolean_array), (dbus_dict_get_double_array), (dbus_dict_get_byte_array): Handle NULL arrays and strings. Also add support for byte arrays. * dbus/dbus-marshal.c: (_dbus_marshal_byte_array), (_dbus_marshal_dict), (_dbus_demarshal_byte_array), (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array), (_dbus_demarshal_double_array), (_dbus_demarshal_string_array), (_dbus_demarshal_dict), (demarshal_and_validate_len), (_dbus_marshal_validate_arg), (_dbus_marshal_test): * dbus/dbus-marshal.h: Add support for marshalling and demarshalling empty arrays and strings. * dbus/dbus-message.c: (dbus_message_append_args_valist), (dbus_message_append_string_array), (dbus_message_iter_get_boolean), (dbus_message_iter_get_boolean_array), (dbus_message_iter_get_int32_array), (dbus_message_iter_get_uint32_array), (dbus_message_iter_get_double_array), (dbus_message_iter_get_byte_array), (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict), (check_message_handling): Add support for getting empty arrays and dicts. * dbus/dbus-string.c: (_dbus_string_validate_utf8): Don't do any validation at all for now, that's better than just checking for ASCII. * test/data/valid-messages/emptiness.message: New test message with lots of empty arrays.
* 2003-03-16 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-161-0/+13
| | | | | | | | | | | | | * dbus/dbus-connection.c (_dbus_connection_queue_received_message_link): new function that can't fail due to OOM * dbus/dbus-message.c (_dbus_message_loader_pop_message_link): new function pops a message together with a list link containing it. * dbus/dbus-transport-unix.c (queue_messages): use new link-based message queuing functions to avoid needing to alloc memory
* 2003-03-15 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-151-1/+7
| | | | | | | | | | | | | | | | | | * bus/dispatch.c (bus_dispatch_test): OK, now finally actually write useful test code, after all that futzing around ;-) Test does not yet pass because we can't handle OOM in _dbus_transport_messages_pending (basically, dbus_connection_preallocate_send() does not prealloc the write watch). To fix this, I think we need to add new stuff to set_watch_functions, namely a SetEnabled function so we can alloc the watch earlier, then enable it later. * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move dbus-memory.c to the convenience lib * bus/test.c: rename some static functions to keep them clearly distinct from stuff in connection.c. Handle client disconnection.
* 2003-03-14 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-03-151-22/+57
| | | | | | | | | | | | | | | | | | | | | * dbus/dbus-memory.c: add a "detect buffer overwrites on free" cheesy hack * dbus/dbus-transport-debug.c: rework this a good bit to be less complicated. hopefully still works. * dbus/dbus-server-debug.c (handle_new_client): remove timeout manually * glib/dbus-gmain.c (timeout_handler): don't remove timeout after running it * dbus/dbus-message.c (dbus_message_copy): rename from dbus_message_new_from_message, fix it up to copy all the message fields, add test case * bus/dispatch.c (bus_dispatch_test): add some more test code, not quite passing yet
* 2003-03-12 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-03-131-85/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-10 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-03-101-12/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-marshal.c: (_dbus_marshal_set_string): Take a length argument so we can marshal the correct string length. (_dbus_marshal_dict), (_dbus_demarshal_dict), (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg), (_dbus_marshal_test): * dbus/dbus-marshal.h: Add support for marshalling and demarshalling dicts. * dbus/dbus-message-builder.c: (_dbus_message_data_load): Add support for TYPE DICT. * dbus/dbus-message.c: (set_string_field): Adjust header padding. (dbus_message_append_args_valist), (dbus_message_append_dict), (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type), (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer), (check_message_handling), (check_have_valid_message): * dbus/dbus-message.h: Add functions for setting and getting dicts. * dbus/dbus-protocol.h: Add DBUS_TYPE_DICT. * dbus/dbus.h: Add dbus-dict.h * doc/dbus-specification.sgml: Add information about how dicts are marshalled. * test/data/invalid-messages/dict-with-nil-value.message: * test/data/invalid-messages/too-short-dict.message: * test/data/valid-messages/dict-simple.message: * test/data/valid-messages/dict.message: Add sample messages containing dicts.
* 2003-03-04 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | * test/data/auth/*: adapt to changes * dbus/dbus-auth-script.c (_dbus_auth_script_run): add USERID_BASE64 and change USERNAME_BASE64 to put in username not userid * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent more stuff from being in a context name, to make the protocol simpler to deal with * dbus/dbus-errors.c (dbus_error_has_name): new function (dbus_error_is_set): new function * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1 * dbus/dbus-connection.c (dbus_connection_flush): also read messages during a flush operation * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
* 2003-03-04 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-03-041-0/+1
| | | | | * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break; after case DBUS_TYPE_BOOELAN.
* 2003-03-02 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-021-3/+6
| | | | | * dbus/dbus-message.c (decode_header_data): fix to always init message_padding, from Benjamin Dauvergne
* 2003-02-27 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-271-5/+24
| | | | | | | | | | * dbus/dbus-connection.c (dbus_connection_send_message_with_reply_and_block): fix doh! doh! doh! bug that resulted in never removing a reply from the queue, no wonder we called get_reply_serial so much ;-) * dbus/dbus-message.c (struct DBusMessage): cache reply serial and client serial instead of demarshaling them every time
* 2003-02-26 Alexander Larsson <alexl@redhat.com>Alexander Larsson2003-02-261-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in: Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0 * dbus/dbus-connection.c: * dbus/dbus-connection.h: Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch. Add dbus_connection_set_wakeup_main_function and use it when queueing incoming and outgoing messages. * dbus/dbus-dataslot.c: Threadsafe usage of DBusDataSlotAllocator * dbus/dbus-message.c: (dbus_message_get_args_iter): dbus_new can fail. * dbus/dbus-server-unix.c: Add todo comment * glib/dbus-gmain.c: Implement the new wakeup functions for glib. * glib/Makefile.am: * glib/test-thread-client.c: * glib/test-thread-server.c: * glib/test-thread.h: Initial cut at some thread test code. Not really done yet.
* 2003-02-26 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-261-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-connection.c (dbus_connection_send_message_with_reply_and_block): fix crash where we ref'd the outgoing message instead of the returned reply * dbus/dbus-transport-unix.c (do_authentication): check read watch at the end of this function, so if we didn't need to read for authentication, we reinstall it for receiving messages * dbus/dbus-message.c (dbus_message_new_reply): allow replies to a NULL sender for peer-to-peer case * dbus/dbus-transport-unix.c (check_read_watch): handle !authenticated case correctly * glib/dbus-gmain.c: add support for DBusServer * dbus/dbus-server.c: add data slot support * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check return values and handle errors * dbus/dbus-dataslot.c: factor out the data slot stuff from DBusConnection * Doxyfile.in (INPUT): add glib subdir * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename setup_with_g_main instead of hookup_with_g_main; write docs
* 2003-02-24 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-241-7/+13
| | | | | | | | | | | | | | | * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg): * dbus/dbus-message-builder.c: (_dbus_message_data_load): * dbus/dbus-message.c: (dbus_message_append_boolean), (dbus_message_append_boolean_array), (dbus_message_get_args_valist), (_dbus_message_test): * dbus/dbus-message.h: * doc/dbus-specification.sgml: Various fixes as pointed out by Havoc. * test/data/invalid-messages/bad-boolean-array.message: * test/data/invalid-messages/bad-boolean.message: Add invalid boolean value test cases.
* 2003-02-24 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-241-5/+151
| | | | | | | | | | | | | | | | | | * dbus/dbus-internals.c: (_dbus_type_to_string): * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg): * dbus/dbus-message-builder.c: (_dbus_message_data_load): * dbus/dbus-message.c: (dbus_message_append_args_valist), (dbus_message_append_boolean), (dbus_message_append_boolean_array), (dbus_message_get_args_valist), (dbus_message_iter_get_boolean), (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32), (dbus_message_iter_get_double), (dbus_message_iter_get_boolean_array), (message_iter_test): * dbus/dbus-message.h: * dbus/dbus-protocol.h: * doc/dbus-specification.sgml: * test/data/valid-messages/lots-of-arguments.message: Add support for boolean and boolean array types.
* 2003-02-22 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-221-0/+7
| | | | | | | | | * dbus/dbus-message.c (dbus_message_iter_get_string_array): (dbus_message_iter_get_byte_array): Fix up doxygen warnings * dbus/dbus-sha.c: add implementation of SHA-1 algorithm * dbus/test/data/sha-1: add US government test suite for SHA-1
* 2003-02-21 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-211-3/+58
| | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-marshal.c: (_dbus_demarshal_string_array): Make string arrays NULL-terminated. * dbus/dbus-memory.c: (dbus_free_string_array): * dbus/dbus-memory.h: New function for freeing NULL-terminated string arrays. * dbus/dbus-message-builder.c: (append_quoted_string), (_dbus_message_data_load): Add support for array types. * dbus/dbus-message.c: (check_message_handling): Add more types as test cases. * dbus/dbus-sysdeps.c: (_dbus_string_parse_int), (_dbus_string_parse_double): Add the start offset to the end offset. * test/data/valid-messages/lots-of-arguments.message: New test message with lots of arguments.
* 2003-02-21 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-211-68/+48
| | | | | | | | | | | | * dbus/dbus-message.c: (dbus_message_append_nil), (dbus_message_append_int32), (dbus_message_append_uint32), (dbus_message_append_double), (dbus_message_append_string), (dbus_message_append_int32_array), (dbus_message_append_uint32_array), (dbus_message_append_double_array), (dbus_message_append_byte_array), (dbus_message_append_string_array): Fix all out-of-memory handling in these functions.
* 2003-02-21 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-211-32/+328
| | | | | | | | | | | | | | | | * dbus/dbus-message.c: (dbus_message_append_args_valist), (dbus_message_append_nil), (dbus_message_append_int32_array), (dbus_message_append_uint32_array), (dbus_message_append_double_array), (dbus_message_append_byte_array), (dbus_message_append_string_array), (dbus_message_get_args_valist), (dbus_message_iter_get_int32_array), (dbus_message_iter_get_uint32_array), (dbus_message_iter_get_double_array), (dbus_message_iter_get_byte_array), (dbus_message_iter_get_string_array): * dbus/dbus-message.h: Add functions for appending and getting arrays.
* 2003-02-19 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-191-3/+18
| | | | | | | | | | | | | | | | | | | Throughout: mop up all the Doxygen warnings and undocumented stuff. * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want to search any paths. * dbus/dbus-threads.c: move global mutex initializers to dbus-internals.h, multiple prototypes was confusing doxygen besides being kind of ugly * Doxyfile (PREDEFINED): have Doxygen define DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS (do not abuse the feature! it's for stuff like the autogenerated macros in dbus-md5.c, not just for things you don't feel like documenting...)
* typo fixesHavoc Pennington2003-02-181-1/+1
|
* 2003-02-17 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-161-6/+12
| | | | | | * dbus/dbus-message.c: (decode_header_data), (_dbus_message_loader_return_buffer): Set the header padding amount when loading a message.
* add more verbose debug spewHavoc Pennington2003-02-161-2/+9
|
* 2003-02-16 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-161-0/+11
| | | | | | | | | | | | | | | | | | | | * bus/dispatch.c: (send_one_message): Only send broadcast messages to registered connections. * dbus/dbus-message.c: (dbus_message_name_is): * dbus/dbus-message.h: New convenience function. * dbus/dbus-transport-debug.c: (do_reading): Only dispatch one message per run. * test/Makefile.am: * test/bus-test.c: (new_connection_callback), (die), (test_hello_client1_handler), (test_hello_client2_handler), (test_hello_replies), (main): * test/bus-test-loop.[ch]: Add these.
* 2003-02-16 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-161-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/activation.c: (load_directory), (bus_activation_init), (bus_activation_activate_service): * bus/activation.h: * bus/driver.c: (bus_driver_handle_activate_service), (bus_driver_handle_message): More work on the activation handling. * dbus/dbus-errors.h: Add some error messages * dbus/dbus-message.c: (dbus_message_new_error_reply): * dbus/dbus-message.h: New function that creates an error message. * dbus/dbus-protocol.h: Add ACTIVATE_SERVER message. * dbus/dbus-server-unix.c: (unix_handle_watch), (_dbus_server_new_for_domain_socket): Call _dbus_fd_set_close_on_exec. * dbus/dbus-sysdeps.c: (make_pipe), (do_exec), (_dbus_spawn_async), (_dbus_disable_sigpipe), (_dbus_fd_set_close_on_exec): * dbus/dbus-sysdeps.h: Add _dbus_fd_set_close_on exec function. Also add function that checks that all open fds are set to close-on-exec and warns otherwise. * dbus/dbus-transport-unix.c: (_dbus_transport_new_for_domain_socket): Call _dbus_fd_set_close_on_exec.
* 2003-02-15 Alexander Larsson <alexl@redhat.com>Alexander Larsson2003-02-151-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-threads.c: * dbus/dbus-threads.h: Add condvars. Remove static mutext from API. Implement static mutexes by initializing them from threads_init. * glib/dbus-gthread.c: * qt/dbus-qthread.cpp: Update with the thread api changes. * dbus/dbus-list.c: * dbus/dbus-list.h: Turn StaticMutex into normal mutex + init function. Export new functions _dbus_list_alloc_link, _dbus_list_free_link, _dbus_list_append_link, _dbus_list_prepend_link * dbus/dbus-sysdeps.c: * dbus/dbus-sysdeps.h: New type dbus_atomic_t, and new functions _dbus_atomic_inc, _dbus_atomic_dec. Only slow fallback implementation at the moment. * dbus/dbus-protocol.h: Add DBUS_MESSAGE_LOCAL_DISCONNECT define * dbus/dbus-message.c: Make ref/unref atomic. Fix some docs. * dbus/dbus-connection-internal.h: * dbus/dbus-connection.c: * dbus/dbus-connection.h: Make threadsafe. Change _peek to _borrow,_return & _steal_borrowed. Change disconnect callback to event. Make dbus_connection_dispatch_messages reentrant. * dbus/dbus-transport.c: Don't ref the connection on calls to the transport implementation. * dbus/dbus-message-handler.c: Make threadsafe. * glib/dbus-gmain.c: Don't use peek_message anymore * test/Makefile.am: * test/debug-thread.c: * test/debug-thread.h: Simple thread implementation that asserts() on deadlocks in single-threaded code. * test/bus-test.c: (main) Call debug_threads_init. * test/watch.c: Use disconnect message instead of disconnect callback. * bus/connection.c: * bus/connection.h: Don't call dbus_connection_set_disconnect_function. Instead export bus_connection_disconnect. * bus/dispatch.c: Call bus_connection_disconnect when we get a disconnected message.
* 2003-02-15 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-151-4/+7
| | | | | * dbus/dbus-message.c (dbus_message_new): fool around with the docs
* 2003-02-14 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-141-0/+6
| | | | | | | | | | | * dbus/dbus-mempool.c: fail if the debug functions so indicate * dbus/dbus-memory.c: fail if the debug functions indicate we should * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter) (_dbus_decrement_fail_alloc_counter): debug functions to simulate memory allocation failures
* 2003-02-13 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-131-77/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/driver.c: (bus_driver_send_service_deleted), (bus_driver_send_service_created), (bus_driver_send_service_lost), (bus_driver_send_service_acquired), (bus_driver_handle_hello), (bus_driver_send_welcome_message), (bus_driver_handle_list_services), (bus_driver_handle_acquire_service), (bus_driver_handle_service_exists): * dbus/dbus-bus.c: (dbus_bus_register_client), (dbus_bus_acquire_service), (dbus_bus_service_exists): * dbus/dbus-errors.c: (dbus_result_to_string): * dbus/dbus-errors.h: * dbus/dbus-message.c: (dbus_message_append_args), (dbus_message_append_args_valist), (dbus_message_get_args), (dbus_message_get_args_valist), (dbus_message_get_args_iter), (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string), (dbus_message_iter_get_byte_array), (dbus_message_iter_get_string_array), (message_iter_test), (check_message_handling), (_dbus_message_test): * dbus/dbus-message.h: * test/bus-test.c: (main): Change fields to arguments in messages, so that they won't be confused with header fields. * glib/test-dbus-glib.c: (main): Remove append_fields from hello message.
* 2003-02-13 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-131-1/+0
| | | | | | | * dbus/dbus-errors.c: * dbus/dbus-message.c: * dbus/dbus-string.c: Documentation fixes.
* 2003-02-13 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-131-0/+1
| | | | | | | * dbus/dbus-message-builder.c: (_dbus_message_data_load): * dbus/dbus-message.c: (process_test_subdir): * test/break-loader.c: (find_breaks_based_on): Plug some memory leaks.
* 2003-02-13 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-131-4/+5
| | | | | | | | | | | | | * bus/driver.c: (bus_driver_send_welcome_message), (bus_driver_handle_list_services), (bus_driver_handle_acquire_service), (bus_driver_handle_service_exists), (bus_driver_handle_message): Update for API changes in libdbus. * dbus/dbus-message.c: (dbus_message_new_reply): * dbus/dbus-message.h: Remove the name argument. The spec states that replies shouldn't have a name.
* 2003-02-03 Alexander Larsson <alexl@redhat.com>Alexander Larsson2003-02-021-2/+2
| | | | | * dbus/dbus-message.c (dbus_message_append_fields): Correct docs.
* 2003-02-01 Alexander Larsson <alexl@redhat.com>Alexander Larsson2003-02-011-2/+4
| | | | | * dbus/dbus-message.c (dbus_message_append_fields): Add some more doc comments.
* 2003-02-01 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-011-41/+91
| | | | | | | | | | * dbus/dbus-break-loader.c (main): new program to find messages that break the loader. * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function * dbus/dbus-string.c (_dbus_string_set_byte): new
* 2003-01-31 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-011-73/+127
| | | | | | * dbus/dbus-message.c: refactor the test code to be more general, in preparation for writing a "randomly permute test cases to try to break the loader" program.
* 2003-01-31 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-011-0/+8
| | | | | | | | | | | | | | | * doc/dbus-specification.sgml: work on the specification * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check the protocol version of the message. * dbus/dbus-protocol.h: drop special _REPLY names, the spec no longer specifies that. (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not 1/2/3/4) * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing "break" for DBUS_TYPE_NIL, remove @todo
* 2003-01-31 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-01-311-8/+21
| | | | | | * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename just set_is_error/get_is_error as this is a commonly-used function, and write docs.
* 2003-01-31 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-01-311-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-address.c: (dbus_address_entry_free): Free key and value lists. * dbus/dbus-internals.c: (_dbus_type_to_string): Add the types we didn't have. * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg): Add NIL types. * dbus/dbus-message.c: (dbus_message_set_sender): Remove todo about being able to set sender to NULL. (dbus_message_set_is_error_reply), (dbus_message_get_is_error_reply): * dbus/dbus-message.h: New functions. * dbus/dbus-protocol.h: Add error reply flag. * test/data/valid-messages/opposite-endian.message: Add NIL type to test.
* 2003-01-31 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-01-311-18/+74
| | | | | | | | | | | | | | * doc/dbus-specification.sgml: fully specify the header. Add flags and major protocol version, and change header/body len to unsigned. * dbus/dbus-message-builder.c (append_saved_length): append length as uint32 * dbus/dbus-message.c (dbus_message_create_header): change header length and body length to unsigned. Add the new fields from the spec (_dbus_message_loader_return_buffer): unsigned header/body len
* Fix sillyAnders Carlsson2003-01-301-0/+1
|
* 2003-01-30 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-01-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/Makefile.am: Add dbus-address.[ch] * dbus/dbus-address.c: (dbus_address_entry_free), (dbus_address_entries_free), (create_entry), (dbus_address_entry_get_method), (dbus_address_entry_get_value), (dbus_parse_address), (_dbus_address_test): * dbus/dbus-address.h: New files for dealing with address parsing. * dbus/dbus-connection.c: Document timeout functions. * dbus/dbus-message.c: Document dbus_message_new_from_message. * dbus/dbus-server-debug.c: Document. * dbus/dbus-server.c: (dbus_server_listen): Parse address and use correct server implementation. * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test): * dbus/dbus-string.h: New function with test. * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests): * dbus/dbus-test.h: Add address tests. * dbus/dbus-transport-debug.c: Document. * dbus/dbus-transport.c: (_dbus_transport_open): Parse address and use correct transport implementation.
* 2003-01-30 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-01-301-37/+154
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-message.c: use message->byte_order instead of DBUS_COMPILER_BYTE_ORDER throughout. (dbus_message_create_header): pad header to align the start of the body of the message to 8-byte boundary * dbus/dbus-marshal.h: make all the demarshalers take const DBusString arguments. * dbus/dbus-message.c (_dbus_message_loader_return_buffer): validate message args here, so we don't have to do slow validation later, and so we catch bad messages as they are incoming. Also add better checks on header_len and body_len. Also fill in message->byte_order * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not implemented properly) (_dbus_string_validate_nul): new function to check all-nul * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename get_arg_end_pos and remove all validation (_dbus_marshal_validate_arg): actually do validation here.
* 2003-01-29 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-01-301-1/+4
| | | | | * dbus/dbus-message.c (check_message_handling): fix assertion failure on set_client_serial