Commit Graph

43 Commits

Author SHA1 Message Date
Marcel Holtmann 9d789c57d7 gdbus: Remove unneeded NEED_DBUS_WATCH_GET_UNIX_FD check 2012-04-16 17:57:08 +02:00
Anderson Lizardo 9b26016a24 gdbus: Use destroy callback for service watch
Even though service watches accepted a "destroy" callback, they were
being ignored. This fix properly pass them along so they are called when
the watch is removed.
2012-04-05 08:07:35 -07:00
Syam Sidhardhan 2f232f8b02 gdbus: Fix white space coding style issue
- corrected the space before '{'
2012-04-05 08:07:28 -07:00
Szymon Janc ecd56f7a07 gdbus: Remove unused result variable from g_dbus_pending_success 2011-05-27 09:53:38 -07:00
Grant Erickson e37fcb4af3 gdbus: Unconditionally remove D-Bus timeouts
Address an issue in which the daemon incorrectly handles D-Bus main
loop timeouts by only removing timeouts that are not enabled when
D-Bus requests a timeout removal.
2011-03-09 13:32:32 -08:00
Daniel Wagner 1ef27ffe86 gdbus: Remove root node 'name' attribute in introspection
generate_introspection_xml generates the root <node> tags with a
'name' attribute. This seems to be a valid attribute but it is not
consistent with the way the D-Bus daemon generates empty nodes.

For example if we register "/foo/bar", D-Bus daemon will generate for
"/foo" a introspection which looks like this:

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <node name="bar"/>
</node>

and generate_introspection_xml generates for "/foo/bar":

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/foo/bar">
</node>

Just don't add the 'name' attribute to the root node.  The GLib
binding for D-Bus does it the same way.
2011-01-19 17:25:30 +01:00
Daniel Wagner 28ec0e2174 gdbus: invaldate_parent_data: walk the whole path down
Assume there is only one object registerd at "/". If we add a new
object at "/foo/bar" the introspection of "/" has to be updated. A new
node has to be added at "/".

invalidate_parent_data stops invaldating the whole path because the
boolean return value of dbus_connection_get_object_path_data is used
wrong.

If we get a TRUE just go on down in the path, if FALSE is return
dbus_connection_get_object_path_data has run out of memory.
2011-01-19 17:25:30 +01:00
Marcel Holtmann e5120c96e9 gdbus: Update copyright information 2011-01-01 17:32:29 -08:00
Johan Hedberg a437bfba54 gdbus: fix accessing freed callback data
cb->disc_func or cb->conn_func could remove the callback so this needs
to be checked for before continuing processing.
2010-12-10 00:07:53 +01:00
Lucas De Marchi 752a2ccec8 gdbus: explicitly compare pointers to NULL
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)

// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@

- !E
+ E == NULL
// </smpl>
2010-12-08 16:33:06 +01:00
Luiz Augusto von Dentz c896d11724 gdbus: fix not handling bus disconnects
We where not dispatching data when a bus disconnects which cause
Disconnected signal to not be processed and thus causing the process to
either not exit or to not trigger callbacks registered with
g_dbus_set_disconnect_function.

