Commit graph

128 commits

Author SHA1 Message Date
Havoc Pennington
3a02d8c132 2006-11-08 Havoc Pennington <hp@redhat.com>
* doc/dbus-specification.xml: add a note about protocol stability

	* doc/TODO: Remove "important for 1.0" section, replace with
	"important for 1.2" section
2006-11-09 00:19:29 +00:00
John (J5) Palmieri
b7491d9258 * README: remove some of the out of date flags
* doc/TODO: Remove todo items which are done
2006-11-08 23:17:20 +00:00
Havoc Pennington
151b3aaaef 2006-11-07 Havoc Pennington <hp@redhat.com>
* doc/dbus-specification.xml, doc/dbus-faq.xml, README: various
	documentation updates. Bump faq/spec versions (not to 1.0; I don't
	think the spec will be "finished"/1.0 when we ship the 1.0 library).
2006-11-07 06:13:53 +00:00
Havoc Pennington
d3440ebe9d 2006-10-30 Havoc Pennington <hp@redhat.com>
* tools/dbus-launch.1, doc/TODO: capture intent to change the
	command line options of dbus-launch a bit post 1.0
2006-10-30 06:29:58 +00:00
Havoc Pennington
fbfec98d0f 2006-10-26 Havoc Pennington <hp@redhat.com>
* dbus/dbus-sysdeps-pthread.c (_dbus_pthread_mutex_lock): change
	to be recursive
	(_dbus_pthread_mutex_unlock): make it recursive
	(_dbus_pthread_condvar_wait): save/restore the recursion count
	(_dbus_pthread_condvar_wait_timeout): save/restore the recursion count
2006-10-27 03:29:09 +00:00
John (J5) Palmieri
caae991f97 * dbus-sysdeps-unix.c (_dbus_set_local_creds): Clean up the
LOCAL_CREDS vs CMSGCRED stuff a bit.  Prefer CMSGCRED.  This
  needs to be cleaned up more.

* doc/TODO: Add a todo that *BSD hackers should look at cleaning
  up the CREDS issue.
2006-10-26 19:01:10 +00:00
Havoc Pennington
04964f9562 more todo items 2006-10-20 05:56:57 +00:00
Havoc Pennington
ebb239648b 2006-10-20 Havoc Pennington <hp@redhat.com>
* doc/TODO: remove the int64 thing from 1.0 since it doesn't
	matter, and the message-loader-breaker thing since nobody is going
	to do it.  Add an item to 1.0 about supporting recursive locks
	in dbus_threads_init_default() though, since it should be easy.

	* dbus/dbus-connection.c (_dbus_connection_read_write_dispatch):
	Fix this in the !dispatch case to avoid busy-looping after
	disconnection

        * More misc docs improvements
