platform/upstream/dbus.git
13 years agowin32 fix: Keep server autolaunch mutex settings according to client detection algori...
Ralf Habacker [Fri, 1 Jul 2011 14:28:19 +0000 (16:28 +0200)]
win32 fix: Keep server autolaunch mutex settings according to client detection algorithmus.

13 years agoMerge branch 'dbus-1.4'
Simon McVittie [Fri, 1 Jul 2011 13:54:42 +0000 (14:54 +0100)]
Merge branch 'dbus-1.4'

13 years agoDBusConnection: use DBUS_ERROR_OBJECT_PATH_IN_USE instead of DBUS_ERROR_ADDRESS_IN_USE
Jiří Klimeš [Fri, 1 Jul 2011 10:58:11 +0000 (12:58 +0200)]
DBusConnection: use DBUS_ERROR_OBJECT_PATH_IN_USE instead of DBUS_ERROR_ADDRESS_IN_USE

While registering an object path the possible error is
DBUS_ERROR_OBJECT_PATH_IN_USE, not DBUS_ERROR_ADDRESS_IN_USE (the error
is set by _dbus_object_tree_register()).

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38874

13 years agoInclude size of link cache in per-connection statistics
Simon McVittie [Tue, 8 Feb 2011 15:48:12 +0000 (15:48 +0000)]
Include size of link cache in per-connection statistics

Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040

13 years agoAlso record peak values for queued bytes/fds in connection stats
Simon McVittie [Fri, 11 Feb 2011 17:16:09 +0000 (17:16 +0000)]
Also record peak values for queued bytes/fds in connection stats

Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040

13 years agoAdd an initial round of stats to the Stats interface
Simon McVittie [Tue, 8 Feb 2011 15:41:54 +0000 (15:41 +0000)]
Add an initial round of stats to the Stats interface

Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040

13 years agoDBusConnection, DBusTransport: add queue statistics
Simon McVittie [Tue, 8 Feb 2011 12:51:33 +0000 (12:51 +0000)]
DBusConnection, DBusTransport: add queue statistics

Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040

13 years agoBusConnections: add usage stats for well-known names, match rules
Simon McVittie [Tue, 8 Feb 2011 12:31:08 +0000 (12:31 +0000)]
BusConnections: add usage stats for well-known names, match rules

Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040

13 years agoDBusList: add usage stats
Simon McVittie [Tue, 8 Feb 2011 12:30:06 +0000 (12:30 +0000)]
DBusList: add usage stats

Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040

13 years agoDBusMemPool: add usage stats
Simon McVittie [Tue, 8 Feb 2011 12:29:52 +0000 (12:29 +0000)]
DBusMemPool: add usage stats

Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040

13 years agoAdd a stub .Debug.Stats interface if --enable-stats
Simon McVittie [Tue, 8 Feb 2011 15:33:35 +0000 (15:33 +0000)]
Add a stub .Debug.Stats interface if --enable-stats

There are no actual statistics yet, just a count of how many times the
method has been called, and (for the per-connection stats) the unique name.

Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040

13 years agoconfigure.ac: add --enable-stats
Simon McVittie [Tue, 1 Mar 2011 15:14:02 +0000 (15:14 +0000)]
configure.ac: add --enable-stats

Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040

13 years agomatch_rule_to_string: don't reinvent dbus_message_type_to_string
Simon McVittie [Mon, 31 Jan 2011 15:55:53 +0000 (15:55 +0000)]
match_rule_to_string: don't reinvent dbus_message_type_to_string

We don't allow match rules with unknown message types, so losing the
"type='%d'" case isn't a great loss.

Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040

13 years agoRemove maximum length field from DBusString
Simon McVittie [Wed, 22 Jun 2011 13:57:56 +0000 (14:57 +0100)]
Remove maximum length field from DBusString

The source code says it's "a historical artifact from a feature that
turned out to be dumb". Respond accordingly!

This reduces sizeof (DBusString) by 20% on ILP32 architectures, which
can't hurt. (No reduction on LP64 architectures that align pointers
naturally, unfortunately.)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38570
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
13 years agoRemove unused _dbus_string_copy_data_len, _dbus_string_steal_data_len
Simon McVittie [Wed, 22 Jun 2011 13:56:27 +0000 (14:56 +0100)]
Remove unused _dbus_string_copy_data_len, _dbus_string_steal_data_len

