Commit graph

94 commits

Author SHA1 Message Date
Colin Walters
df901b528b 2005-06-26 Colin Walters <walters@verbum.org>
* glib/dbus-glib.c (dbus_set_g_error): Delete.
	(dbus_g_error_set): New public function from its ashes; used by
	both service-side method implementation and GLib bindings
	internals.
	(dbus_g_error_has_name, dbus_g_error_get_name): New function.
	(_dbus_glib_test): Add some tests.

	* test/glib/test-dbus-glib.c (main): Test dbus_g_error_has_name.

	* test/glib/test-service-glib.c (my_object_throw_error): Use
	dbus_g_error_set.

	* glib/dbus-gobject.c (gerror_to_dbus_error_message): Handle
	errors thrown by dbus_g_error_set.

	* glib/dbus-gmain.c (dbus_g_bus_get): Change to dbus_g_error_set.

	* glib/dbus-gparser.c (validate_signature): Ditto.

	* glib/dbus-gproxy.c (dbus_g_proxy_new_for_name_owner)
	(dbus_g_proxy_end_call_internal): Ditto.

	* glib/Makefile.am: Generate dbus-glib-error-switch.h, which
	converts DBUS_ERROR_x to DBUS_GERROR_x.
	(libdbus_glib_1_la_SOURCES, BUILT_SOURCES, CLEANFILES): Add it.

	* doc/TODO: Remove error TODO.

	* doc/dbus-tutorial.xml: Update with documentation about error
	handling.

	* dbus/make-dbus-glib-error-enum.sh: Tighten up regexp to make
	sure we only change DBUS_ERROR to DBUS_GERROR, not all ERROR to
	GERROR.  Also add DBUS_GERROR_REMOTE_EXCEPTION.
2005-06-26 17:02:09 +00:00
Colin Walters
949436ffac 2005-06-17 Colin Walters <walters@verbum.org>
* glib/dbus-gproxy.c (dbus_g_proxy_emit_remote_signal): Don't
	spew warnings if we get malformed remote signals.

	* glib/dbus-gobject.c (propsig_iterate): New function.
	(lookup_object_info): New function, extracted from
	lookup_object_and_method.
	(introspect_properties, introspect_signals): Delete; these
	are merged into write_interface.
	(write_interface): Write out signals and properties here;
	dump the org.gtk.object stuff and use the interface given
	in the introspection data blob.  Also fix up property XML.
	(lookup_values): New function.
	(introspect_interfaces): Gather a mapping from interface to a
	list of its methods, signals, and properties, then write out
	each interface.
	(lookup_object_and_method): Use lookup_object_info.
	(struct DBusGSignalClosure): Add interface.
	(dbus_g_signal_closure_new): Add interface. Don't dup signame;
	we can just use the constant data.
	(dbus_g_signal_closure_finalize): Don't free signal name.
	(signal_emitter_marshaller): Use interface from signal closure.
	(export_signals): Only export signals mentioned in introspection
	blob.
	(dbus_g_connection_register_g_object): Warn if we have no
	introspection data for an object.
	(funcsig_equal): Remove unused variable.
	(dbus_g_object_register_marshaller): Take varargs instead of
	list.
	(dbus_g_object_register_marshaller_array): New function,
	extracted from old dbus_g_object_register_marshaller.

	* glib/dbus-binding-tool-glib.c (struct DBusBindingToolCData): Add
	signals and property data.
	(write_quoted_string): New function, extracted from generate_glue.
	(generate_glue): Write signals and properties to introspection
	blob.

	* dbus/dbus-glib.h (struct DBusGObjectInfo): Include
	exported_signals and exported_properties.
	(dbus_g_object_register_marshaller): Update prototype.
	(dbus_g_object_register_marshaller_array): Prototype.

	* test/glib/test-dbus-glib.c: Extend testing to cover new signals.

	* test/glib/test-service-glib.c: Add new test signals and method
	to emit them.

	* test/glib/test-service-glib.xml: Add some test signals.

	* test/glib/Makefile.am (BUILT_SOURCES): Add my-object-marshal.c
	and my-object-marshal.h
	(test_service_glib_SOURCES, test_dbus_glib_SOURCES): Add
	my-object-marshal.c.
	(my-object-marshal.c, my-object-marshal.h): Implement.

	* test/glib/.cvsignore: Update.

	* doc/TODO: Remove two GLib TODO items fixed by this
	patch.