2006-10-20 05:16:58 +00:00
John (J5) Palmieri
2dd42bd7f5 * doc/TODO: Remove the check TODO item 2006-10-14 16:25:53 +00:00
Havoc Pennington
a2129f7ccc 2006-10-01 Havoc Pennington <hp@redhat.com>
* dbus/dbus-connection.c (_dbus_connection_close_if_only_one_ref):
	Add a hack to make DBusNewConnectionFunction work right.

	* dbus/dbus-server-socket.c (handle_new_client_fd_and_unlock): use
	the hack here. Also, fix the todo about refcount leak.

	* dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
	and use the hack here

        * dbus/dbus-connection.c: Kill the "shared" flag vs. the
	"shareable" flag; this was completely broken, since it meant
	dbus_connection_open() returned a connection of unknown
	shared-ness. Now, we always hold a ref on anything opened
	as shareable.

	Move the call to notify dbus-bus.c into
	connection_forget_shared_unlocked, so libdbus consistently forgets
	all its knowledge of a connection at once. This exposed numerous
	places where things were totally broken if we dropped a ref inside
	get_dispatch_status_unlocked where
	connection_forget_shared_unlocked was previously, so move
	connection_forget_shared_unlocked into
	_dbus_connection_update_dispatch_status_and_unlock. Also move the
	exit_on_disconnect here.

	(shared_connections_shutdown): this assumed weak refs to the
	shared connections; since we have strong refs now, the assertion
	was failing and stuff was left in the hash. Fix it to close
	still-open shared connections.

	* bus/dispatch.c: fixup to use dbus_connection_open_private on the
	debug pipe connections

	* dbus/dbus-connection.c (dbus_connection_dispatch): only notify
	dbus-bus.c if the closed connection is in fact shared
	(_dbus_connection_close_possibly_shared): rename from
	_dbus_connection_close_internal
	(dbus_connection_close, dbus_connection_open,
	dbus_connection_open_private): Improve docs to explain the deal
	with when you should close or unref or both

	* dbus/dbus-bus.c
	(_dbus_bus_notify_shared_connection_disconnected_unlocked): rename
	from _dbus_bus_check_connection_and_unref_unlocked and modify to
	loop over all connections

	* test/test-utils.c (test_connection_shutdown): don't try to close
	shared connections.

	* test/name-test/test-threads-init.c (main): fix warnings in here

	* dbus/dbus-sysdeps.c (_dbus_abort): support DBUS_BLOCK_ON_ABORT
	env variable to cause blocking waiting for gdb; drop
	DBUS_PRINT_BACKTRACE and just call _dbus_print_backtrace()
	unconditionally.

	* configure.in: add -export-dynamic to libtool flags if assertions enabled
	so _dbus_print_backtrace works.

	* dbus/dbus-sysdeps-unix.c (_dbus_print_backtrace): use fprintf
	instead of _dbus_verbose to print the backtrace, and diagnose lack
	of -rdynamic/-export-dynamic
2006-10-01 15:36:19 +00:00
John (J5) Palmieri
57ab23491c * dbus/dbus-threads.c: Allow recursive mutex's to be passed into
dbus_threads_init and be used by the dbus mutex functions to
  avoid deadlocks.

* doc/TODO: Remove recursive mutex dbus_connection_dispatch TODO item
2006-09-14 04:26:00 +00:00
John (J5) Palmieri
1eae184450 * doc/TODO:
- Remove pending call locking todo item
- dbus_connection_open now holds hard ref.  Remove todo item
- do proper locking on _dbus_bus_check_connection_and_unref
  and handle DBUS_BUS_STARTER. Remove todo item
- Warn on closing of a shared connection.  Remove todo item

* bus/bus.c, bus/connection.c, bus/dispatch.c, dbus/dbus-bus.c,
  dbus/dbus-connection.c: Use the dbus_connection_close_internal
  so we don't get the warning when closing shared connections

* test/test-service.c, test/test-shell-service.c: Applications
  don't close shared connections themselves so we unref instead of
  close

* test/test-utils.c (test_connection_shutdown): Close the connection

* dbus/dbus-bus.c (_dbus_bus_check_connection_and_unref): Changed to
  _dbus_bus_check_connection_and_unref_unlocked since we only call this
  method on a locked connection.
  Make sure we call _dbus_connection_unref_unlocked instead of
  dbus_connection_unref also.
  Handle DBUS_BUS_STARTER correctly

* dbus/dbus-connection.c (connection_record_shared_unlocked):
  Mark as shared and hard ref the connection
  (connection_forget_shared_unlocked): Remove the hard ref from the
  connection
  (_dbus_connection_close_internal_and_unlock):  New internal function
  which takes a locked connection and unlocks it after closing it
  (_dbus_connection_close_internal): New internal function which acts
  like the origonal dbus_connection_close method by grabbing a connection
  lock and calling _dbus_connection_close_internal_and_unlock
  (dbus_connection_close): Public close method, warns when the app
  trys to close a shared connection
2006-09-06 22:00:07 +00:00
John (J5) Palmieri
e4f3d0ca17 * doc/TODO: Removed dtd publishing item.
It seems the dtd has already been added at
  http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd
2006-09-06 19:40:54 +00:00
John (J5) Palmieri
88f69757b9 * doc/TODO, various source files: Audited todo's and FIXME's and
prepended the ones we should be looking at with 1.0.  Those
  prepended with 1.0? need clerification or might not be needed
  for 1.0