They're only compiled when building tests.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38570
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
13 years agoSplit DBUS_GENERIC_STRING_PREAMBLE into sensible lines
Simon McVittie [Wed, 22 Jun 2011 13:44:28 +0000 (14:44 +0100)]
Split DBUS_GENERIC_STRING_PREAMBLE into sensible lines

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38570
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
13 years agoCMake fix: Do not use FORCE in variables which should be changeable by the user.
Ralf Habacker [Mon, 20 Jun 2011 07:29:12 +0000 (09:29 +0200)]
CMake fix: Do not use FORCE in variables which should be changeable by the user.

13 years agofixed cmake error: doc says CACHE needs type *and* doc string
Ralf Habacker [Tue, 14 Jun 2011 16:45:46 +0000 (18:45 +0200)]
fixed cmake error: doc says CACHE needs type *and* doc string

13 years agoNEWS
Simon McVittie [Mon, 13 Jun 2011 15:54:00 +0000 (16:54 +0100)]
NEWS

13 years agoDBusLoop: store watches in a hash table keyed by fd
Simon McVittie [Thu, 7 Apr 2011 16:36:54 +0000 (17:36 +0100)]
DBusLoop: store watches in a hash table keyed by fd

This means we don't need to build up the watches_for_fds array, because
it's quick to find the watches based on the fd.

This also fixes fd.o #23194, because we only put each fd in the
array of DBusPollFD once, with the union of all its watches' flags; we
can no longer get more entries in the array than our number of file
descriptors, which is capped at our RLIMIT_NOFILE, so we can't get
EINVAL from poll(2).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=23194
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoDBusLoop: fold Callback into TimeoutCallback
Simon McVittie [Mon, 24 Jan 2011 15:30:02 +0000 (15:30 +0000)]
DBusLoop: fold Callback into TimeoutCallback

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoDrop WatchCallback entirely, just use a list of DBusWatch in the main loop
Simon McVittie [Tue, 25 Jan 2011 12:55:27 +0000 (12:55 +0000)]
Drop WatchCallback entirely, just use a list of DBusWatch in the main loop

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoDBusLoop: inline add_callback, remove_callback into their callers
Simon McVittie [Mon, 24 Jan 2011 14:38:13 +0000 (14:38 +0000)]
DBusLoop: inline add_callback, remove_callback into their callers

The watch and timeout code paths will diverge completely when we change
WatchCallback * to just be a DBusWatch *, removing the benefit of having
common code.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoDBusLoop: move OOM flag in watches inside the DBusWatch
Simon McVittie [Tue, 25 Jan 2011 12:37:01 +0000 (12:37 +0000)]
DBusLoop: move OOM flag in watches inside the DBusWatch

This will eventually let us maintain a DBusPollFD[] of just the active
watches, between several iterations. The more immediate benefit is that
WatchCallback can go away, because it only contains a refcount, a
now-useless type, and a watch that already has its own refcount.

This doesn't take any more memory for DBusWatch when not using DBusLoop
(e.g. in client/service code or bindings), because we're just using more
bits in an existing bitfield.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoDBusLoop: keep separate lists of watches and timeouts
Simon McVittie [Fri, 21 Jan 2011 18:37:26 +0000 (18:37 +0000)]
DBusLoop: keep separate lists of watches and timeouts

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoDBusLoop: factor out watch_flags_to_poll_events, watch_flags_from_poll_revents
Simon McVittie [Fri, 21 Jan 2011 18:29:05 +0000 (18:29 +0000)]
DBusLoop: factor out watch_flags_to_poll_events, watch_flags_from_poll_revents

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoRemove _dbus_loop_add_watch_full
Simon McVittie [Tue, 25 Jan 2011 12:28:32 +0000 (12:28 +0000)]
Remove _dbus_loop_add_watch_full

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agobus-activation: separate the "finished" callback from the watch callback
Simon McVittie [Fri, 21 Jan 2011 18:24:19 +0000 (18:24 +0000)]
bus-activation: separate the "finished" callback from the watch callback

This has been marked as broken since 2003...

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoDBusLoop: remove second layer of watch callbacks where possible
Simon McVittie [Fri, 21 Jan 2011 18:54:33 +0000 (18:54 +0000)]
DBusLoop: remove second layer of watch callbacks where possible