2005-06-17 14:29:48 +00:00
Colin Walters
679018f00c 2005-06-16 Colin Walters <walters@verbum.org>
* doc/TODO: Update for GLib bindings.
2005-06-16 19:57:31 +00:00
John (J5) Palmieri
6043a0be44 * dbus/dbus-connection.c (_dbus_connection_peer_filter): New method
(_dbus_connection_run_builtin_filters): New method
        (dbus_connection_dispatch): Run the builtin filters which in turn
        runs the peer filter which handles Ping messages.

        * doc/TODO:
         - Ping isn't handled: This patch fixes it

         - Add a test case for the Ping message: added TODO item
2005-06-15 16:20:28 +00:00
John (J5) Palmieri
a93f9c04ac * dbus/dbus-message.c:
(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
2005-06-15 15:59:57 +00:00
John (J5) Palmieri
5e389fdf49 * dbus/dbus-marshal-validate.h: Added a new validation
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-06-15 15:15:32 +00:00
Colin Walters
beb9cd2eb2 2005-06-12 Colin Walters <walters@verbum.org>
Async signals and various bugfixes and testing by
	Ross Burton <ross@burtonini.com>.

	* glib/dbus-gvalue.h: (struct DBusBasicGValue): Delete.
	(dbus_gvalue_genmarshal_name_from_type)
	(dbus_gvalue_ctype_from_type): Moved to dbus-binding-tool-glib.c.
	(dbus_gtype_to_dbus_type): Renamed to dbus_gtype_from_signature.
	(dbus_g_value_types_init, dbus_gtype_from_signature)
	(dbus_gtype_from_signature_iter, dbus_gtype_to_signature)
	(dbus_gtypes_from_arg_signature): New function prototypes.
	(dbus_gvalue_demarshal): Take context and error arguments.
	(dbus_gvalue_demarshal_variant): New function.
	(dbus_gvalue_demarshal_message): New function.
	(dbus_gvalue_store): Delete.

	* glib/dbus-gvalue.c:

	File has been almost entirely rewritten; now we special-case
	more types such as DBUS_TYPE_SIGNATURE, handle arrays and
	hash tables correctly, etc.  Full support for recursive values
	is not yet complete.

	* glib/dbus-gproxy.c (dbus_g_proxy_class_init): Change last
	argument of signal to G_TYPE_POINTER since we now pass a
	structure.
	(lookup_g_marshaller): Delete in favor of
	_dbus_gobject_lookup_marshaller.
	(marshal_dbus_message_to_g_marshaller): Use
	_dbus_gobject_lookup_marshaller and dbus_gvalue_demarshal_message
	to handle remote signal callbacks.
	(dbus_g_proxy_new_from_proxy): New function; creates a new
	DBusGProxy by copying an existing one.
	(dbus_g_proxy_get_interface, dbus_g_proxy_set_interface)
	(dbus_g_proxy_get_path): New functions.
	(dbus_g_proxy_marshal_args_to_message): New function;
	factored out of existing code.
	(DBUS_G_VALUE_ARRAY_COLLECT_ALL): Collect all arguments
	from a varargs array.
	(dbus_g_proxy_begin_call_internal): New function.
	(dbus_g_proxy_end_call_internal): New function.
	(dbus_g_proxy_begin_call): Take GTypes instead of DBus types
	as arguments; simply invoke dbus_g_proxy_begin_call_internal
	after collecting args into value array.
	(dbus_g_proxy_end_call): Take GTypes instead of DBus types;
	invoke dbus_g_proxy_end_call_internal.
	(dbus_g_proxy_invoke): Simply invoke begin_call_interanl and
	end_call_internal.
	(dbus_g_proxy_call_no_reply): Take GTypes instead of DBus
	types.
	(array_free_all): New function.
	(dbus_g_proxy_add_signal): Take GTypes.

	* glib/dbus-gobject.h:
	(_dbus_glib_marshal_dbus_message_to_gvalue_array): Delete.
	(_dbus_gobject_get_path, _dbus_gobject_lookup_marshaller):
	Prototype.

	* glib/dbus-gobject.c: Add a global marshal_table hash which
	stores mappings from type signatures to marshallers.  Change lots
	of invocations of dbus_gtype_to_dbus_type to
	dbus_gtype_to_signature.
	(_dbus_glib_marshal_dbus_message_to_gvalue_array): Delete.
	(introspect_signals): Fix test for query.return_type.
	(set_object_property): Update invocation of dbus_gvalue_demarshal.
	(invoke_object_method): Many changes.  Handle asynchronous
	invocations.  Convert arguments with
	dbus_gvalue_demarshal_message.  Handle errors.  Use
	DBusSignatureIter instead of strlen on args. Handle all arguments
	generically.  Special-case variants.
	(dbus_g_method_return, dbus_g_method_return_error): New function.
	(DBusGSignalClosure): New structure, closes over signal
	information.
	(dbus_g_signal_closure_new): New function.
	(dbus_g_signal_closure_finalize): New function.
	(signal_emitter_marshaller): New function; is special marshaller
	which emits signals on bus.
	(export_signals): New function; introspects object signals and
	connects to them.
	(dbus_g_object_type_install_info): Take GType instead of
	GObjectClass.
	(dbus_g_connection_register_g_object): Invoke export_signals.
	(dbus_g_connection_lookup_g_object): New function.
	(DBusGFuncSignature) New structure; used for mapping type
	signatures to marshallers.
	(funcsig_hash): New function; hashes DBusGFuncSignature.
	(funcsig_equal): New function; compares DBusGFuncSignature.
	(_dbus_gobject_lookup_marshaller): New function.
	(dbus_g_object_register_marshaller): New function; used to
	register a marshaller at runtime for a particular signature.

	* glib/dbus-gmain.c (_dbus_gmain_test): Add various tests.

	* glib/dbus-binding-tool-glib.h: Add DBUS_GLIB_ANNOTATION_ASYNC
	which notes a server method implementation should be
	asynchronous.

	* glib/dbus-binding-tool-glib.c
	(dbus_binding_tool_output_glib_server): Call
	dbus_g_value_types_init.
	(write_formal_parameters): Use dbus_gtype_from_signature.  Handle
	variants specially.
	(dbus_g_type_get_lookup_function): Turn GType into an invocation
	of a lookup function.
	(write_args_for_direction): Use dbus_g_type_get_lookup_function.
	(write_untyped_out_args): New method; write output arguments.
	(write_formal_declarations_for_direction): Function for
	writing prototypes.
	(write_formal_parameters_for_direction): Function for
	writing implementations.
	(write_typed_args_for_direction): Function for writing
	arguments prefixed with GTypes.
	(write_async_method_client): Write out async version
	of method.

	* glib/dbus-binding-tool-glib.c: Include dbus-gvalue-utils.h.
	(dbus_g_type_get_marshal_name): Move mapping from GType
	to marshal name into here.
	(dbus_g_type_get_c_name): Move into here.
	(compute_marshaller): Convert signature to type with
	dbus_gtype_from_signature, use dbus_g_type_get_marshal_name.
	(compute_marshaller_name): Ditto.
	(compute_marshaller): Handle async signal annotations.
	(gather_marshallers): Return if we don't have a known
	prefix.
	(generate_glue): Collect introspection blob here, and
	write all of the blob at the end.  This allows an object
	with multiple interfaces to work.
	Mark async methods in introspection blob.

	* glib/Makefile.am (libdbus_glib_1_la_SOURCES): Add
	dbus-gtype-specialized.c, dbus-gtype-specialized.h,
	dbus-gvalue-utils.h, dbus-gvalue-utils.c.

	* dbus/dbus-glib.h: Don't include dbus-protocol.h; this
	avoids people accidentally using DBUS_TYPE_* which should
	not be necessary anymore.
	Do include dbus-gtype-specialized.h, which are utilities
	for GLib container types.
	Add various #defines for types such as
	DBUS_TYPE_G_BOOLEAN_ARRAY.
	(DBusGValueIterator, DBusGValue): Define, not fully used
	yet.
	(dbus_g_value_get_g_type): Type for recursive value.
	(dbus_g_value_open, dbus_g_value_iterator_get_value)
	(dbus_g_value_iterator_get_values, dbus_g_value_iterator_recurse)
	(dbus_g_value_free): Prototypes.
	(dbus_g_object_register_marshaller, dbus_g_proxy_new_from_proxy): Prototype.
	(dbus_g_proxy_set_interface): Prototype.
	(dbus_g_proxy_begin_call, dbus_g_proxy_end_call)
	(dbus_g_proxy_call_no_reply): Take GLib types instead of DBus
	types.
	(dbus_g_proxy_get_path, dbus_g_proxy_get_interface):
	Accessors.
	(DBusGAsyncData, DBusGMethodInvocation): Structures for
	doing async invocations.
	(dbus_g_method_return, dbus_g_method_return_error):
	Prototypes.
	* doc/dbus-tutorial.xml: Update GLib section.

	* tools/dbus-viewer.c (load_child_nodes): Update
	for new invocation type of dbus_g_proxy_end_call.
	(load_from_service_thread_func): Ditto.

	* tools/print-introspect.c (main): Ditto.

	* tools/dbus-names-model.c (have_names_notify)
	(names_model_reload, names_model_set_connection)
	Use GTypes.

	* python/Makefile.am (INCLUDES): Define DBUS_COMPILATION,
	needed since Python bindings use GLib bindings.

	* test/glib/Makefile.am (INCLUDES): Define DBUS_COMPILATION.
	Add --prefix argument.

	* tools/Makefile.am: Define DBUS_COMPILATION.  Remove
	unneeded --ignore-unsupported arg.

	* test/glib/test-service-glib.c:
	* test/glib/test-service-glib.xml:
	* test/glib/test-dbus-glib.c: Add many more tests.
2005-06-13 03:01:30 +00:00
David Zeuthen
982de71850 2005-06-06 David Zeuthen <davidz@redhat.com>
* doc/TODO: Add item about need to remove deprecated functions.

        * dbus/dbus-connection.h: Add prototype for dbus_connection_disconnect

        * dbus/dbus-connection.c (dbus_connection_disconnect): New function
        to repair the ABI which was broken with the last commit.
2005-06-06 18:55:22 +00:00
John (J5) Palmieri
b079ae2e34 * doc/TODO: remove connection_open/connection_disconnect lacks symmetry item that was just fixed 2005-06-02 21:32:31 +00:00
Havoc Pennington
4db285c800 2005-05-05 Havoc Pennington <hp@redhat.com>
* configure.in (LT_*): add notes on how the libtool versioning
	works to save thinking. Increment soname to indicate protocol
	breakage (though really the library interface hasn't changed I
	guess)

	* dbus/dbus-transport.c (_dbus_transport_get_is_authenticated):
	verify the GUID received from server matches what we were
	expecting, if we had an expectation

	* dbus/dbus-auth.c (send_ok): send GUID along with the OK command
	(_dbus_auth_get_guid_from_server): new function
	(send_begin): parse the OK args

	* doc/dbus-specification.xml: add GUID to the auth protocol
2005-05-05 22:02:11 +00:00
David Zeuthen
a43b6f86d1 2005-04-13 David Zeuthen <davidz@redhat.com>
* doc/TODO: Added an "important for 1.0" item about selinux
        allow/deny messages
2005-04-13 16:13:42 +00:00
Colin Walters
d477cd5edf 2005-03-01 Colin Walters <walters@verbum.org>
* doc/TODO: Remove introspection signature TODO.
2005-03-01 15:20:05 +00:00
Havoc Pennington
ee27481d7b 2005-02-26 Havoc Pennington <hp@redhat.com>
* doc/TODO: remove the "guid" item

	* test/glib/test-profile.c (no_bus_thread_func): use open_private
	(with_bus_thread_func): use open_private

	* dbus/dbus-connection.c (dbus_connection_open_private): new
	function that works like the old dbus_connection_open()
	(dbus_connection_open): now returns an existing connection if
	possible

	* dbus/dbus-server-unix.c (handle_new_client_fd_and_unlock): pass
	through the GUID to the transport

	* dbus/dbus-server.c (_dbus_server_init_base): keep around the
	GUID in hex-encoded form.

	* dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
	pass GUID argument in to the transport

	* dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): add
	guid argument

	* dbus/dbus-transport.c (_dbus_transport_init_base): add guid argument

	* dbus/dbus-auth.c (_dbus_auth_server_new): add guid argument
