Commit graph

1047 commits

Author SHA1 Message Date
Havoc Pennington
daaee020dc - remove DICT type
- add SIGNATURE type
- fix max name len of 256, should be 255 so it fits in a byte if it's going to be a number
  near 256
- generalize some of the recursive type marshaling code to share between arrays and variants
- just started on implementing variant
2004-12-30 22:34:17 +00:00
John (J5) Palmieri
7da3315f8c 2004-12-30 John (J5) Palmieri <johnp@redhat.com>
* python/dbus.py: s/ACTIVATION_REPLY_ACTIVE/ACTIVATION_REPLY_ACTIVATED
2004-12-30 18:28:03 +00:00
John (J5) Palmieri
63586e48f4 2004-12-30 John (J5) Palmieri <johnp@redhat.com>
* python/dbus_bindings.pyx.in: Change DBUS_ACTIVATION_REPLY_ACTIVATED
        and DBUS_ACTIVATION_REPLY_ALREADY_ACTIVE to match the values in
        dbus-protocol.h.  Because they are defines and not enums they are not
        autogenerated.
2004-12-30 14:19:54 +00:00
Havoc Pennington
eb4b165e30 DBusTypeWriterClass isn't going to work well, so remove vestiges of it. 2004-12-29 22:31:01 +00:00
Havoc Pennington
9b0fc4e482 switch to a vtable approach for the reader 2004-12-29 22:22:41 +00:00
Havoc Pennington
8645ee5251 put it in the test suite arrays (ok, I need to rewrite the unit tests here to be more automated...) 2004-12-29 06:39:32 +00:00
Havoc Pennington
fb1dfc9a9f struct of array of struct and array of struct of array 2004-12-29 06:27:59 +00:00
Havoc Pennington
160cf6f808 checkpoint with array-of-struct working 2004-12-29 05:04:01 +00:00
Havoc Pennington
d9afb9b5f1 arrays are working, woot 2004-12-28 23:14:31 +00:00
Havoc Pennington
7debfd9ff5 sync busted marshaling work in progress 2004-12-28 04:55:52 +00:00
John (J5) Palmieri
a11bbc91a7 2004-12-26 John (J5) Palmieri <johnp@redhat.com>
* python/dbus_bindings.pyx.in (bus_activate_service): Bind
	dbus_bus_activate_service

	* python/dbus.py (Bus.activate_service): activate a service on the
	bus.
2004-12-27 16:01:13 +00:00
Havoc Pennington
b8a309ac94 2004-12-24 Havoc Pennington <hp@redhat.com>
* test/decode-gcov.c: change to use .gcno and .gcda files, but the
	file format has also changed and I haven't adapted to that yet

	* Makefile.am: load .gcno files from latest gcc
2004-12-24 17:54:01 +00:00
John (J5) Palmieri
f019ebdd20 * Forgot to add ChangeLog on last commit 2004-12-23 17:22:29 +00:00
John (J5) Palmieri
f06f148871 * patch from Rob Taylor <robtaylor@fastmail.fm>
- wrap bus_get_unix_user method in low level bindings
	- add get_unix_user method to the Bus class
	- fix extract.py so it can handle unsigned long return types
2004-12-23 00:50:37 +00:00
Olivier Andrieu
dbd4279a80 * dbus/make-dbus-glib-error-enum.sh: omit the function keyword for
better POSIX compliance.
2004-12-21 10:51:46 +00:00
Havoc Pennington
617e73f763 2004-12-19 Havoc Pennington <hp@redhat.com>
* dbus/dbus-string.c (_dbus_string_insert_4_aligned)
	(_dbus_string_insert_8_aligned): new functions

	* dbus/dbus-string.c (_dbus_string_alloc_space): new function
2004-12-19 16:23:09 +00:00
Havoc Pennington
305a8d4d98 back up some files I'm working on that don't do anything yet 2004-12-19 00:11:49 +00:00
Havoc Pennington
f3228b477d 2004-12-18 Havoc Pennington <hp@redhat.com>
* dbus/dbus-string.c (_dbus_string_validate_ascii): use ISASCII
	macro

	* dbus/dbus-message.c: fix a comment, and add a still-unused
	not-implemented function

	* dbus/dbus-marshal.h: fix comment

	* dbus/dbus-internals.h (_DBUS_ISASCII): new macro