To fix this now we always schedule a dispatch which will make sure data
still not processed will make its way to the proper handlers even if
disconnected.
2010-10-13 15:55:26 +03:00
Marcel Holtmann f02dd45e0b Add support for builtin GDBus security using PolicyKit 2010-09-09 18:26:37 +02:00
Marcel Holtmann e173173a1f Add support for GDBus security action and flags 2010-09-09 18:26:36 +02:00
Marcel Holtmann 679f17303d Use simpler error callbacks for GDBus security hooks 2010-09-09 18:26:36 +02:00
Marcel Holtmann 8ef8135a2a Add support for GDBus security handlers 2010-09-09 18:26:36 +02:00
Luiz Augusto von Dentz fbf3bcd87d Fix calling watch callbacks after it has been removed
Pending call should be removed if the watch is removed since the
application no longer expect that to be reached and may already freed the
data associated with it.
2010-09-08 18:28:23 +02:00
Luiz Augusto Von Dentz 79e5dc585d Fix signal watch when a service name is given
The bus name should be resolved when adding a watch by service name since
messages do always come with sender set to owner's bus name, also it
should listen to owner updates since it can change without invalidating
the watch.
2010-09-08 18:28:23 +02:00
Luiz Augusto Von Dentz 93d5bd6af8 Do not automatically remove watches for service names
Services can be owned again so it is perfectly fine to keep the watch.
2010-09-08 18:28:23 +02:00
Marcel Holtmann f261f38fd9 Add printf format attribute for error creation helper 2010-08-19 19:35:04 +02:00
Zhenhua Zhang 04fffa93a1 Free service data in service_reply
Avoid the memory leak of server_data.
2010-07-26 07:30:48 -07:00
Johan Hedberg 58b37ddb53 Fix parent path introspection data invalidation for multiple levels
In the case that parent path data needs to be invalidated we shouldn't
stop at the immediate parent if it doesn't have our own handler
registered but should continue upwards in the tree until we reach root
or our own handler.
2010-04-30 00:30:54 +02:00
Johan Hedberg 3f2494a7b0 Fix memory leak in g_dbus_register_interface 2010-04-29 23:46:12 +02:00
Marcel Holtmann ab5dcea4fd Make interface callback tables const 2010-03-07 14:33:09 -08:00
Vinicius Costa Gomes a181ec319b Fix the case when the requested name is already in use
We weren't setting the dbus error in this situation.
2010-03-07 14:32:03 -08:00
Vinicius Costa Gomes 2e9a16ce07 Fix: a pending call was leaking in check_service
This was triggering an assert inside libdbus when the timeout inside
the leaking pending call expired. The assert said that we were trying
to remove an nonexistent timeout.
2010-02-17 01:59:31 -08:00
Marcel Holtmann 4c6497e317 Remove unneeded use of status variable 2010-01-27 09:50:24 +01:00
Forrest Zhao 57013cfa0d Introduce g_dbus_setup_private() to gdbus
g_dbus_setup_private() is used to setup private DBusConnection
2010-01-27 09:50:24 +01:00
Luiz Augusto Von Dentz a6fc21fd1f Fix regression when removing watches
filter_data_find return the first data registered in this case so there is
no guarantee that it return the same data as passed to
filter_data_remove_callback which is the one that should be removed.

The fix is to simple cache the connection removing the correct data before
checking if there is any filter left.
2010-01-08 04:24:09 -08:00
Marcel Holtmann 436c2a7c63 Cleanup of D-Bus mainloop integration 2010-01-02 21:43:22 -08:00
Marcel Holtmann 8e0de054cd Update copyright information of D-Bus helper library 2010-01-01 17:05:57 -08:00
Luiz Augusto Von Dentz 71ac4f60d9 Fix undefined symbols 2009-12-29 17:37:35 -08:00
Luiz Augusto Von Dentz d897b24085 Port gdbus to use g_dbus_add_signal_watch 2009-12-29 01:19:38 -08:00
Luiz Augusto Von Dentz e8111c8229 Add initial implementation of g_dbus_add_signal_watch
With g_dbus_add_signal_watch there is no need to register multiple filters
for dbus nor add matching rules manually.
2009-12-29 01:19:38 -08:00
Daniel Orstadius 9c688fff68 Fix D-Bus timeout handling
Timeouts should also be removed in the remove_timeout callback in
addition to the timeout_handler_free function. This is how dbus-glib
does it and it seems to prevent crashes in certain situations.
2009-12-16 22:34:33 -08:00
Claudio Takahasi dab8e45d2e Fix message handling for autostart.
Current implementation of libdbus Request name is blocking, consequently
the first incomming message that triggered the service autostart is not
being processed properly.
2009-10-29 22:49:50 +09:00
RISKÓ Gergely df7313d301 gdbus: handle introspection generally in generic_message.
Previously it was a specific case, now introspection is just another
interface, which is always implemented.  It is registered/unregistered
when an object path is referenced first/last.
2009-09-24 10:22:19 -07:00
RISKÓ Gergely e72d349483 Add introspection interface to the output of introspection calls
This provides better compatibility with some D-Bus clients, such as qdbus.
2009-09-14 14:08:07 -07:00
Marcel Holtmann 70aab2a826 Convert to fully non-recursive build system 2009-08-24 23:49:40 -07:00
Johan Hedberg b8addb4af3 Use NameHasOwner instead of ListNames for name checking 2009-08-08 10:34:08 -07:00
Marcel Holtmann 2520e26820 Fix blocking service watch initial connect handling 2009-08-06 22:13:09 -07:00
Denis Kenzior 50ff91e209 Make the parent path invalidateable 2009-05-11 11:50:45 -07:00
Luiz Augusto von Dentz 5106f7a8cf Fix crash when calling g_dbus_remove_watch from watch callback 2009-05-06 13:55:09 -07:00
Marcel Holtmann 7851155b80 Add D-Bus helper library for GLib integration 2009-04-26 20:51:36 +02:00