2006-09-06 00:14:06 +00:00
Havoc Pennington
f678f8dd41 add some items related to shared connections 2006-08-24 16:07:25 +00:00
Havoc Pennington
4bf50e206c add note about fixing locking on pending call 2006-07-21 23:21:54 +00:00
John (J5) Palmieri
b459906a7a * doc/TODO:
* dbus/dbus-bus.c:
* dbus-errors.c:
* dbus/dbus-marshal-validate.c:
  Removed TODO items which were fixed or are no longer relevent
2006-07-17 17:44:07 +00:00
John (J5) Palmieri
50f88a0322 * dbus/dbus-connection.c (dbus_connection_close): removed deprecated
function
  (dbus_connection_dispatch): On disconnect unref any shared connections

* dbus/dbus-bus.c (_dbus_bus_check_connection_and_unref): new function
  for cleaning up shared connections on disconnect
  (internal_bus_get): get a hard refrence to shared connections when
  they are created

* doc/TODO: Remove items which are no longer relevent or have been fixed
  Split 1.0 todo items with a 0.90 freeze todo list
2006-07-07 19:42:56 +00:00
Havoc Pennington
5db59894bb add dbus_bus_get refcount item to TODO
link to mail list post about pending call threading problems
2006-06-14 04:16:30 +00:00
Havoc Pennington
cd766664ac the recursive locks todo item was a little misleading 2006-06-06 20:28:57 +00:00
Havoc Pennington
345671f75c add dispatch recursion item to TODO 2006-02-15 16:38:11 +00:00
John (J5) Palmieri
1a163e765c * configure.in: Add test/name-test/Makefile to the generated
Makefile list

	* dbus/dbus-shared.h (#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT):
	New flag which replaces DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT
	(#define DBUS_NAME_FLAG_DO_NOT_QUEUE): New flag for specifying
	not to queue an ower if it can't be the primary owner

	* bus/bus.h: Add new internal BusOwner struct

	* bus/driver.c (bus_driver_handle_hello): Send flags (0 for default)
	to bus_registry_ensure and don't set the prohibit_replacement flag
	since they are now set per BusOwner and not per name.
	(bus_driver_handle_list_queued_owners): bus method (ListQueuedOwners)
	that returns the list of connections in a name's connection queue

	* bus/services.c (struct BusService): remove prohibit_replacement field
	(struct BusOwner): new struct for keeping track of queued connections
	and their associated flags for the queue
	(struct BusRegistry): add a BusOwner memory pool
	(bus_registry_new): initialize the BusOwner memory pool
	(bus_registry_unref): free the BusOwner memory pool
	(_bus_service_find_owner_link): new internal method for
	searching the queue for a specific connection
	(bus_owner_set_flags): new method for adding setting the flags on a
	bus owner
	(bus_owner_new): new method that creates a BusOwner object from the
	pool and sets its flags
	(bus_owner_ref, bus_owner_unref): ref counting for BusOwner objects
	(bus_registry_ensure): Add the flags parameter
	(bus_registry_acquire_service): Switch from using raw connections to
	using the BusOwner struct
	Add new state machine for dealing with the new set of flags
	(bus_registry_set_service_context_table, struct OwnershipCancelData,
	cancel_ownership, free_ownership_cancel_data,
	add_cancel_ownership_to_transaction, struct OwnershipRestoreData,
	restore_ownership, free_ownership_restore_data,
	add_restore_ownership_to_transaction): Switch to using BusOwner
	instead of raw connections
	(bus_service_add_owner): Add flags parameter
	Switch to using BusOwner instead of raw connections
	Add state machine for dealing with the new set of flags
	(bus_service_swap_owner): Swaps the first and second owners in the
	queue.  Used to make sure proper signals are sent when a service looses
	or gains primary ownership.  We never insert an owner at the top of the
	queue.  Instead we insert it in the second position and then swap.
	(bus_service_remove_owner): Remove the owner from the queue sending
	out the NameLost and NameOwnerChanged signals if the we were the
	primary owner
	(bus_service_get_primary_owners_connection): New method that extracts
	the connection from the primary owner
	(bus_service_get_primary_owner): Returns the BusOwner instead of the
	connection
	(bus_service_get_allow_replacement): Changed from the old
	bus_service_get_prohibit_replacement method.  Checks the flags of the
	primary owner and returns if it can be replaced or not
	(bus_service_set_prohibit_replacement): removed
	(bus_service_has_owner): returns TRUE if and owner with
	the specified connection exists in the queue

	* dbus/dbus-bus.c (dbus_bus_connection_get_unique_name): New helper
	method that only compiles if tests are enabled.  Allows us to get the
	unique name of a connection so we can check it against the queue when
	doing regression tests

	* bus/activation.c (bus_activation_send_pending_auto_activate),
	bus/dispatch.c (bus_dispatch),
	bus/driver.c (bus_driver_handle_get_service_owner,
	bus_driver_handle_get_connection_unix_user,
	bus_driver_handle_get_connection_unix_process_id,
	bus_driver_handle_get_connection_selinux_security_context),
	bus/signals.c (connection_is_primary_owner):
	use bus_service_get_primary_owners_connection instead of
	bus_service_get_primary_owner

	* dbus/dbus-sysdeps.c (_dbus_connect_unix_socket,
	_dbus_listen_unix_socket): Calculate the length of the socket
	path and use that instead of using a fixed length which was
	causing socket names to contain many trailing Nul bytes.

	* dbus/dbus-glib-lowlevel.h, glib/dbus-gobject.c
	(dbus_g_method_get_sender): New method for extracting the sender
	from a DBusGMethodInvocation
	(dbus_g_method_return_get_reply): changed name to
	dbus_g_method_get_reply
	(dbus_g_method_return_send_reply): changed name to
	dbus_g_method_send reply

	* doc/dbus-specification.xml: New docs that describe how the new
	queueing system works and talks about the changes to the how
	we specify socket names

	* glib/examples/example-service.c,
	glib/examples/example-signal-emitter.c,
	glib/examples/statemachine/statemachine-server.c:
	Changed the RequestName flags to the new system

	* test/name-test/ (test-names.c, run-test.sh, Makefile.am): New
	regression test suite for testing various states of the new
	queueing system
2005-11-22 20:37:00 +00:00
John (J5) Palmieri
66e1cb9e68 * bus/driver.c (bus_driver_handle_introspect): Add signals
to the introspect data. (patch from Daniel P. Berrange
  <dan at berrange.com>)

* bus/dispatch.c (check_existent_ping): Add testcase for Ping

* dbus/dbus-connection.c (_dbus_connection_peer_filter,
  _dbus_connection_run_builtin_filters): Changed these to
  be unlock_no_update functions and call
  _dbus_connection_send_unlocked_no_update instead of
  dbus_connection_send to avoid locking errors.

* doc/TODO: Removed the make Ping test TODO
2005-10-03 19:55:56 +00:00
Havoc Pennington
51c609c340 links to some pending tasks 2005-08-25 03:15:46 +00:00
Havoc Pennington
c76d24b007 some docs cleanups 2005-08-01 18:59:02 +00:00
Havoc Pennington
afcc19c157 add "publish introspect dtd" to TODO for 1.0 2005-07-31 01:38:55 +00:00
Havoc Pennington
ba04a545aa 2005-07-29 Havoc Pennington <hp@redhat.com>
* test/glib/test-profile.c (write_junk): initialize the junk
	buffer so valgrind doesn't have a breakdown
2005-07-30 01:33:55 +00:00
Havoc Pennington
c8a5cff515 remove that todo item 2005-07-29 17:46:58 +00:00
Havoc Pennington
51a4261d0e 2005-07-29 Havoc Pennington <hp@redhat.com>
* bus/signals.c (bus_signals_test): add match_rule_equal() tests
	(match_rule_matches): remove unused arg
	(test_matching): add tests for match_rule_matches()

	* bus/signals.c (bus_match_rule_parse_arg_match): add ability to
	do arg0='foo' arg5='bar' in the match rules
	(match_rule_matches): don't match if the arg0='foo' doesn't match.

	* dbus/dbus-protocol.h (DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER): add this
2005-07-29 17:43:30 +00:00
Colin Walters
3b628f9209 2005-07-15 Colin Walters <walters@verbum.org>
* doc/TODO: Add note about convenience wrappers.
2005-07-15 22:02:25 +00:00
John (J5) Palmieri
a7595655fb * bus/dispatch.c, test/test-service.c: Add testcase
for sending messages to oneself (TODO item).

* python/service.py (class Object): Swap ordering of bus_name
  and object_path parameters to better support inheritance.

* doc/dbus-tutorial.xml: change Python docs to reflect change
  in parameter ordering and fix the inheritance section.

* doc/TODO: remove sending message to oneself TODO item
2005-07-15 15:21:43 +00:00
John (J5) Palmieri
d06bfe528b * python/dbus_bindings.pyx.in: removed
* python/dbus_bindings.pyx: Added.
	- Fixed some memleaks (patch from
	  Sean Meiners <sean.meiners@linspireinc.com>)
	- Broke out the #include "dbus_h_wrapper.h" and put it in its
	  own pxd file (Pyrex definition)
	- Broke out glib dependancies into its own pyx module

* python/dbus_bindings.pdx: Added.
	- Defines C class Connection for exporting to other modules

* python/dbus_glib_bindings.pyx: Added.
	- New module to handle lowlevel dbus-glib mainloop integration

* python/glib.py: Added.
	- Registers the glib mainloop when you import this module

* python/services.py: Removed (renamed to service.py)

* python/service.py: Added.
	- (class Server): renamed Name

* python/__init__.py: Bump ro version (0,41,0)
	- don't import the decorators or service module
   	  by default.  These now reside in the dbus.service namespace

* python/_dbus.py (Bus::__init__): Add code run the main loop
  setup function on creation

* python/examples/example-service.py,
  python/examples/example-signal-emitter.py: update examples

* python/examples/gconf-proxy-service.py,
  python/examples/gconf-proxy-service2.py: TODO fix these up

* doc/TODO: Addition
	- Added a Python Bindings 1.0 section
	- added "Add match on args or match on details to match rules"
2005-07-12 18:16:07 +00:00
Colin Walters
8c095eea8f 2005-07-10 Colin Walters <walters@verbum.org>
* doc/TODO: Knock off some GLib items with this patch.

	* glib/dbus-gvalue-utils.c (_dbus_gtype_can_signal_error)
	(_dbus_gvalue_signals_error): New functions.

	* glib/dbus-gvalue-utils.h: Prototype them.

	* glib/dbus-gobject.c (arg_iterate): Update to handle return vals
	and change to not output const/retval flags for input args.  All
	callers updated.
	(invoke_object_method): Refactor to handle return values.  Add
	some more comments in various places.  Remove debug g_print.

	* glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_RETURNVAL): New.

	* glib/dbus-binding-tool-glib.c (dbus_g_type_get_marshal_name):
	Handle G_TYPE_NONE.
	(compute_gsignature): New function; refactored from code from
	compute_marshaller and compute_marshaller_name.  Enhance to
	handle return values and async ops more cleanly.  Update for
	async ops returning NONE instead of BOOLEAN.
	(compute_marshaller, compute_marshaller_name): Call compute_gsignature
	and output appropriate string.
	(generate_glue): Handle return value annotation.  Also don't dump
	constness flag for input arguments.

	* glib/Makefile.am (DBUS_GLIB_INTERNALS): New variable; contains
	files shared between installed library and utilities.
	(libdbus_glib_1_la_SOURCES): Move some stuf into DBUS_GLIB_INTERNALS.
	(libdbus_gtool_la_SOURCES): Suck in DBUS_GLIB_INTERNALS so the
	binding tool can access gtype utility functions.

	* test/glib/test-service-glib.c:
	* test/glib/test-service-glib.xml:
	* test/glib/test-dbus-glib.c: Add some tests for return values.
2005-07-10 22:54:19 +00:00
Colin Walters
82d6ea6ca6 2005-07-08 Colin Walters <walters@verbum.org>
* doc/TODO: Update GLib todo bits, also add a post-1.0 TODO for a
	connection concept.
2005-07-08 16:41:57 +00:00
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