Similar to the previous commit, almost every use of DBusWatch can just
have the main loop call dbus_watch_handle.

The one exception is the bus activation code; it's had a comment
explaining why it's wrong since 2003. We should fix that one day, but for
now, just migrate it to a new _dbus_loop_add_watch_full which preserves
the second-layer callback.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoDBusLoop: remove a layer of pointless abstraction around timeouts
Simon McVittie [Fri, 21 Jan 2011 18:54:09 +0000 (18:54 +0000)]
DBusLoop: remove a layer of pointless abstraction around timeouts

Instead of supplying 8 tiny wrapper functions around dbus_timeout_handle,
each with a user_data parameter that's a potentially unsafe borrowed
pointer but isn't actually used, we can call dbus_timeout_handle directly
and save a lot of trouble.

One of the wrappers previously called dbus_timeout_handle repeatedly
if it returned FALSE to indicate OOM, but that timeout's handler never
actually returned FALSE, so there was no practical effect. The rest just
ignore the return, which is documented as OK to do.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoDBusConnection: ref the connection in the timeout handler
Simon McVittie [Thu, 20 Jan 2011 15:48:07 +0000 (15:48 +0000)]
DBusConnection: ref the connection in the timeout handler

client_timeout_callback in bus/test.c refs the connection across the
timeout invocation, which looks suspiciously like a workaround. If we
make the timeout handler itself ref the connection, we won't need that,
and can simplify timeout handling drastically.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agobus signal_handler: don't use _dbus_warn, and don't pretend to be portable
Simon McVittie [Mon, 13 Jun 2011 14:59:14 +0000 (15:59 +0100)]
bus signal_handler: don't use _dbus_warn, and don't pretend to be portable

_dbus_warn isn't async-signal-safe, so that's out. We can use write()
instead; it's POSIX but not ISO C, but then again, so are signals.
Accordingly, guard it with DBUS_UNIX.

dbus-sysdeps-util-win doesn't actually implement _dbus_set_signal_handler
anyway, so not compiling this code on non-Unix seems more honest.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agobus: signal_handler: ignore failure to write, and explain why
Simon McVittie [Mon, 13 Jun 2011 14:58:45 +0000 (15:58 +0100)]
bus: signal_handler: ignore failure to write, and explain why

See the comment in the source code for rationale.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoCheck that watches are removed, then invalidated, then unreffed
Simon McVittie [Fri, 21 Jan 2011 16:49:14 +0000 (16:49 +0000)]
Check that watches are removed, then invalidated, then unreffed

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agoAlways remove, invalidate and free watches before closing watched sockets
Simon McVittie [Fri, 21 Jan 2011 18:51:27 +0000 (18:51 +0000)]
Always remove, invalidate and free watches before closing watched sockets

This should mean we don't get invalid fds in the main loop.

The BSD (kqueue) and Windows code paths are untested, but follow the same
patterns as the tested Linux/generic Unix versions.

DBusTransportSocket was already OK (it called free_watches() before
_dbus_close_socket, and that did the remove, invalidate, unref dance).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
13 years agobump version
Simon McVittie [Mon, 13 Jun 2011 09:32:30 +0000 (10:32 +0100)]
bump version

13 years agoahem.
Simon McVittie [Fri, 10 Jun 2011 22:47:33 +0000 (23:47 +0100)]
ahem.

13 years agoPrepare 1.5.4 dbus-1.5.4
Simon McVittie [Fri, 10 Jun 2011 21:59:26 +0000 (22:59 +0100)]
Prepare 1.5.4

13 years agoMerge branch 'dbus-1.4'
Simon McVittie [Fri, 10 Jun 2011 21:46:42 +0000 (22:46 +0100)]
Merge branch 'dbus-1.4'

Conflicts:
NEWS
configure.ac

13 years agoversion bump
Simon McVittie [Fri, 10 Jun 2011 21:45:46 +0000 (22:45 +0100)]
version bump

13 years agoprepare 1.4.12 dbus-1.4.12
Simon McVittie [Fri, 10 Jun 2011 20:56:16 +0000 (21:56 +0100)]
prepare 1.4.12

13 years agofix installable tests to not install if unwanted
Simon McVittie [Fri, 10 Jun 2011 20:52:39 +0000 (21:52 +0100)]
fix installable tests to not install if unwanted