2005-02-26 06:37:46 +00:00
Havoc Pennington
2d0ae3d718 remove the todo item I just did 2005-02-24 19:13:37 +00:00
Havoc Pennington
209a5011f7 2005-02-20 Havoc Pennington <hp@redhat.com>
Fix bugs reported by Daniel P. Berrange

	* dbus/dbus-server.c (_dbus_server_unref_unlocked): new function
	(protected_change_watch): new function
	(_dbus_server_toggle_watch, _dbus_server_remove_watch)
	(_dbus_server_add_watch): change to work like the
	dbus-connection.c equivalents; like those, probably kind of
	busted, but should at least mostly work for now
	(dbus_server_disconnect): drop the lock if we were already
	disconnected, patch from Daniel P. Berrange

	* dbus/dbus-server.c (_dbus_server_toggle_timeout)
	(_dbus_server_remove_timeout, _dbus_server_add_timeout): all the
	same stuff

	* doc/TODO: todo about unscrewing this mess
2005-02-21 04:09:40 +00:00
Havoc Pennington
4ec87547cb add TODO about global shared connections 2005-02-19 16:59:03 +00:00
Havoc Pennington
9e4450872a 2005-02-15 Havoc Pennington <hp@redhat.com>
* dbus/dbus-connection.c (dbus_connection_dispatch): always
	complete a pending call, don't run filters first.

	* glib/dbus-gproxy.c (dbus_g_proxy_end_call): change to use
	dbus_pending_call_steal_reply

	* dbus/dbus-pending-call.c (dbus_pending_call_block): just call
	_dbus_connection_block_pending_call
	(dbus_pending_call_get_reply): change to steal_reply and return a
	ref

	* dbus/dbus-connection.c
	(dbus_connection_send_with_reply_and_block): port to work in terms
	of DBusPendingCall
	(_dbus_connection_block_pending_call): replace block_for_reply
	with this