2004-12-19 00:11:20 +00:00
Joe Shaw
b360305cda 2004-12-17 Joe Shaw <joeshaw@novell.com>
* mono/DBusType/Byte.cs, mono/DBusType/Int32.cs,
	mono/DBusType/Int64.cs, mono/DBusType/UInt32.cs,
	mono/DBusType/UInt64.cs: Use Enum.GetUnderlyingType() instead of
	Type.UnderlyingSystemType to get the actual system type
	underneath.  This code previously depended on the broken Mono
	behavior, which was fixed in 1.1.3.
2004-12-17 22:21:16 +00:00
Havoc Pennington
b60c835d34 2004-11-27 Havoc Pennington <hp@redhat.com>
* dbus/dbus-string.h (_dbus_string_get_byte): inline when asserts
	are disabled
	(_dbus_string_get_const_data): inline when asserts are disabled

	* dbus/dbus-message.c: record the _dbus_current_generation of
	creation so we can complain if dbus_shutdown() is used improperly.
	Do this only if checks are enabled.

	* dbus/dbus-connection.c: ditto
2004-11-27 07:30:22 +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
9e289c6488 2004-11-26 Havoc Pennington <hp@redhat.com>
* test/glib/test-profile.c: clean up how the fake_malloc_overhead
	thing was implemented
2004-11-27 00:19:49 +00:00
Havoc Pennington
f4a3751eef 2004-11-26 Havoc Pennington <hp@redhat.com>
* test/glib/test-profile.c: tweak a bit, add support for some
	made-up minimal malloc overhead with plain sockets, since in
	real life some sort of buffers are unavoidable thus we could
	count them in the theoretical best case
2004-11-26 07:42:24 +00:00
Havoc Pennington
2d251ec0d3 2004-11-26 Havoc Pennington <hp@redhat.com>
* dbus/dbus-message.c (dbus_message_cache_or_finalize): fix bug
	where I was trying to cache one too many messages
2004-11-26 07:03:05 +00:00
Havoc Pennington
3d1df90a45 2004-11-26 Havoc Pennington <hp@redhat.com>
* dbus/dbus-message.c: reimplement message cache as an array which
	makes the cache about twice as fast and saves maybe 1.5% overall
2004-11-26 06:52:15 +00:00
Havoc Pennington
7fc350740c 2004-11-26 Havoc Pennington <hp@redhat.com>
* dbus/dbus-threads.c (init_global_locks): forgot to put the
	message cache lock here
2004-11-26 06:30:38 +00:00
Havoc Pennington
a58180de0e 2004-11-26 Havoc Pennington <hp@redhat.com>
* dbus/dbus-message.c (struct DBusMessage): put the locked bit and
	the "char byte_order" next to each other to save 4 bytes
	(dbus_message_new_empty_header): reduce preallocation, since the
	message cache should achieve a similar effect
	(dbus_message_cache_or_finalize, dbus_message_get_cached): add a
	message cache that keeps a few DBusMessage around in a pool,
	another 8% speedup or so.

	* dbus/dbus-dataslot.c (_dbus_data_slot_list_clear): new function
2004-11-26 06:22:53 +00:00
Havoc Pennington
c670c23823 2004-11-25 Havoc Pennington <hp@redhat.com>
* dbus/dbus-transport-unix.c (unix_do_iteration): if we're going
	to write, without reading or blocking, try it before the poll()
	and skip the poll() if nothing remains to write. This is about a
	3% speedup in the echo client/server
2004-11-26 02:29:00 +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
2ce2ab4368 2004-11-23 Havoc Pennington <hp@redhat.com>
* test/glib/test-profile.c: modify to accept a plain_sockets
	argument in which case it will bench plain sockets instead of
	libdbus, for comparison purposes.
2004-11-23 06:21:12 +00:00
Havoc Pennington
25c1f310aa 2004-11-22 Havoc Pennington <hp@redhat.com>
* test/glib/test-profile.c (N_CLIENT_THREADS): run multiple
	threads for more time, so sysprof can get a grip on it.

	* dbus/dbus-string.c (_dbus_string_validate_utf8): remove
	pointless variable
