Commit graph

3027 commits

Author SHA1 Message Date
Simon McVittie
affd8a7d16 spec v0.18 and D-Bus 1.5.6 2011-07-29 16:46:38 +01:00
Simon McVittie
7afd5e97ce spec: mention that buses may have a security policy, but leave it implementation-specific
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39450
Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-07-29 16:32:03 +01:00
Simon McVittie
713f31fae5 Move the explanation of message routing to the Message Routing section, leaving behind a summary
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39450
Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-07-29 16:32:03 +01:00
Simon McVittie
755a52a316 Define eavesdropping, and document the eavesdrop match
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39450
Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-07-29 16:31:48 +01:00
Simon McVittie
8de8646311 spec: define unicast messages and broadcast signals, and explicitly allow unicast signals
I believe that the wording of the spec has always allowed unicast signals,
but most bindings assume that signals are broadcasts, so it seems worth
saying specifically that this feature exists and can be useful.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39450
Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-07-29 16:30:48 +01:00
Simon McVittie
80989477dd spec: make the Match Rules section true again
The spec previously claimed that only messages matching the client's
match rules would be received. This is not actually true: messages
listing a client as their DESTINATION are always delivered (security
policy permitting).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39450
Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-07-29 16:29:49 +01:00
Simon McVittie
6e03e0ee35 Merge branch 'dbus-1.4'
Conflicts:
	NEWS
	configure.ac
2011-07-29 16:28:32 +01:00
Simon McVittie
2dfee7317c micro version 2011-07-29 16:17:32 +01:00
Simon McVittie
7c15271a17 1.4.14 2011-07-29 14:28:54 +01:00
Simon McVittie
fe5b9d3eac NEWS for 1.5 2011-07-29 13:43:09 +01:00
Simon McVittie
3c4b38b4ba Merge branch 'dbus-1.4'
Conflicts:
	NEWS
2011-07-29 12:52:32 +01:00
Simon McVittie
bae9bb547f NEWS 2011-07-29 12:51:42 +01:00
Simon McVittie
89906f3e3d Implement _dbus_atomic_get directly, rather than via inc + dec
The Windows implementation is untested, but does at least (cross-)compile,
and matches what GLib does.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38005
Reviewed-by: Lennart Poettering <lennart@poettering.net>
2011-07-29 12:29:42 +01:00
Simon McVittie
e3c12a86d6 Remove remnants of dbus-viewer
Parts of it were already missing, it wasn't compiled, and it depends on
dbus-glib and Gtk.
2011-07-29 11:49:20 +01:00
Simon McVittie
ee7244181e tools: use AM_CPPFLAGS, and wrap its lines 2011-07-29 11:49:18 +01:00
Simon McVittie
7430df2416 test, test/name-test: remove SOURCES where they can be inferred from the name of the executable 2011-07-29 11:49:15 +01:00
Simon McVittie
590a835974 test/name-test: remove useless CFLAGS 2011-07-29 11:49:14 +01:00
Simon McVittie
add0b02ee0 test/name-test: use AM_CPPFLAGS instead of INCLUDES 2011-07-29 11:49:13 +01:00
Simon McVittie
20ae813d5f dbus: use AM_CPPFLAGS 2011-07-29 11:49:10 +01:00
Simon McVittie
4a7fe6ca53 test: promote GLIB_CFLAGS, DBUS_GLIB_CFLAGS to top level and use AM_CPPFLAGS
INCLUDES is a deprecated way to get the same effect as AM_CPPFLAGS.