2005-02-16 04:37:27 +00:00
Havoc Pennington
f349e6b8c5 2005-02-13 Havoc Pennington <hp@redhat.com>
* 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-13 17:16:25 +00:00
Havoc Pennington
5b26893cdd 2005-02-12 Havoc Pennington <hp@redhat.com>
* bus/driver.c: put the signature of each bus driver method in the
	table of handlers and check it on incoming calls; this isn't
	really useful, but going to add introspect support in a minute.
2005-02-12 17:13:13 +00:00
Havoc Pennington
03a4a5a976 some todo and spec tweaks 2005-02-12 04:30:34 +00:00
Havoc Pennington
892c68a727 forgot to commit removing address item from TODO 2005-02-12 03:56:22 +00:00
Havoc Pennington
71f3b461b3 2005-02-10 Havoc Pennington <hp@redhat.com>
* dbus/dbus-message-factory.c (generate_special): modify test to
	avoid using a non-basic dict key

	* dbus/dbus-marshal-validate-util.c: add test for the below

	* doc/dbus-specification.xml: require that dict keys are a basic
	type

	* dbus/dbus-marshal-validate.c
	(_dbus_validate_signature_with_reason): require that dict key is a
	basic type
2005-02-11 01:13:45 +00:00
Havoc Pennington
d2c1a633d1 2005-01-30 Havoc Pennington <hp@redhat.com>
* tools/dbus-names-model.c: dynamically watch NameOwnerChanged

	* autogen.sh: change to autotools 1.9

	* glib/dbus-gproxy.c: completely change how signals work
	(dbus_g_proxy_add_signal): new function to specify signature of a
	signal
	(dbus_g_proxy_emit_received): marshal the dbus message to GValues,
	and g_warning if the incoming message has the wrong signature.