13 years agoMerge branch 'dbus-1.4'
Simon McVittie [Fri, 10 Jun 2011 17:52:07 +0000 (18:52 +0100)]
Merge branch 'dbus-1.4'

13 years agoNEWS
Simon McVittie [Fri, 10 Jun 2011 17:52:01 +0000 (18:52 +0100)]
NEWS

13 years agoFix copyright dates
Simon McVittie [Fri, 10 Jun 2011 17:23:52 +0000 (18:23 +0100)]
Fix copyright dates

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoUse DBUS_TIMEOUT_INFINITE in dbus-daemon.c
Simon McVittie [Fri, 10 Jun 2011 16:41:04 +0000 (17:41 +0100)]
Use DBUS_TIMEOUT_INFINITE in dbus-daemon.c

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoAdd and use DBUS_TIMEOUT_INFINITE and DBUS_TIMEOUT_USE_DEFAULT
Simon McVittie [Fri, 10 Jun 2011 16:38:14 +0000 (17:38 +0100)]
Add and use DBUS_TIMEOUT_INFINITE and DBUS_TIMEOUT_USE_DEFAULT

The documentation claimed that INT_MAX (whatever that means) meant the
default, but the value that has actually always been checked for is
0x7fffffff (aka INT32_MAX on the competent platforms we sadly don't
restrict our portability to), so we should use that. (In practice D-Bus
probably never worked on platforms where int wasn't 32 bits, though.)

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoTest that a message with the byte order mangled causes disconnection but no crash
Simon McVittie [Thu, 9 Jun 2011 16:43:34 +0000 (17:43 +0100)]
Test that a message with the byte order mangled causes disconnection but no crash

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120

13 years agomarshal test: test dbus_message_demarshal_bytes_needed
Simon McVittie [Thu, 9 Jun 2011 17:36:05 +0000 (18:36 +0100)]
marshal test: test dbus_message_demarshal_bytes_needed

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120

13 years agoAdd a test for marshalling and endian-swapping
Simon McVittie [Thu, 9 Jun 2011 17:47:04 +0000 (18:47 +0100)]
Add a test for marshalling and endian-swapping

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120

13 years agoinstallcheck: don't run installed tests against installed library if in a DESTDIR
Simon McVittie [Wed, 8 Jun 2011 17:47:14 +0000 (18:47 +0100)]
installcheck: don't run installed tests against installed library if in a DESTDIR

That probably won't work, because it'll find the system-wide library
which might be older.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoAlter test-dbus-daemon so it tests the installed dbus-daemon by default
Simon McVittie [Wed, 8 Jun 2011 17:15:05 +0000 (18:15 +0100)]
Alter test-dbus-daemon so it tests the installed dbus-daemon by default

For installcheck, adjust it to use things from DESTDIR.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoAdd support for installing most of the modular tests
Simon McVittie [Wed, 8 Jun 2011 16:39:41 +0000 (17:39 +0100)]
Add support for installing most of the modular tests

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agonew test for being disconnected by a corrupt message stream
Simon McVittie [Fri, 15 Apr 2011 12:32:48 +0000 (13:32 +0100)]
new test for being disconnected by a corrupt message stream

This was meant to reproduce fd.o #15578, but doesn't; the cause of that
bug isn't this simple.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agomodular tests: depend on GIO 2.22 for GSocket
Simon McVittie [Fri, 15 Apr 2011 12:31:33 +0000 (13:31 +0100)]
modular tests: depend on GIO 2.22 for GSocket

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoTest nonce-tcp transport
Simon McVittie [Tue, 22 Feb 2011 13:43:18 +0000 (13:43 +0000)]
Test nonce-tcp transport

Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=34569

Reviewed-by: David Zeuthen <davidz@redhat.com>
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agodbus-daemon test: sanity-check the just-installed config file when using DESTDIR
Simon McVittie [Mon, 21 Mar 2011 18:40:16 +0000 (18:40 +0000)]
dbus-daemon test: sanity-check the just-installed config file when using DESTDIR

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoAdd a simple integration test for dbus-daemon
Simon McVittie [Fri, 11 Mar 2011 13:13:17 +0000 (13:13 +0000)]
Add a simple integration test for dbus-daemon

This just pushes 2000 messages (or 100000 in performance-testing mode)
through the dbus-daemon, to an echo service and back.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoRun integration tests on the installed dbus binaries during installcheck
Simon McVittie [Fri, 11 Mar 2011 13:11:30 +0000 (13:11 +0000)]
Run integration tests on the installed dbus binaries during installcheck

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoGive the tests DBUS_TEST_DAEMON and DBUS_TEST_DATA in their environment
Simon McVittie [Fri, 11 Mar 2011 12:45:08 +0000 (12:45 +0000)]
Give the tests DBUS_TEST_DAEMON and DBUS_TEST_DATA in their environment

This will allow modular tests to spawn a dbus-daemon with a specified
config file; nothing uses this just yet.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoAttempt to reproduce fd.o #34393 via another regression test
Simon McVittie [Tue, 22 Feb 2011 16:32:14 +0000 (16:32 +0000)]
Attempt to reproduce fd.o #34393 via another regression test

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoloopback test: unref messages after use
Simon McVittie [Tue, 22 Feb 2011 16:31:02 +0000 (16:31 +0000)]
loopback test: unref messages after use

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoAdd an end-to-end sanity check for TCP and Unix DBusServer/DBusConnection
Simon McVittie [Tue, 22 Feb 2011 13:04:18 +0000 (13:04 +0000)]
Add an end-to-end sanity check for TCP and Unix DBusServer/DBusConnection

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoAdd support for building "modular" tests, which require GLib and dbus-glib
Simon McVittie [Tue, 22 Feb 2011 11:43:11 +0000 (11:43 +0000)]
Add support for building "modular" tests, which require GLib and dbus-glib

For the moment, the CMake build system only knows about the existing
"embedded tests"; make it define both symbols, though.

We use GLib because it has GTester (and life's too short to write yet another
JUnit clone), and dbus-glib for the main-loop integration only (see
fd.o #31515 for thoughts on incorporating just those two functions in a
separate library in the dbus tarball).

I'm not using DBusLoop for the main loop because I specifically don't
want to use non-public API or ABI of libdbus in the modular tests. If we make
sure they work against a shared libdbus, we can use them to test the
installed system, with "make installcheck".

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agoDon't disable GLib assertions when disabling our own assertions
Simon McVittie [Tue, 22 Feb 2011 11:39:23 +0000 (11:39 +0000)]
Don't disable GLib assertions when disabling our own assertions

We no longer use GLib internally, and assertions are how it'll report test
failures when we add GTest-based tests.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570

13 years agodbus_message_demarshal_bytes_needed: correct a wrong assertion
Simon McVittie [Thu, 9 Jun 2011 17:35:43 +0000 (18:35 +0100)]
dbus_message_demarshal_bytes_needed: correct a wrong assertion

It's entirely possible for a message to indicate how many bytes we need,
without actually being complete.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
13 years ago_dbus_header_byteswap: change the first byte of the message, not just the struct...
Simon McVittie [Thu, 9 Jun 2011 16:52:10 +0000 (17:52 +0100)]
_dbus_header_byteswap: change the first byte of the message, not just the struct member

This has been wrong approximately forever, for instance see:
http://lists.freedesktop.org/archives/dbus/2007-March/007357.html

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629938
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
13 years agoConsistently use atomic operations for all access to DBusConnection refcount
Simon McVittie [Fri, 10 Jun 2011 17:08:11 +0000 (18:08 +0100)]
Consistently use atomic operations for all access to DBusConnection refcount

Trying to mix atomic operations with locked non-atomic operations is
broken: the atomic ops aren't necessarily atomic with respect to the
locked non-atomic ops, and the non-atomic ops aren't protected by the
lock because the atomic ops can change the refcount behind their back.

In theory we could use the connection lock if atomic ops aren't supported
(making a per-connection lock cheaper than the global lock used to
implement atomic ops) *and* our mutexes are recursive (making it safe
against deadlocks)... but life's too short.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38005
Tested-by: Will Manley <freedesktop williammanley net>
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
13 years agoMerge branch 'dbus-1.4'
Simon McVittie [Wed, 8 Jun 2011 10:38:21 +0000 (11:38 +0100)]
Merge branch 'dbus-1.4'

13 years agoNEWS
Simon McVittie [Wed, 8 Jun 2011 10:35:22 +0000 (11:35 +0100)]
NEWS

13 years agobus: use ln -fs to enable dbus in systemd, not $(LN_S)
Simon McVittie [Tue, 7 Jun 2011 13:01:39 +0000 (14:01 +0100)]
bus: use ln -fs to enable dbus in systemd, not $(LN_S)

Using $(LN_S) is inappropriate because it could in theory mean either
ln -s, ln or cp -p depending on autoconf checks.

Not using -f breaks reinstallation directly from source (DESTDIR unset),
because the symlinks will already exist.

Because systemd isn't currently portable to non-Linux, let alone
non-SUS-compliant systems, it seems safe to assume that ln -fs behaves
as specified by SUS if systemd was found.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37870
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agoMerge branch 'dbus-1.4'
Simon McVittie [Tue, 7 Jun 2011 13:37:30 +0000 (14:37 +0100)]
Merge branch 'dbus-1.4'

Conflicts:
NEWS

13 years agoNEWS
Simon McVittie [Tue, 7 Jun 2011 13:36:15 +0000 (14:36 +0100)]
NEWS

13 years agoRemove support for -Wl,--gc-sections altogether
Simon McVittie [Mon, 6 Jun 2011 08:59:37 +0000 (09:59 +0100)]
Remove support for -Wl,--gc-sections altogether

Packagers should only enable this flag if they have confirmed that it
actually works on their toolchain (it's the sort of rarely used feature
that frequently regresses on obscure architectures/OSs without anyone
noticing), and also confirmed that it is actually a significant size win
for their configuration.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33466
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agodon't try to build dbus-daemon-launch-helper for Windows
Mark Brand [Wed, 1 Jun 2011 21:51:21 +0000 (23:51 +0200)]
don't try to build dbus-daemon-launch-helper for Windows

Fixed regression in b0acded which breaks build for Windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37838
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
13 years agoUse #!/bin/sh for run-with-tmp-session-bus.sh
Simon McVittie [Wed, 1 Jun 2011 17:36:16 +0000 (18:36 +0100)]
Use #!/bin/sh for run-with-tmp-session-bus.sh

It doesn't seem to have any bashisms, and bash isn't in /bin on *BSD.

Suggested by Timothy Redaelli.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35880

13 years agoadd a release name here too
Simon McVittie [Wed, 1 Jun 2011 16:04:27 +0000 (17:04 +0100)]
add a release name here too

13 years agoadd release name :-)
Simon McVittie [Wed, 1 Jun 2011 16:04:07 +0000 (17:04 +0100)]
add release name :-)

