Commit graph

2929 commits

Author SHA1 Message Date
Cosimo Alfarano
f997b0ac48 Fix dbus-monitor using eavesdrop=true when no filters are passed
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-07-12 18:36:40 +01:00
Simon McVittie
cb843a5643 DBusHeader: only store byte-order in the fixed-length header
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38287
2011-07-11 17:55:13 +01:00
Simon McVittie
47fb9da6ad DBusMessage: don't redundantly store byte order, ask the DBusHeader
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38287
2011-07-11 17:54:36 +01:00
Cosimo Alfarano
56b9629d69 Add "eavesdrop=true" as constant match rule for dbus-monitor
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37890
Bug-NB: NB#269748
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-07-11 17:03:54 +01:00
Cosimo Alfarano
a940e7b1d1 Do not allow eavedropping unless rule owner explicitely declare it
Adds "eavesdrop=true" as a match rule, meaning that the owner
intend to eavedrop.
Otherwise the owner will receive only broadcasted messages and the ones
meant to be delivered to it.

[plus a typo fix in an error message -smcv]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37890
Bug-NB: NB#269748
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-07-11 17:03:20 +01:00
Simon McVittie
0ecd0a02b9 Merge remote-tracking branch 'origin/dbus-1.4' 2011-07-11 13:23:38 +01:00
Jiří Klimeš
ea8aabf0be DBusConnection: simplify registering object paths code
Introduce static generic _dbus_connection_register_object_path()
function to remove duplicate code for registration object paths.
Having *four* almost the same functions is error-prone and hard
to follow as well.

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
2011-07-11 13:23:23 +01:00
Simon McVittie
fa1a85e121 Cope with platforms whose vsnprintf violates both POSIX and C99 - part 1 2011-07-08 11:00:12 +02:00
Simon McVittie
7b63fe3cfa In Windows _dbus_printf_string_upper_bound, don't crash on malloc failure 2011-07-08 11:00:02 +02:00
Ralf Habacker
110e06a78c Added DBUS_ENABLE_STATS option to cmake buildsystem to keep in sync with autotools. 2011-07-08 10:55:46 +02:00
Ralf Habacker
0161eb8c34 Visual Studio Professional uses a different ide starter - pointed out by Romain Pokrzywka 2011-07-08 10:55:16 +02:00
Ralf Habacker
836b84a05a Collected cmake doc into README.cmake. 2011-07-08 10:55:03 +02:00
Ralf Habacker
ba9178b153 Visual Studio Professional uses a different ide starter - pointed out by Romain Pokrzywka 2011-07-08 10:53:20 +02:00
Ralf Habacker
1fd58d6db4 win32 fix: Keep server autolaunch mutex settings according to client detection algorithmus. 2011-07-05 19:45:23 +02:00
Ralf Habacker
4ee7b07b20 Fixed cmake buildsystem - option command only supports boolean values 2011-07-04 23:47:45 +02:00
Simon McVittie
b32aaa8a57 Cope with platforms whose vsnprintf violates both POSIX and C99 - part 1 2011-07-03 06:47:39 +02:00
Simon McVittie
e7bd2bb848 In Windows _dbus_printf_string_upper_bound, don't crash on malloc failure 2011-07-03 06:36:07 +02:00
Ralf Habacker
84b03cae58 Limit batch file creating to windows 2011-07-03 01:39:09 +02:00
Ralf Habacker
b77885c1db Fixed cmake buildsystem on unix - option command only supports boolean values 2011-07-03 01:36:48 +02:00
Ralf Habacker
6321a98492 Collected cmake doc into README.cmake. 2011-07-02 21:02:46 +02:00
Ralf Habacker
a7f98d8819 Added DBUS_ENABLE_STATS option to cmake buildsystem to keep in sync with autotools. 2011-07-02 00:53:23 +02:00
Ralf Habacker
e2f94ea14f win32 fix: Keep server autolaunch mutex settings according to client detection algorithmus. 2011-07-01 16:28:19 +02:00
Simon McVittie
636a9a29f8 Merge branch 'dbus-1.4' 2011-07-01 14:54:42 +01:00
Jiří Klimeš
0dcb911251 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
2011-07-01 14:48:48 +01:00
Simon McVittie
30f116fd2d 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
2011-06-24 16:01:56 +01:00
Simon McVittie
cf08dce402 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
2011-06-24 16:01:56 +01:00
Simon McVittie
f69ac31dd9 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
2011-06-24 16:01:56 +01:00
Simon McVittie
fce1f6b55f DBusConnection, DBusTransport: add queue statistics
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040
2011-06-24 16:01:46 +01:00
Simon McVittie
8a3e7581e7 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
2011-06-24 16:01:06 +01:00
Simon McVittie
2351f57081 DBusList: add usage stats
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040
2011-06-24 16:01:02 +01:00
Simon McVittie
82bc508785 DBusMemPool: add usage stats
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040
2011-06-24 16:00:57 +01:00
Simon McVittie
206fff7ee6 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
2011-06-24 16:00:49 +01:00
Simon McVittie
bc212b72b2 configure.ac: add --enable-stats
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040
2011-06-24 16:00:43 +01:00
Simon McVittie
85e9a28303 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
2011-06-24 16:00:13 +01:00
Simon McVittie
16b9600964 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>
2011-06-22 19:15:05 +01:00
Simon McVittie
e3b9a0597c 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>
2011-06-22 19:15:01 +01:00
Simon McVittie
c8a7417c73 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>
2011-06-22 19:14:46 +01:00
Ralf Habacker
736445ee44 CMake fix: Do not use FORCE in variables which should be changeable by the user. 2011-06-20 09:29:12 +02:00
Ralf Habacker
aba867f242 fixed cmake error: doc says CACHE needs type *and* doc string 2011-06-14 18:45:46 +02:00
Simon McVittie
5e7824729d NEWS 2011-06-13 16:54:00 +01:00
Simon McVittie
a246e250d0 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>
2011-06-13 16:37:25 +01:00
Simon McVittie
9aa45eef4d DBusLoop: fold Callback into TimeoutCallback
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-06-13 16:32:49 +01:00
Simon McVittie
6600f17a7e 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>
2011-06-13 16:30:27 +01:00
Simon McVittie
5bd6056169 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>
2011-06-13 16:28:06 +01:00
Simon McVittie
0292b1a56d 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>
2011-06-13 16:25:33 +01:00
Simon McVittie
88bf20007b 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>
2011-06-13 16:20:41 +01:00
Simon McVittie
7d9592ef55 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>
2011-06-13 16:18:19 +01:00
Simon McVittie
63b9770604 Remove _dbus_loop_add_watch_full
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-06-13 16:15:53 +01:00
Simon McVittie
e421626d86 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>
2011-06-13 16:13:02 +01:00
Simon McVittie
4b43f5db7a 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>
2011-06-13 16:09:50 +01:00