2005-01-31 02:55:12 +00:00
Havoc Pennington
1dcacffc32 2005-01-30 Havoc Pennington <hp@redhat.com>
* glib/dbus-glib.c (dbus_g_pending_call_set_notify): new function
	(dbus_g_pending_call_cancel): new function

	* dbus/dbus-glib.h: move GType decls for connection/message here;
	* dbus/dbus-glib.c: move all the g_type and ref/unref stuff in
	here, just kind of rationalizing how we handle all that

	* tools/dbus-names-model.c: new file for a tree model listing the
	services on a bus

	* tools/dbus-tree-view.c (model_new): use proper typing on the
	model rows
2005-01-30 23:06:32 +00:00
Havoc Pennington
fd3e49f249 2005-01-29 Havoc Pennington <hp@redhat.com>
* glib/Makefile.am: rename dbus-glib-tool to dbus-binding-tool;
	though it uses glib, it could be extended for any binding in
	principle

	* glib/dbus-gobject.c (gobject_message_function): change to the
	new way properties work

	* dbus/dbus-protocol.h: add the new interfaces

	* doc/dbus-specification.xml: document the introspection format,
	Introspectable interface, and add an org.freedesktop.Properties
	interface.

	* glib/dbus-gparser.c: add support for a <property> element

	* glib/dbus-gidl.c: add PropertyInfo

	* glib/dbus-gobject.c (handle_introspect): put the outermost
	<node> outside the signal and property descriptions.
	(introspect_properties): export properties as <property> rather
	than as method calls