2004-11-22 19:20:29 +00:00
Havoc Pennington
1b1dfafc34 2004-11-13 Havoc Pennington <hp@redhat.com>
* test/glib/test-profile.c: fix this thing up a bit

	* dbus/dbus-message.c (dbus_message_new_empty_header): increase
	preallocation sizes by a fair bit; not sure if this will be an
	overall performance win or not, but it does reduce reallocs.

	* dbus/dbus-string.c (set_length, reallocate_for_length): ignore
	the test hack that forced constant realloc if asserts are
	disabled, so we can profile sanely. Sprinkle in some
	_DBUS_UNLIKELY() which are probably pointless, but before I
	noticed the real performance problem I put them in.
	(_dbus_string_validate_utf8): micro-optimize this thing a little
	bit, though callgrind says it didn't help; then special-case
	ascii, which did help a lot; then be sure we detect nul bytes as
	invalid, which is a bugfix.
	(align_length_then_lengthen): add some more _DBUS_UNLIKELY
	superstition; use memset to nul the padding instead of a manual
	loop.
	(_dbus_string_get_length): inline this as a
	macro; it showed up in the profile because it's used for loop
	tests and so forth
2004-11-13 07:07:47 +00:00
Havoc Pennington
aa1294405e add a little comment about WNOHANG/EINTR 2004-11-10 20:12:15 +00:00
Colin Walters
255342aa67 2004-11-10 Colin Walters <walters@verbum.org>
* dbus/dbus-spawn.c (check_babysit_events): Handle EINTR,
	for extra paranoia.
2004-11-10 06:53:10 +00:00
Colin Walters
935a41a04c 2004-11-09 Colin Walters <walters@verbum.org>
* dbus/dbus-string.c (_dbus_string_get_length): New
	function, writes DBusString to C buffer.

	* dbus/dbus-string.h: Prototype it.

	* dbus/dbus-message.c (dbus_message_type_to_string): New
	function, converts message type into C string.

	* dbus/dbus-message.h: Prototype it.

	* bus/selinux.c (bus_selinux_check): Take source pid,
	target pid, and audit data.  Pass audit data to
	avc_has_perm.
	(log_audit_callback): New function, appends extra
	audit information.
	(bus_selinux_allows_acquire_service): Also take
	service name, add it to audit data.
	(bus_selinux_allows_send): Also take message
	type, interface, method member, error name,
	and destination, and add them to audit data.
	(log_cb): Initialize func_audit.

	* bus/selinux.h (bus_selinux_allows_acquire_service)
	(bus_selinux_allows_send): Update prototypes

	* bus/services.c (bus_registry_acquire_service): Pass
	service name to bus_selinux_allows_acquire_service.

	* bus/bus.c (bus_context_check_security_policy): Pass
	additional audit data.  Move assignment of dest
	to its own line.
2004-11-09 06:11:33 +00:00
Colin Walters
2f5e949851 2004-11-07 Colin Walters <walters@verbum.org>
* dbus/dbus-transport-unix.c (do_authentication): Always
	initialize auth_completed.
2004-11-07 17:06:34 +00:00
Colin Walters
cdac3e058b 2004-11-07 Colin Walters <walters@verbum.org>
* bus/bus.c (load_config): Break into three
	separate functions: process_config_first_time_only,
	process_config_every_time, and process_config_postinit.
	(process_config_every_time): Move call of
	bus_registry_set_service_context_table into
	process_config_postinit.
	(process_config_postinit): New function, does
	any processing that needs to happen late
	in initialization (and also on reload).
	(bus_context_new): Instead of calling load_config,
	open config parser here and call process_config_first_time_only
	and process_config_every_time directly.  Later, after
	we have forked but before changing UID,
	invoke bus_selinux_full_init, and then call
	process_config_postinit.
	(bus_context_reload_config): As in bus_context_new,
	load parse file inside here, and call process_config_every_time
	and process_config_postinit.

	* bus/services.h, bus/services.c
	(bus_registry_set_service_context_table): Rename
	from bus_registry_set_sid_table.  Take string hash from config
	parser, and convert them here into SIDs.

	* bus/config-parser.c (struct BusConfigParser): Have
	config parser only store a mapping of service->context
	string.
	(merge_service_context_hash): New function.
	(merge_included): Merge context string hashes instead
	of using bus_selinux_id_table_union.
	(bus_config_parser_new): Don't use bus_selinux_id_table_new;
	simply create a new string hash.
	(bus_config_parser_unref): Unref it.
	(start_selinux_child): Simply insert strings into hash,
	don't call bus_selinux_id_table_copy_over.

	* bus/selinux.h, bus/selinux.c (bus_selinux_id_table_union)
	(bus_selinux_id_table_copy_over): Delete.
