summaryrefslogtreecommitdiff
path: root/dbus
AgeCommit message (Collapse)AuthorFilesLines
2011-09-28Fix various minor documentation bugsHEADmasterSimon McVittie6-27/+55
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-28specialized types: improve documentation and document more thingsSimon McVittie2-55/+387
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-28dbus_g_type_collection_value_iterate, etc.: check that the type is suitableSimon McVittie1-4/+25
Otherwise we'd probably crash when we cast the vtable to an inappropriate type, and call its methods with inappropriate arguments as a result. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-28dbus_g_type_collection_get_fixed: check preconditions on the type and vtableSimon McVittie1-4/+10
Previously, if it wasn't a collection or didn't have the fixed_accessor, we'd just segfault. Not ideal. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-28dbus-gtype-specialized: warn if vtables have missing callbacksSimon McVittie1-1/+18
It's just about conceivable that they wouldn't segfault, if application authors carefully avoided the unimplemented functionality... but still. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-28Tidy up docs for DBusGError and its pseudo-methodsSimon McVittie1-15/+18
* attach the introductory doc-comments to the enum and macro names, not the internal function * remove docs for method parameters which didn't actually exist * more cross-references * make the domain macro visible in the documentation index Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27DBusGProxy: be more pedantic about boolean returnsSimon McVittie1-5/+5
Returning false doesn't strictly imply that the error is set; if you're being pedantic enough, it's really a tri-state where TRUE indicates success, FALSE indicates failure, and calling the function incorrectly results in undefined behaviour (currently a critical warning and returning FALSE). Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: NB#218973
2011-09-27DBusGProxy: misc documentation tidyingSimon McVittie1-9/+28
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27DBusGProxy: make argument names in declaration, definition and docs consistentSimon McVittie2-35/+32
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27DBusGProxy: mark struct contents as privateSimon McVittie1-0/+2
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Remove declaration of dbus_pending_call_get_g_type, which doesn't existSimon McVittie1-8/+0
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Add DBUS_TYPE_CONNECTION, DBUS_TYPE_MESSAGE to the docs, and document them ↵Simon McVittie1-4/+11
better Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Tidy up docs for DBusGMessageSimon McVittie1-10/+18
* document the instance struct * make argument names match the headers * document the GType macro, not the function it calls, and mention it in the documentation (since this is a boxed type, so it's non-obvious) Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Clean up docs for DBusGConnectionSimon McVittie1-9/+17
* introductory doc-comment for the (pseudo-)class * attach the doc-comment for the GType to the macro, not the internal function * rename function parameters to match what the header file says Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-08-17get_all_object_properties: if _dbus_gvalue_marshal fails, bail outSimon McVittie1-2/+25
This isn't necessarily OOM: _dbus_gvalue_marshal can fail due to programming errors. If so, raise a critical warning, then (if that wasn't fatal) return a D-Bus error to be sent to the caller. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17get_all_object_properties: note which operations can only fail via OOMSimon McVittie1-0/+12
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17get_all_object_properties: skip invalidly-named properties, with a criticalSimon McVittie1-0/+9
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17dbus-gobject: add and use connection_send_or_die to check for OOMSimon McVittie1-15/+25
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Conflicts: dbus/dbus-gobject.c
2011-08-17emit_signal_for_registration: assert that signal headers are all validSimon McVittie1-0/+4
This is an assertion, not a return_if_fail, because we already checked the object path in dbus_g_connection_register_g_object and the others in export_signals. After these checks, dbus_message_new_signal can really only fail on OOM. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17export_signals: check interface, signal names for validitySimon McVittie1-0/+14
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17object_registration_message: check for OOM when a property is absentSimon McVittie1-3/+5
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17object_registration_message: make logic/assertions slightly clearerSimon McVittie1-7/+6
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17object_registration_message: handle remote caller errors betterSimon McVittie1-6/+14
If the remote process sends us a wrong message, that's its fault, not ours; we should send back a comprehensible D-Bus error, and not spam to stderr. Previously, in each of these cases libdbus would have sent back NoReply, because we declined to handle the method call. One case that's still wrong is passing extra arguments to Get, GetAll or Set, like so: Get("com.example.Iface", "MyProperty", "extra") Set("com.example.Iface", "MyProperty", Variant("foo"), "extra") GetAll("com.example.Iface", "extra") dbus-glib has historically warned, ignored the extra argument(s) and sent back a reply as if they hadn't been there, whereas a stricter implementation (like telepathy-glib's TpDBusPropertiesMixin) would have sent back an error reply and done nothing. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17get_object_property: add brief documentationSimon McVittie1-0/+5
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17get_object_property: unwind on errors, and avoid returning NULLSimon McVittie1-10/+23
Also treat all errors here as programming errors (because this method should never fail), upgrading them from warning to critical; return a D-Bus error reply anyway, to be nicer to our callers. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17check_property_access: centralize error handling (and check for OOM)Simon McVittie1-26/+43
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17dbus-gobject: check for NULL when producing messagesSimon McVittie1-3/+3
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Conflicts: dbus/dbus-gobject.c
2011-08-17dbus-gobject: factor out reply_or_die, error_or_die and add error-checkingSimon McVittie1-33/+50
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17invoke_object_method: if marshalling an out argument fails, discard messageSimon McVittie1-11/+36
We shouldn't report this as OOM, because it probably wasn't (it's much more likely to be programming error); we should also continue through the arguments, so that we don't leak them. By abandoning the message as soon as we detect a programming error, we can use reply == NULL as an indicator of whether to keep appending. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17invoke_object_method, dbus_g_method_return_error: handle sending failureSimon McVittie1-2/+7
I just made it fatal, since it's either programming error or OOM. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17gerror_to_dbus_error_message: guarantee to return non-NULLSimon McVittie1-0/+6
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17invoke_object_method: if dbus_message_new_method_return fails, fail hardSimon McVittie1-1/+3
There's no point in doing graceful unwinding here, since it really shouldn't happen. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17arg_iterate: documentSimon McVittie1-0/+40
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-15dbus_g_proxy_manager_unregister: if GetNameOwner failed, don't assertSimon McVittie1-4/+6
got_name_owner_cb never adds the proxy to the unassociated_proxies list if there is a D-Bus error other than NameHasNoOwner. Based on a patch from Janne Karhunen, for Maemo. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38408 Bug-NB: NB#116862 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-15DBusGProxy: deal with errors in DBUS_G_VALUE_ARRAY_COLLECT_ALLSimon McVittie1-27/+66
G_VALUE_COLLECT can fail (admittedly, it's a programming error if it does). Previously, we leaked the resulting g_malloc'd string; now we emit a critical warning, free it, and abort the call. Based on patches from Kimmo Hämäläinen and Christian Dywan in Maemo's dbus-glib. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Bug-NB: NB#86280 Bug-NB: NB#180486 (CID-34419 to CID-34424 inclusive) Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-15dbus_g_proxy_call: simplify error handling now that call_id may be 0Simon McVittie1-12/+3
There's no need to special-case it any more - we can just use dbus_g_proxy_end_call_internal and rely on it to cope. This reverts the fix for fd.o #12675, since the commit before this one is more general. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-15DBusGProxy: cope gracefully with call_id == 0Simon McVittie1-0/+16
As well as happening on a programming error or OOM (which both provoke critical warnings), dbus_g_proxy_begin_call_internal() can legitimately fail if we got disconnected from D-Bus (so can't send any more), but are still working through our backlog of incoming messages (so we haven't got round to the Disconnected message yet, so the DBusGProxy hasn't emitted ::destroy). fd.o #12675 fixed dbus_g_proxy_call(), but dbus_g_proxy_call_with_timeout() and the asynchronous API still need similar treatment. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-07-25dbus-binding-tool: fixed "pretty" mode output for methods.Tim Waugh1-1/+1
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39475
2011-06-16Show warning if marshalling in dbus_g_method_return failsSimon McVittie1-1/+7
Based on a patch from Christian Dywan <christian.dywan@lanedo.com>. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29884 Bug-NB: NB#180486 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-06-16remove minor dead code in dbus-gparserChristian Dywan1-3/+0
There's no way retval can be false at this location. Bug-NB: NB#180486 CID-643 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-06-02remove remaining inclusions of <glib/gi18n.h> from libraryDerek Foreman2-2/+0
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36428 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-06-02Fix regression in marshalling objects as object pathsSimon McVittie1-4/+4
This regressed while fixing fd.o #36811. NetworkManager apparently uses this idiom. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37852 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628890 Tested-by: Michael Biebl <biebl@debian.org> Reviewed-by: Colin Walters <walters@verbum.org>
2011-06-01dbus-binding-tool: forbid ReturnVal annotation after the first OUT <arg>Simon McVittie1-0/+15
It has never actually worked correctly (invoke_object_method would always treat the ReturnVal as if it had been the first OUT argument), so let's only allow the situation that worked in practice. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35952 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-06-01Fix compiler warnings in dbus-binding-toolSimon McVittie1-1/+2
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-06-01Use single star in doc-comments not intended for gtk-docSimon McVittie4-5/+5
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10890
2011-06-01Remove Doxygen droppings from source codeSimon McVittie11-77/+8
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10890
2011-06-01Remove _dbus_g_proxy_test, which isn't called and doesn't do anythingSimon McVittie1-17/+0
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37790
2011-06-01Remove _dbus_gutils_test, which didn't test anythingSimon McVittie2-22/+1
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37790
2011-06-01_dbus_gidl_test: remove unused function which does nothingSimon McVittie1-17/+0
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37790
2011-06-01dbus-glib-tool: remove regression-test boilerplate which does nothingSimon McVittie1-48/+0
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37790 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>