2005-01-29 19:52:19 +00:00
Havoc Pennington
602c4b05c4 2005-01-28 Havoc Pennington <hp@redhat.com>
* doc/TODO, doc/dbus-specification.xml: spec and TODO tweaks
	related to authentication protocol
2005-01-29 04:21:32 +00:00
Havoc Pennington
c7816d45e8 2005-01-28 Havoc Pennington <hp@redhat.com>
* 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-28 05:30:53 +00:00
Havoc Pennington
4506b6594b remove completed byteswap item 2005-01-28 00:08:28 +00:00
Havoc Pennington
ddc4a0f79a 2005-01-26 Havoc Pennington <hp@redhat.com>
* dbus/dbus-marshal-recursive.h: remove todo comment
2005-01-27 00:52:30 +00:00
Havoc Pennington
2abdb13ebe 2005-01-18 Havoc Pennington <hp@redhat.com>
* rename dbus-daemon-1 to dbus-daemon throughout
2005-01-18 22:20:38 +00:00
Havoc Pennington
8873c90f99 2005-01-18 Havoc Pennington <hp@redhat.com>
* 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-18 20:42:15 +00:00
Havoc Pennington
ad937e1695 2005-01-17 Havoc Pennington <hp@redhat.com>
* Throughout, align variant bodies according to the contained
	type, rather than always to 8. Should save a fair bit of space in
	message headers.

	* dbus/dbus-marshal-validate.c (_dbus_validate_body_with_reason):
	fix handling of case where p == end

	* doc/TODO: remove the dbus_bool_t item and variant alignment items
2005-01-17 22:03:19 +00:00
Havoc Pennington
9c3d566e95 2005-01-15 Havoc Pennington <hp@redhat.com>
* 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
2005-01-15 07:15:38 +00:00
Havoc Pennington
e07789e511 voc Pennington <hp@redhat.com>
* dbus/dbus-sysdeps.h: add _DBUS_DOUBLES_BITWISE_EQUAL macro,
	for a variety of reasons '==' doesn't do this.
2005-01-01 20:53:42 +00:00
Havoc Pennington
65090abbb9 2004-11-26 Havoc Pennington <hp@redhat.com>
* test/glib/test-profile.c: add with_bus mode to profile echoes
	that go through the bus.

	* test/glib/run-test.sh: add ability to run test-profile

	* bus/dbus-daemon-1.1.in: fix to say that SIGHUP causes partial
	config file reload.
2004-11-27 02:18:36 +00:00
Havoc Pennington
dbdea921b5 2004-11-25 Havoc Pennington <hp@redhat.com>
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-26 01:53:13 +00:00
Havoc Pennington
54752a6d94 separate out glib binding items 2004-07-03 11:20:05 +00:00
Havoc Pennington
961e6ca41c 2004-06-20 Havoc Pennington <hp@redhat.com>
* dbus/dbus-glib-error-enum.h: autogenerate the GError enum
	codes from the dbus error names

        * glib/dbus-glib.h: move to subdir dbus/ since it's included
	as dbus/dbus-glib.h and that breakage is now visible due to
	including dbus/dbus-glib.h in dbus-glib-lowlevel.h

	* glib/dbus-glib.h: s/gproxy/g_proxy/

	* dbus/dbus-shared.h: new header to hold stuff shared with
	binding APIs

	* dbus/dbus-protocol.h (DBUS_ERROR_*): move errors here rather
	than dbus-errors.h

	* glib/dbus-glib.h (dbus_set_g_error): move to
	dbus-glib-lowlevel.h

	* glib/dbus-glib.h: remove dbus/dbus.h from here; change a bunch
	of stuff to enable this

	* dbus/dbus-glib-lowlevel.h: put dbus/dbus.h here

	* a bunch of other changes with the same basic "separate glib
	bindings from dbus.h" theme