13 years agorestart development
Simon McVittie [Wed, 1 Jun 2011 15:54:15 +0000 (16:54 +0100)]
restart development

13 years agoFinalize D-Bus Spec 0.17, update lists of authors dbus-1.5.2
Simon McVittie [Wed, 1 Jun 2011 11:15:52 +0000 (12:15 +0100)]
Finalize D-Bus Spec 0.17, update lists of authors

13 years agoMerge branch 'dbus-1.4'
Simon McVittie [Wed, 1 Jun 2011 11:19:02 +0000 (12:19 +0100)]
Merge branch 'dbus-1.4'

Conflicts:
NEWS
configure.ac

13 years agoDevelopment version
Simon McVittie [Wed, 1 Jun 2011 11:16:53 +0000 (12:16 +0100)]
Development version

13 years agoPrepare version 1.4.10 dbus-1.4.10
Simon McVittie [Wed, 1 Jun 2011 11:01:58 +0000 (12:01 +0100)]
Prepare version 1.4.10

13 years agoFixes for Visual Studio 2010 cmake generator - reported by Ray Satiro.
Ralf Habacker [Sat, 28 May 2011 11:59:50 +0000 (13:59 +0200)]
Fixes for Visual Studio 2010 cmake generator - reported by Ray Satiro.

