Commit Graph

26 Commits

Author SHA1 Message Date
Mike Blumenkrantz 95a339733a eldbus: make connections fork-safe
after a fork, any existing connection objects can no longer be used,
but it's up to the user to destroy them. internally, this prevents
existing connections from ever being returned as valid connections
and creates new ones after a fork

also destroy fd handlers for connections to ensure that no data is
accidentally clobbered before the connections are cleaned up
2018-02-02 16:59:44 -05:00
Jean-Philippe Andre 10eb4c9a6b eldbus: change to idle_enterer from idler
Summary:
This patch set changes eldbus to use idle_enterer from idler.
If an application does not give idle time, then the eldbus cannot have chance to work.

Reviewers: raster, cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4443
2016-12-06 12:02:32 +09:00
Mike Blumenkrantz e682e7af55 eldbus: divide dbus call timeouts by 1000 to convert from milliseconds
@fix
2016-05-24 16:00:45 -04:00
Mike Blumenkrantz 8a5abfbfc3 eldbus: send exit/quit event upon disconnecting the session bus
if an application is connected to the session bus, being disconnected
should indicate that the session has been terminated and all applications
in that session should also be terminated

this ensures that no zombie processes will remain after the session bus dies
2016-05-06 15:41:38 -04:00
Carsten Haitzler 53c66c98c2 ecore - system modules - fix eldbus interdependency and complaints
so ecore uses ecore system modules ... that use eldbus. eldbus inits
ecore. this is a vicious cycle. eldbus shouldnt init ecore. it's a
dependency but should be provided outside of initting eldbus. this all
led to hack-arounds on initting eldbus in these ecore modules that
just break things like shutting down eldbus when still in use.

this ensures any pending messages are canceled on ecore module shutdown.
this ensures every ecore module fully inits and shuts down eldbus as
they should so refcounting the inits works.
this stops eldbus from inittign ecore to avoid the circuluar dependency.

this stops lots of CRI/ERR complaints eg if you run elua with no
cmdline options.

this is just better.

@fix
2016-04-12 14:11:32 +09:00
Guilherme Lepsch 10fa1b5b4b eldbus: add efl.model implementation.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-10 12:02:30 -08:00
Shinwoo Kim e555f07235 [eldbus] assign NULL to fd_handler, after deletion.
Summary: [eldbus] assign NULL to fd_handler, after deletion.

Test Plan: N/A

Reviewers: raster, cedric

Subscribers: seoz

Differential Revision: https://phab.enlightenment.org/D3243
2015-10-29 13:45:07 +09:00
Cedric BAIL 89b6ee058e eldbus: do not release shared connections if connection is private.
Reviewers: cedric

Subscribers: cedric, seoz

Differential Revision: https://phab.enlightenment.org/D2935

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-08-11 17:43:02 +02:00
José Roberto de Souza 63abe9b00c eldbus: Fix crash when removing the last reference of the message container inside of the message callback
If user try to remove the last reference of proxy, object, connection
or eldbus(lib) inside of message callback it was causing the
eldbus_pending_dispatch() being called 2 times, one because of the
eldbus_cancel() that is triggered when the last reference of the
message parent is removed and another after the return of the user
callback.

==6545== Invalid read of size 8
==6545==    at 0x52F784E: eldbus_cbs_free_dispatch (eldbus_core.c:266)
==6545==    by 0x53064AA: eldbus_pending_dispatch (eldbus_pending.c:227)
==6545==    by 0x5305961: cb_pending (eldbus_pending.c:74)
==6545==    by 0x6B29DB1: ??? (in /usr/lib/libdbus-1.so.3.8.9)
==6545==    by 0x6B2D280: dbus_connection_dispatch (in /usr/lib/libdbus-1.so.3.8.9)
==6545==    by 0x52F93B4: eldbus_idler (eldbus_core.c:773)
==6545==    by 0x4E4B300: _ecore_call_task_cb (ecore_private.h:305)
==6545==    by 0x4E4B78F: _ecore_idler_all_call (ecore_idler.c:143)
==6545==    by 0x4E4EA73: _ecore_main_loop_spin_core (ecore_main.c:1768)
==6545==    by 0x4E4EAF1: _ecore_main_loop_spin_timers (ecore_main.c:1802)
==6545==    by 0x4E4ED01: _ecore_main_loop_iterate_internal (ecore_main.c:1925)
==6545==    by 0x4E4D03B: ecore_main_loop_begin (ecore_main.c:983)
==6545==  Address 0x701aa78 is 104 bytes inside a block of size 128 free'd
==6545==    at 0x4C2B200: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6545==    by 0x530655B: eldbus_pending_dispatch (eldbus_pending.c:241)
==6545==    by 0x5306763: eldbus_pending_cancel (eldbus_pending.c:259)
==6545==    by 0x52F29DB: _eldbus_proxy_clear (eldbus_proxy.c:146)
==6545==    by 0x52F3057: _eldbus_proxy_unref (eldbus_proxy.c:244)
==6545==    by 0x52F3393: eldbus_proxy_unref (eldbus_proxy.c:264)
==6545==    by 0x401039: on_get_playlists (banshee.c:53)
==6545==    by 0x5306493: eldbus_pending_dispatch (eldbus_pending.c:225)
==6545==    by 0x5305961: cb_pending (eldbus_pending.c:74)
==6545==    by 0x6B29DB1: ??? (in /usr/lib/libdbus-1.so.3.8.9)
==6545==    by 0x6B2D280: dbus_connection_dispatch (in /usr/lib/libdbus-1.so.3.8.9)
==6545==    by 0x52F93B4: eldbus_idler (eldbus_core.c:773)