It's harmless to add extra -I directories to all the tests, even those
that use neither GLib nor dbus-glib, so we can simplify by setting these
AM_CPPFLAGS for the whole directory.
2011-07-29 11:49:07 +01:00
Simon McVittie
9875480ed4 test: reverse assumption regarding static/dynamic linking
If we change the default assumption to be that new tests will be
dynamically-linked to libdbus, those tests can be useful for
installcheck or even for installation. Accordingly, explicitly use
new variable $(static_cppflags) for all tests that need static linking.
2011-07-29 11:17:29 +01:00
Simon McVittie
e5b9bc3a6b bus: use AM_CPPFLAGS to simplify preprocessor invocation
Everything in this directory is statically linked to libdbus-internal,
so we can make -DDBUS_STATIC_BUILD global. Also, merge INCLUDES into
AM_CPPFLAGS (it's an older name for the same functionality).
2011-07-29 11:17:22 +01:00
Simon McVittie
274e0fbc20 Simplify linking for tests that use libdbus-testutils
This is the library used by tests that link libdbus-internal and DBusLoop.
By linking libdbus-internal into it, we can avoid having to repeat that
dependency all over the place - libtool and cmake both know how to follow
recursive dependencies.

In cmake, also use libdbus-testutils for more tests, in preference to
repeating its source files.
2011-07-29 11:17:17 +01:00
Simon McVittie
f7b7de3bb1 Don't explicitly link thread and network libs into various tests
These tests get everything they need from the public or internal API of
libdbus-internal.la, and libtool knows how to pull in libraries'
dependencies, so we don't need explicit linking.

spawn-test and break-loader don't actually need test-utils.[ch]
either.
2011-07-29 11:16:44 +01:00
Simon McVittie
42d7a573cf Rename DBUS_CLIENT_LIBS to LIBDBUS_LIBS to more accurately reflect its meaning
This does still need to be in configure.ac, because it's common to
dbus/Makefile.am (linking the static/shared library) and dbus-1*.pc.in
(telling static library users which additional libraries they must link).
2011-07-29 11:09:02 +01:00
Simon McVittie
94a061d1b1 tools: simplify linking
* dbus-send, dbus-uuidgen only need to link libdbus; libtool knows what
  extra libraries libdbus depends on
* dbus-monitor uses a Winsock header (on Windows) so it needs
  NETWORK_libs,but still doesn't need threads
* dbus-launch needs X (on Unix) but doesn't directly need threads or
  networking
2011-07-29 11:07:51 +01:00
Simon McVittie
b643d18a36 tools: put bin_PROGRAMS one per line, eliminate unnecessary variable 2011-07-29 11:07:49 +01:00
Simon McVittie
16aae2855d Move knowledge of what the bus daemon/launcher need to link into bus/ 2011-07-29 11:07:19 +01:00
Simon McVittie
2ec1b6cca5 Substitute cflags/libs per-library
This means each module can link whatever it needs to, localizing the
knowledge of which module needs which libraries into its own
Makefile.am.
2011-07-29 11:06:50 +01:00
Simon McVittie
44a7524dde Stop defining DBUS_API_SUBJECT_TO_CHANGE
Seriously.
2011-07-29 11:06:50 +01:00
Simon McVittie
7063cb168e dbus: remove export_symbols_internal, it will always be empty
The whole point of libdbus-internal.la is that it exports all its symbols.
2011-07-29 11:06:48 +01:00
Simon McVittie
c368b36901 Simplify linking by moving -export-dynamic to AM_LDFLAGS 2011-07-29 11:06:41 +01:00
Simon McVittie
f8c131047c Remove DBUS_GLIB_CFLAGS from name-test subdirectory (not used/needed)
This appears to be left over from when dbus-glib was part of dbus.
2011-07-29 11:06:38 +01:00
Simon McVittie
b451102301 Remove DBUS_CLIENT_CFLAGS, which is always empty 2011-07-29 11:06:07 +01:00
Simon McVittie
fa9bf406b4 Remove DBUS_TEST_CFLAGS, which is empty 2011-07-29 11:05:34 +01:00
Simon McVittie
ff6b492916 Remove leftover reference to dbus-md5.[ch] 2011-07-29 11:05:31 +01:00
Simon McVittie
f7861979e1 Remove declarations for tests that no longer exist 2011-07-29 11:04:33 +01:00
Simon McVittie
1763e02bd6 Fix compilation for removal of link cache 2011-07-29 10:46:27 +01:00
Lennart Poettering
7953ca2f81 Merge branch 'dbus-1.4' 2011-07-28 21:45:35 +02:00
Lennart Poettering
0614a49274 sysdeps-unix: remove some redundant assignments 2011-07-28 21:42:48 +02:00
Lennart Poettering
3e2519b49a Merge branch 'dbus-1.4' 2011-07-28 21:26:21 +02:00
Lennart Poettering
d837d937c5 activation: add /lib/dbus-1/system-services to the search path for services
In order to allow D-Bus usage during early boot (where /usr is not
accessible) also search for bus activation files in
/lib/dbus-1/system-services/. This is only a first step in the right
direction, before we really can boot without /usr we'd need to move all
current activation files (or possibly replace
/usr/dbus-1/system-services to a symlink to
/lib/dbus-1/system-services).
2011-07-28 21:22:07 +02:00
Simon McVittie
c1ad8a9ac9 _dbus_message_remove_counter: remove ability to return the link
Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
2011-07-28 18:23:55 +01:00
Simon McVittie
63c93a1165 Add a regression test that can reproduce fd.o #34393
The number of messages is arbitrary; the more messages, the more likely
the crash is. 2000 messages seem to cause it reliably on this laptop,
but I've set it to 10000 to be safe.

Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
2011-07-28 18:23:52 +01:00
Simon McVittie
4437ddb473 Remove the per-connection link cache
With fd.o#34393 fixed, retaking the lock to cache unused links
significantly adds to locking overhead (-18% throughput in a synthetic
benchmark on an ARM device). The cache is also unlimited in size, and
probably contributes to memory growth and fragmentation by not being
under the system malloc's control.

Fixing fd.o #34393, but also dropping this cache entirely, turns out to
lead to a 5% increase in throughput on the same synthetic benchmark.

Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
2011-07-28 18:23:49 +01:00
Simon McVittie
aea47abba5 dbus_connection_dispatch: avoid freeing UnknownMethod reply until we unlock
Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
2011-07-28 18:23:45 +01:00
Simon McVittie
e2c62e668b _dbus_connection_peer_filter_unlocked_no_update: delay freeing reply
Finalizing the reply could conceivably call callbacks, so wait til we
unlock.

Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
2011-07-28 18:23:41 +01:00
Simon McVittie
8304d4a064 Don't finalize sent or dispatched messages while under the connection lock
Finalizing a message can trigger callbacks; that's bad, if we have a
connection locked.

In particular, if a message is received by the "left side", passed to
the "right side" and sent (as in test/relay.c (see the diagram there)
or in dbus-daemon), then finalizing that message could result in the
live messages counter for the left side, and the outgoing messages counter
for the right side, both being decremented while under either side's
lock.

After a message is dispatched on the left side, finalizing it now drops
the lock temporarily, to avoid this problem.

After a message is sent on the right side, finalizing it is now deferred
until the right side unlocks, by moving it to a new queue of
"expired messages" which is automatically cleared every time we release
the lock.

The "live messages" counter for the "left" connection will now explicitly
take the left connection's lock before decrementing, to avoid
manipulating watches without a lock.

Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
2011-07-28 18:23:35 +01:00
Simon McVittie
acf4056a42 Don't inline the contents of _dbus_connection_unlock
It's about to become more complex, to handle delayed deallocation of
messages in order to avoid triggering callbacks while locked.

Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
2011-07-28 18:23:31 +01:00
Simon McVittie
ab3984d327 When attaching counters to messages, don't automatically notify callbacks
In all the places where counters are added, we're under a lock. The caller
knows what effect adding the counter might have, and can replicate it
in a lock-safe way if necessary.

Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
2011-07-28 18:23:27 +01:00