13 years agoFixed cmake syntax errors.
Ralf Habacker [Sat, 28 May 2011 11:56:18 +0000 (13:56 +0200)]
Fixed cmake syntax errors.

13 years agoMerge branch 'dbus-1.4'
Simon McVittie [Wed, 25 May 2011 17:18:00 +0000 (18:18 +0100)]
Merge branch 'dbus-1.4'

13 years agoNEWS
Simon McVittie [Wed, 25 May 2011 17:17:53 +0000 (18:17 +0100)]
NEWS

13 years agobus_context_log: divert messages to stderr if we're not using syslog
Simon McVittie [Wed, 16 Mar 2011 14:52:39 +0000 (14:52 +0000)]
bus_context_log: divert messages to stderr if we're not using syslog

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agoprocess_config_first_time_only: initialize syslog as intended.
Simon McVittie [Tue, 15 Mar 2011 15:42:56 +0000 (15:42 +0000)]
process_config_first_time_only: initialize syslog as intended.

On Linux, we previously called openlog() (with different options!) while
initializing SELinux; leave SELinux messages as LOG_USER|LOG_INFO in case
anyone was relying on that, but let the rest of our log messages come
out as LOG_DAEMON.

Also enable LOG_PERROR (copy syslog messages to stderr) unconditionally;
we can make this an autoconf check if anyone's pet Unix doesn't have
LOG_PERROR.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358
Reviewed-by: Colin Walters <walters@verbum.org>
13 years ago_dbus_init_system_log: remove FIXME on Windows
Simon McVittie [Tue, 15 Mar 2011 15:32:02 +0000 (15:32 +0000)]
_dbus_init_system_log: remove FIXME on Windows