Now we will remove the pending from parent pending list before
call the user callback, this way only the pending messages will
be canceled.

Also we need increase the eldbus reference before call
dbus_connection_dispatch() or user could remove the last reference of
eldbus inside of a message callback when we still are
holding one reference of the connection.

@fix
ref T1908
2014-12-17 17:05:35 -02:00
Daniel Juyung Seo 76d8532b54 efl: Unified eina critical manro to CRI.
Being annoyed by different types of eina critical macros - CRI, CRIT,
 CRITICAL -, I concluded to unify them to one. Discussed on IRC and
 finally, CRI was chosen to meet the consistency with other macros -
 ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
2013-12-26 12:27:13 +09:00
Cedric BAIL 0a6ce62bb2 eldbus: don't do a double initialization due to ecore module using eldbus now. 2013-12-23 11:24:49 +09:00
Carsten Haitzler 0b605c5daa Eldbus: added function for getting bus unique name
Summary:
Hello guys,

We are now working on a accessibility support for elementary (ATSPI2) and we need following function to correctly register application.

Reviewers: cedric, raster, lucasdemarchi

Reviewed By: raster

Differential Revision: https://phab.enlightenment.org/D327
2013-12-02 14:57:07 +09:00
José Roberto de Souza 932a7a00cd eldbus: Check if interface of signal match with signal handler
Thanks fgau for pointing this issue.
2013-09-02 17:07:16 -03:00
José Roberto de Souza 36b71d867c eldbus: Send property changed signals before close connection 2013-08-26 15:16:18 -03:00
José Roberto de Souza 914e05c2ad eldbus: Improve error message when connection get fail 2013-08-15 14:46:30 -03:00
José Roberto de Souza 8f69b20a6d eldbus: Remove unnecessary function - _eldbus_connection_unref()
Neither internal function call this function.
2013-07-05 16:08:06 -03:00
José Roberto de Souza 20d9e486a8 eldbus: Handle removal of last reference of connection inside of callback 2013-07-05 16:08:01 -03:00
Carsten Haitzler bf482c7742 eldbus - better fix for dbus_conn becoming null in dispatch 2013-07-04 10:56:43 +09:00
Carsten Haitzler bdd57af113 eldbus - only unref client conns that are not null after dispatch 2013-07-04 08:41:45 +09:00
Eduardo Lima (Etrunko) 2e7479f8db eldbus: Missing dbus_connection_unref() in error path
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
2013-06-27 17:31:22 -03:00
Eduardo Lima (Etrunko) f6295c5828 eldbus: Call dbus_bus_register() for TYPE_ADDRESS connections
From D-Bus documentation:

http://dbus.freedesktop.org/doc/api/html/group__DBusBus.html

dbus_bus_register():

    If you open a bus connection with dbus_connection_open() or
    dbus_connection_open_private() you will have to dbus_bus_register()
    yourself, or make the appropriate registration method calls yourself.

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
2013-06-27 17:24:46 -03:00
José Roberto de Souza 274799cb08 eldbus: Fix crash when eldbus is shutdown and we have a live connection of type address
Also show info about each connection of type address live.
2013-06-10 11:30:49 -03:00
Eduardo Lima (Etrunko) 4fc274253d eldbus: Welcome two new APIs and one connection type
eldbus_address_connection_get() and eldbus_private_address_connection_get()
are similar to the respective _connection_get() counterparts, but enables
users to connect to buses other than system or session.

The new type introduced for those connections is ELDBUS_CONNECTION_TYPE_ADDRESS
and they require an additional address parameter, which will be passed to
dbus_connection_open().

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
2013-05-28 09:42:29 -03:00
Eduardo Lima (Etrunko) 1ac40b5502 eldbus: New internal function _eldbus_connection_free()
This is actually a split on the _eldbus_connection_unref() function, that
will be called either when the refcount reaches 0 or to force the deletion
of an Eldus_Connection.

The second use case will be contemplated in a following patch.

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
2013-05-28 09:42:29 -03:00
Eduardo Lima (Etrunko) fb0dc85bc3 eldbus: Reset value of fd_handler after deletion
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
2013-05-28 09:42:29 -03:00
Lucas De Marchi 4e3804041f Rename edbus->eldbus
git grep -l edbus2 | while read f; do sed -i 's/edbus2/eldbus/g' "$f"; done
find . -name '*edbus2*' -exec rename edbus2 eldbus {} \;

git grep -l "EDBUS" | while read f; do sed -i 's/EDBUS/ELDBUS/g' "$f"; done
git grep -l "EDBus" | while read f; do sed -i 's/EDBus/Eldbus/g' "$f"; done
git grep -l "edbus (v2)" | while read f; do sed -i 's/edbus (v2)/eldbus/g' "$f"; done
git grep -l "Edbus" | while read f; do sed -i 's/Edbus/Eldbus/g' "$f"; done
git grep -l "edbus" | while read f; do sed -i 's/edbus/eldbus/g' "$f"; done

find . -name '*edbus*' -exec rename edbus eldbus {} \;
find . -name '*EDBus*' -exec rename EDBus Eldbus {} \;
2013-04-23 12:36:29 -03:00