2004-11-07 17:05:19 +00:00
Colin Walters
a14c43cf3a *** empty log message *** 2004-11-04 04:10:18 +00:00
Colin Walters
1a02f93b50 2004-11-03 Colin Walters <walters@verbum.org>
* bus/selinux.c (bus_selinux_pre_init): Kill some unused
	variables.
2004-11-04 04:09:31 +00:00
Colin Walters
9b6814a59b 2004-11-03 Colin Walters <walters@verbum.org>
* bus/test-main.c (test_pre_hook): Fix test logic,
	thanks Joerg Barfurth <Joerg.Barfurth@Sun.COM>.
2004-11-03 16:38:35 +00:00
Colin Walters
47f094399c *** empty log message *** 2004-11-02 20:28:00 +00:00
Colin Walters
73ffe59d87 2004-11-02 Colin Walters <walters@verbum.org>
* bus/selinux.c (bus_selinux_init): Split into two functions,
	bus_selinux_pre_init and bus_selinux_post_init.
	(bus_selinux_pre_init): Just determine whether SELinux is
	enabled.
	(bus_selinux_post_init): Do everything else.

	* bus/main.c (main): Call bus_selinux_pre_init before parsing
	config file, and bus_selinux_post_init after.  This ensures that
	we don't lose the policyreload notification thread that
	bus_selinux_init created before forking previously.

	* bus/test-main.c (test_pre_hook): Update for split.
2004-11-02 20:27:48 +00:00
Owen Fraser-Green
c7417009b1 Patch from Johan Fischer to make mono doc install create the doc dir. 2004-11-02 10:19:20 +00:00
Colin Walters
e430788a6b 2004-10-29 Colin Walters <walters@redhat.com>
* dbus/dbus-sysdeps.h (_dbus_become_daemon): Also take
	parameter for fd to write pid to.

	* dbus/dbus-sysdeps.c (_dbus_become_daemon): Implement it.

	* bus/bus.c (bus_context_new): Pass print_pid_fd
	to _dbus_become_daemon (bug #1720)
2004-10-29 19:59:15 +00:00
Colin Walters
fbc29a8a78 2004-10-29 Colin Walters <walters@redhat.com>
Patch from Ed Catmur <ed@catmur.co.uk>

	* mono/doc/Makefile.am (install-data-local): Handle
	DESTDIR.
2004-10-29 19:22:59 +00:00
Colin Walters
f556da00b1 2004-10-29 Colin Walters <walters@redhat.com>
* bus/.cvsignore, qt/.cvsignore: Update.
2004-10-29 19:20:02 +00:00
Colin Walters
38c20f8477 2004-10-29 Colin Walters <walters@redhat.com>
Patch from Kristof Vansant <de_lupus@pandora.be>

	* configure.in: Detect Slackware.
	* bus/Makefile.am (SCRIPT_IN_FILES): Add rc.messagebus.in.
	* bus/rc.messagebus.in: New file.
2004-10-29 19:17:57 +00:00
Colin Walters
588da01c17 Add comment about workaround. 2004-10-29 18:52:30 +00:00
Colin Walters
0880b83d86 2004-10-29 Colin Walters <walters@redhat.com>
* tools/dbus-monitor.c (filter_func): Return
	DBUS_HANDLER_RESULT_HANDLED in filter function
	for now.  See:
	http://freedesktop.org/pipermail/dbus/2004-August/001433.html
2004-10-29 18:50:29 +00:00
Colin Walters
e11c966b55 2004-10-29 Colin Walters <walters@redhat.com>
Patch from Matthew Rickard <mjricka@epoch.ncsc.mil>

	* bus/services.c (bus_registry_acquire_service):
	Correctly retrieve service name from DBusString
	for printing.
2004-10-29 18:13:53 +00:00