We don't need any initialization here, so there's nothing to fix.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agobus_context_check_security_policy: syslog if we hit the outgoing quota
Simon McVittie [Tue, 15 Mar 2011 14:16:18 +0000 (14:16 +0000)]
bus_context_check_security_policy: syslog if we hit the outgoing quota

In practice, nothing copes with missing broadcast signals, so the least
we can do is make the failure mode visible.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agobus_context_check_security_policy: for SELinux denials, share code to set errors
Simon McVittie [Tue, 15 Mar 2011 14:02:06 +0000 (14:02 +0000)]
bus_context_check_security_policy: for SELinux denials, share code to set errors

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agobus_context_check_security_policy: factor out complain_about_message
Simon McVittie [Tue, 15 Mar 2011 13:05:23 +0000 (13:05 +0000)]
bus_context_check_security_policy: factor out complain_about_message

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agoMerge branch 'dbus-1.4'
Simon McVittie [Wed, 25 May 2011 16:39:34 +0000 (17:39 +0100)]
Merge branch 'dbus-1.4'

13 years agoCheck for X even if X11 autolaunching is disabled
Simon McVittie [Fri, 25 Feb 2011 12:49:54 +0000 (12:49 +0000)]
Check for X even if X11 autolaunching is disabled

DBUS_ENABLE_X11_AUTOLAUNCH obviously requires DBUS_BUILD_X11. However,
the converse is not true.

If DBUS_BUILD_X11 is defined, dbus-launch will be able to connect to
the X server to determine when the session ends; most distributors will
want this, but it can be disabled with the standard Autoconf option
--without-x.

If DBUS_ENABLE_X11_AUTOLAUNCH is *also* defined, dbus-launch and libdbus
will be willing to perform autolaunch. Again, most distributors will want
this, but it can be disabled with --disable-x11-autolaunch.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agotest-autolaunch: don't expect autolaunching to work if X11 is disabled
Simon McVittie [Fri, 25 Feb 2011 12:34:38 +0000 (12:34 +0000)]
test-autolaunch: don't expect autolaunching to work if X11 is disabled

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agoMerge branch 'dbus-1.4'
Simon McVittie [Wed, 25 May 2011 16:00:18 +0000 (17:00 +0100)]
Merge branch 'dbus-1.4'

13 years agoNEWS
Simon McVittie [Wed, 25 May 2011 16:00:07 +0000 (17:00 +0100)]
NEWS

13 years agoWhen checking for __sync_sub_and_fetch, don't underquote, to shut up recent autoconf
Simon McVittie [Mon, 9 May 2011 17:49:54 +0000 (18:49 +0100)]
When checking for __sync_sub_and_fetch, don't underquote, to shut up recent autoconf

Without the correct number of levels of quoting, autoconf mistakenly
believes we didn't use AC_LANG_SOURCE where required. (In fact,
AC_LANG_PROGRAM calls AC_LANG_SOURCE.)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19681
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agoWhen checking for va_copy, use AC_LANG_SOURCE to shut up recent autoconf
Simon McVittie [Mon, 9 May 2011 17:48:52 +0000 (18:48 +0100)]
When checking for va_copy, use AC_LANG_SOURCE to shut up recent autoconf

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19681
Reviewed-by: Colin Walters <walters@verbum.org>