2004-06-20 15:28:15 +00:00
Havoc Pennington
a8b1cf0774 2004-06-07 Havoc Pennington <hp@redhat.com>
* doc/TODO: remove auto-activation item since it's done; sort
	items by importance/milestone
2004-06-07 21:02:23 +00:00
Havoc Pennington
72528d58be add item about per-display activation 2004-06-07 20:48:33 +00:00
Havoc Pennington
a6d1c745ab some clarifications 2004-06-07 20:07:43 +00:00
Havoc Pennington
858cfd9e74 add a couple thoughts so I remember them 2004-06-01 13:58:57 +00:00
John (J5) Palmieri
1041b44d30 * fix for TODO item:
- the varargs dbus_message_get_args() needs to support OBJECT_PATH
   and OBJECT_PATH_ARRAY
2004-05-28 19:09:00 +00:00
Kristian Høgsberg
df23f08f9b * doc/TODO: Remove resolved items.
* bus/expirelist.h (struct BusExpireList): remove unused n_items
	field.

	* bus/connection.c (bus_connections_expect_reply): Enforce the
	per-connection limit on pending replies.
2004-05-20 19:47:36 +00:00
Havoc Pennington
ce11c651a0 - Perhaps the auth protocol should be able to negotiate a protocol
version to the least-common-denominator between client and server?
   Though in practice ever using this feature would be pretty tough,
   since protocol probably modifies the API. But we could have it there
   as a safety net.
2004-05-20 02:30:10 +00:00
Kristian Høgsberg
d86fc4071c 2004-05-17 Kristian Høgsberg <krh@redhat.com>
Remove base64 encoding, replace with hex encoding. Original patch
	from trow@ximian.com, added error handling.

	* dbus/dbus-string.c (_dbus_string_base64_encode)
	(_dbus_string_base64_decode): Remove.
	(_dbus_string_hex_decode): Add end_return argument so we can
	distinguish between OOM and invalid hex encoding.
	(_dbus_string_test): Remove base64 tests and add test case for
	invalid hex.

	* dbus/dbus-keyring.c, dbus/dbus-auth-script.c, dbus/dbus-auth.c:
	Replace base64 with hex.

	* test/data/auth/invalid-hex-encoding.auth-script: New test case
	for invalid hex encoded data in auth protocol.
2004-05-17 22:19:04 +00:00
Havoc Pennington
86a4edfec2 mention removing version number from daemon name 2004-05-07 22:45:15 +00:00
John (J5) Palmieri
c24e6e11a6 * rename HEADER_FIELD_SERVICE -> HEADER_FIELD_DESTINATION
and HEADER_FIELD_SENDER_SERVICE -> HEADER_FIELD_SENDER
for both dbus-protocol.h and in the spec
2004-04-22 19:14:46 +00:00
Jon Trowbridge
0da46fa5a4 2004-04-12 Jon Trowbridge <trow@ximian.com>
* bus/config-parser.c (struct BusConfigParser): Added
	    included_files field.
	    (seen_include): Added.  Checks whether or not a file has already
	    been included by any parent BusConfigParser.
	    (bus_config_parser_new): Copy the parent's included_files.
	    (include_file): Track which files have been included, and fail on
	    circular inclusions.
	    (process_test_valid_subdir): Changed printf to report if we are
	    testing valid or invalid conf files.
	    (all_are_equiv): Changed printf to be a bit clearer about
	    what we are actually doing.
	    (bus_config_parser_test): Test invalid configuration files.
2004-04-13 01:37:57 +00:00
Mikael Hallendal
db400fed47 2003-12-13 Mikael Hallendal <micke@imendio.com>
* doc/TODO: Added not about better error check of configuration files.
2003-12-13 14:30:37 +00:00