Commit Graph

218 Commits

Author SHA1 Message Date
Cedric BAIL 3f5ac71ad6 eldbus: ensure the lifetime of the eldbus object path is monitored for proxies
the object is instantly destroyed when connection is lost

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-19 13:00:25 -07:00
Cedric BAIL 67b135ab87 eldbus: use efl_del when clearing the model connection child list
it is an error to delete an object with an existing parent

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-19 13:00:25 -07:00
Mike Blumenkrantz eda0c85910 eldbus: rename conflicting "name" properties for some classes 2018-02-15 13:11:00 -05:00
Mike Blumenkrantz fcfd832ce5 eldbus: rename custom constructor methods
"constructor" conflicts with the base efl object constructor

some of the params for these should maybe be refactored into properties
and use finalize?
2018-02-15 13:11:00 -05:00
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
Mike Blumenkrantz aaf3659faf eldbus: do not require error return when adding/removing signal matches
this forces the functions to be synchronous and blocks (potentially forever)
2018-02-02 16:59:44 -05:00
Vincent Torri f5b01ac5ce all: Simplify definition of EAPI
This will help in the transition from Autotools to Meson. This has been
tested on Windows for which EFL_XXX_BUILD were first introduced.
2018-01-18 18:04:03 +09:00
Daniel Kolesa 4f5b72a3ed eo files: convert various to use @cref 2017-11-02 16:41:01 +01:00
Jaehyun Cho 73baa73972 eldbus_message: Add description to fix doxygen warning
Change-Id: Id85f85de352019b29268cfa3d6e70df7cd8e84ee
2017-10-26 15:28:43 +09:00
Jaehyun Cho 5ef408f49b eldbus_connection: Add description of parameters to fix doxygen warning
Change-Id: I3be25d4b7c8bdb69c23c1c5071fac8ac1420d87d
2017-10-26 15:16:12 +09:00
JinYong Park b7359e7ff5 eldbus signal handler: add param, return type description for doxygen
Summary: Add omitted description to eldbus signal handler for doxygen warning

Test Plan: API Doxygen Revision

Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5379
2017-10-26 12:17:41 +09:00
JinYong Park 157daefd5b eldbus-service: add parameters and return type description for doxygen
Summary: Add omitted descriptions for doxygen warning

Test Plan: API Doxygen Revision

Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5378
2017-10-26 12:17:41 +09:00
Carsten Haitzler fd52344b03 eldbus - make file local func added in fix static
better to keep the func local unless needed elsewhere too
2017-08-01 11:23:20 +09:00
Shinwoo Kim a238272f00 eldbus: check message serial before using
Summary:
Whatever the dbus_connection_send_with_reply returns, the serial value
should be checked, because if the seral value is invalid a process could be aborted.

There is backtrace as below.

The dbus_connection_send_with_reply could return TRUE
even though it has a problem. Please refer to following comment:

   /* Refuse to send fds on a connection that cannot handle
      them. Unfortunately we cannot return a proper error here, so
      the best we can do is return TRUE but leave *pending_return
      as NULL. */

Test Plan:
There is not a exact reproduce step. If the Tizen login manager is relaunched
repeatedly, then the dbus and other service processes are relaunched.
If a service process tries to use dbus when the dbus has problem as above,
then it could be possilbe to get above backtrace.

Reviewers: raster, zehortigoza

Subscribers: cedric, jpeg

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

@fix
2017-07-31 15:53:58 +09:00
Carsten Haitzler 3de08599bf eldbus lower error print levesl from ER to WRN in get all props
this is generally unnecessary noise as the majority of the time i see
this it's because the message was canceled by the caller... thats not
an error though then... it's intended. less debug noise to sift through.
2017-07-30 23:04:35 +09:00
Stefan Schmidt c56bb560d0 eldbus: check return of dbus_signature_iter_next()
CID: 1341856
2017-04-26 14:49:37 +02:00
Gustavo Sverzut Barbieri 2ba33b8ff0 cmake: add eldbus. 2017-01-26 16:16:15 -02:00
Daniel Kolesa fe45965e07 eldbus: use new property impl syntax 2016-12-27 16:39:52 +01: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
Stefan Schmidt 55ee0d8fe8 docs: eldbus: add docs for new eldbus enum 2016-11-07 11:43:20 +01:00
Daniel Kolesa 57792897a2 eldbus eo: remove pointers 2016-11-04 17:12:17 +01:00
Gustavo Sverzut Barbieri 7b590c126e eldbus/eo: improve API
remove setters that do not make sense, they are set in the constructor
functions and cannot be changed.

define the Eldbus_Connection_Type in .eo, properly type functions
using it.
2016-11-04 13:19:57 -02:00
Stefan Schmidt 30a049a7b7 docs: eldbus: document all eldbus structs and its members 2016-10-20 17:45:33 +02:00
Felipe Magno de Almeida 1a2014a122 efl: Update Efl.Model to use new Efl_Promise and Efl_Future
Replaced all Eina_Promise_Owner and Eina_Promise with Efl_Promise and
Efl_Future.
2016-09-29 13:12:27 -03:00
Ji-Youn Park 13bd4242ec eldbus: fix null value usage 2016-09-20 18:10:32 +08:30
WooHyun Jung fa3af69e0c eldbus: null checking before using the pointer 2016-09-20 11:18:52 +09:00
Tom Hacohen 9c779dca90 Rename efl_self to efl_added
It has been discussed on the ML (thread: "[RFC] rename efl_self") and
IRC, and has been decided we should rename it to this in order to avoid
confusion with the already established meaning of self which is very
similar to what we were using it for, but didn't have complete overlap.

Kudos to Marcel Hollerbach for initiating the discussion and
fighting for it until he convinced a significant mass. :)

This commit breaks API, and depending on compiler potentially ABI.

@feature
2016-09-05 16:59:56 +01:00
Vitor Sousa f02ff462e7 efl callbacks: update some events calls to no longer trigger legacy callbacks 2016-08-30 13:59:59 -03:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Stefan Schmidt f752288666 eldbus: make sure eldbus model is hidden behind the BETA API flag
Make sure we keep this in beta for now until our EO based interfaces are ready.
2016-07-29 12:04:13 +02:00
Chris Michael fb09df7977 eldbus: Check return value and error out if necessary
Coverity reports that we do not check the return value of
_eldbus_model_proxy_load here. We likely should be checking that in
case the model proxy fails to load so we can return proper values here.

Fixes Coverity CID1355233

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-21 12:50:19 -04:00
Daniel Kolesa 7584960377 eolian: implement a stringshare builtin
This implements a new builtin, stringshare, which is replaced with the right
pointer to Eina_Strinshare as necessary. This allows simplifying binding code
(it can call the proper eina APIs, deal with lifetime etc).

It also removes the extern Eina.Stringshare typedef from eina_types.eot, which
was actually incorrect and would generate invalid code in binding generators.

@feature @fix
2016-06-21 14:41:18 +01:00
Felipe Magno de Almeida 8e4f383d61 efl: Move promise parameter to return in data model
Summary:
Instead of:

efl_model_property_get("name", &promise);

now:

promise = efl_model_property_get("name");

Reviewers: stefan_schmidt, cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4038
2016-06-16 22:01:07 -03:00
Lauro Moura 46843551c0 eina: Remove value type promises
All values in promises are now considered as by-pointer.
2016-06-09 22:38:54 -03:00
Felipe Magno de Almeida 8fec0d5139 eina: Remove unnecessary indirection to promises
Now when dealing with pointer types, we will not get pointer to
pointer semantics in callbacks and eina_promise_owner_value_set
for Eina_Promise.

It will work as expected:

Eina_Promise_Owner* promise = eina_promise_add();

void* p = malloc(sizeof(T));
eina_promise_owner_value_set(promise, p, &free);
2016-06-03 17:22:12 -03:00
Daniel Kolesa 6fc482aa9b eolian: utilize the new builtin string type across eo files 2016-05-31 16:05:43 +01:00
Mike Blumenkrantz e682e7af55 eldbus: divide dbus call timeouts by 1000 to convert from milliseconds
@fix
2016-05-24 16:00:45 -04:00
Daniel Kolesa e984e5a11a eolian: remove pointers from complex and class types
Complex types (i.e. list, array, hash, accessor etc.) now do not require
pointers with them anymore (the pointer is implied) and the same goes for
class handles. Eolian now explicitly disallows creating pointers to these
as well. This is the first part of the work to remove pointers from Eolian
completely, with the goal of simplifying the DSL (higher level) and therefore
making it easier for bindings (as well as easier API usage).

@feature
2016-05-23 15:58:33 +01:00
Tom Hacohen 96c4c88070 Efl: Remove "legacy_prefix: null;" as it's now the default. 2016-05-12 17:27:35 +01:00
Tom Hacohen 684d005970 Eldbus: Fix namespacing to use . and not _. 2016-05-12 12:20:34 +01:00
Tom Hacohen c587972e52 Eldbus: Fix namespacing to use . and not _. 2016-05-12 11:17:29 +01:00
Tom Hacohen bcb72b5367 Eldbus: remove shadowing variable.
FFS people, turn on your compiler warnings.
2016-05-10 16:30:18 +01:00
Tom Hacohen 138d4e1353 Efl model: Remove the no longer needed .Base hack. 2016-05-10 11:36:35 +01: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
Larry Jr 7bbc5ec623 Eldbus: fixed property_set in Eldbus.Model_Proxy 2016-04-29 20:55:37 -03:00
Larry Jr 0c76f82a31 Efl, Eio, Eldbus, Elementary: new model API use eina_promise
Efl - efl_model_base changed to use eina_promise
Eio - eio_model use efl_model_base with promise
Eldbus - elddbus models use promise now
Elementary - elm_view_list and elm_view_form use new models with promise

updated all related examples and tests
2016-04-29 13:21:24 -03:00
Stefan Schmidt db0858823e docs: ector: document ector cairo surface classes
For both the cairo and the cairo software surfaces.
2016-04-22 09:46:40 +02:00
Stefan Schmidt 42d20b9507 docs: eldbus: document property values
Add documentation comments and switch away from the generic "value" name.
2016-04-22 09:46:40 +02:00
Stefan Schmidt f74c4bbce7 docs: eldbus: add class and property descriptions for eldbus model files
Also fix some existing docs while being there.
2016-04-20 12:46:41 +02: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
Tom Hacohen 8706d03b43 Change the EFL according to the renaming of the eo_add() current object. 2016-03-15 15:25:54 +00:00
Tom Hacohen f24210caac Revert "Automatic migration to the new eo_add syntax."
This reverts commit 4f949a2757.
2016-03-11 12:29:03 +00:00
Tom Hacohen 4f949a2757 Automatic migration to the new eo_add syntax. 2016-03-09 16:09:14 +00:00
Tom Hacohen f21ade6123 Automatic migration to Eo4.
I just ran my script (email to follow) to migrate all of the EFL
automatically. This commit is *only* the automatic conversion, so it can
be easily reverted and re-run.
2016-03-03 09:58:08 +00:00
Marcel Hollerbach e4cb6ff6fe eldbus: eldbus is already defined in eo
the struct is already defined in eldbus_general.eoeldbus: eldbus is
already defined in eo

the struct is already defined in eldbus_general.eott
2016-02-23 18:58:48 +01:00
Mike Blumenkrantz f7cd667766 eldbus: print dbus errors incurred when failing at signal handler operations
seeing these errors is significantly more helpful when debugging why the system
is not responding as expected
2016-02-19 13:24:30 -05:00
Tom Hacohen df8cbbc419 Eldbus: Move more types to eldbus_types.eot. 2016-02-17 11:59:07 +00:00
Tom Hacohen 63f717caaf Eldbus: Create eldbus_types.eot and start using it. 2016-02-17 11:30:24 +00:00
Tom Hacohen 297fc1c42b Eldbus model arguments: Fix Eolian warnings.
This includes either migrating types to eolian, fixing namespace or
importing extra types.
2016-02-17 10:17:59 +00:00
Mike Blumenkrantz 2444e127dd eldbus: add more debug prints for proxy and signal handler 2016-02-13 11:26:03 -05:00
José Roberto de Souza 316cf42159 eldbus: Correctly read/write boolean to eina_value
DBus bool type is a uint32_t not a uint8_t, just changing how read
and write, not chaging how it is stored in eina_value to save some
bytes of RAM.

This fix the stack overflow pointed out here: https://phab.enlightenment.org/T3089

@fix
2016-02-01 12:50:31 -02:00
Stefan Schmidt b63b631efd eldbus model: no need to double const a Eina_Stringshare
Eina_Stringshare is already const, no need to const it again.
2016-01-11 22:55:34 +01:00
Stefan Schmidt 9154fbb0e0 eldbus: add missing since tags for all new symbols 2016-01-06 16:31:55 +01: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
Carsten Haitzler 7d0c5a9423 eldbus - only do syntax checks if libdbus is new enough 2015-10-06 11:29:16 +09:00
Carsten Haitzler 9a467c0451 eldbus - make method calls less crasy since libdbus likes to abort
changes zmike made to e's systray make e abort due to libdbus seeing
the bus name as invalid. it actually is. it's
/org/ayatana/NotificationItem/steam for example - instead of
or.whatever.blah - thuis e aborts continually if you run steam at all.
eldbus should be more crash-proof thus this adds checks so dbus fun
doesnt cause an app to crash if it happens to call incorrect dbus names.

@fix
2015-10-04 17:53:46 +09:00
Marcel Hollerbach 47541b81c6 eldbus: fix _eldbus_message_iter_arguments_vget
Summary:
there is a problem with _eldbus_message_iter_arguments_vget.

Assume: We have a array of type y, there are 3 elements in the array.

Lets say we are iterating with

printf("%c", dbus_message_iter_get_arg_type(iter));

and

dbus_message_iter_next(iter);

throuw the iter.

You will see that this will output yyy. As we are having 3 times v.
While the signature of the message iterator is y.

If you now call eldbus_message_iter_arguments_get(message, "y", &cont)
it will return false, with the errormessage in line 766, reason for this
is that the type of the signature iterator differs from the message
iterator. Because of the upper example.
So all in all: The signature given to the method has not to be equal to
the signature of the message iterator, it has to be equal to the
iterated signature, which cannot be found easily with the eldbus api.

The solution is to only iterate in the message iterator that long until
the signature iterator is at the end, if the type differs in this
region, give a error and return false. Otherwise return true.

The sad thing about this is that it is a behaviour break, but the
behaviour is borked, so its a fix.

I tested this over a week now, without any problem in efl/elm/e.

Reviewers: stefan_schmidt, zmike

Reviewed By: stefan_schmidt

Subscribers: zmike, ceolin, simotek, DaveMDS, cedric

Projects: #efl

Differential Revision: https://phab.enlightenment.org/D3074
2015-10-02 09:14:29 +02:00
Thiep Ha bb9fdad7c2 doc/eldbus: fix parameter in document
Summary:
The allow_initial_call apprears two times in
eldbus_name_owner_changed_callback_add api.

@fix

Reviewers: seoz, Hermet

Reviewed By: Hermet

Subscribers: cedric, seoz

Differential Revision: https://phab.enlightenment.org/D3110
2015-10-01 19:29:23 +09:00
Amitesh Singh 4b8825bbea eldbus: fix typos in documentation 2015-09-28 21:59:34 +05:30
Thiep Ha ffbda5add5 eldbus: add dbus_pending NULL check
Summary:
When we call dbus_connection_send_with_reply, the dbus_pending
can be NULL. In this case, the next call dbus_pending_call_set_notify
will cause application crash.
We should check if dbus_pending is NULL before calling dbus API.

@fix

Reviewers: cedric

Subscribers: englebass, cedric, seoz

Differential Revision: https://phab.enlightenment.org/D3081
2015-09-23 09:22:51 +09:00
Lukasz Stanislawski abdbb9ad14 eldbus: fix broken fallback interface.
Summary:
Previous implementation assumed that fallback interface path should be changed
on every method call. This is generally not needed since real request
path can be obtained directly from dbus message passed as method call
paremeter.

This patch reverts this behaviour and additionally fix broken Property and Introspect
interface handling of fallback interface.

Reviewers: raster, lucasdemarchi, cedric

Subscribers: cedric, seoz

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-09-22 00:04:38 +02:00
Stefan Schmidt 495046e0eb eldbus: add since tag for now public eldbus_message_signal_new API
Thanks go to vtorri for bringing this to my attention.
2015-08-24 12:07:10 +02:00
Stefan Schmidt c4b4cd5967 eldbus: remove now public eldbus_message_signal_new declaration from private.h
The declaration is now on eldbus_message as EAPI so we can safely remove it here.
2015-08-24 10:11:34 +02:00
Lukasz Stanislawski 0416d4d9bb eldbus: add eldbus_message_signal_new to public header
Test Plan: elementary tests

Reviewers: cedric

Subscribers: seoz, cedric

Differential Revision: https://phab.enlightenment.org/D2772
2015-08-24 10:07:40 +02: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
Cedric BAIL c7d8d83c47 eldbus: remove the need to order the header correctly for Windows. 2015-05-07 09:53:10 +02:00
Tom Hacohen 5e4b523d51 Eldbus: fix potential unsigned int underflow.
Subtracting two unsigned values results in an unsigned value, which means
abs() will have no effect.
This also means that if base is smaller than size, we'll have an
unsigned int underflow.

I did it this way (with the if) because it looked like base might be
smaller than size. However, please remove the if (and don't reinstate
the abs) if this is not the case.
2015-04-22 13:17:31 +01:00
Chris Michael baf998165a eldbus: Fix formatting
Summary: No functional changes, just formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-11 15:29:29 -05:00
Guilherme Lepsch ef6456c541 eldbus: refactoring code.
Summary:
Code smells: Don't Repeat Yourself

Depends on D1927

Reviewers: felipealmeida, larryolj, cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-09 22:03:19 +01:00
Guilherme Lepsch c5c70e54fc eldbus: eina_value not allocated from mempool.
Summary: Eina_Value must be allocated with eina_value_new() to be freed by eina_value_free().
@fix

Reviewers: felipealmeida, larryolj, cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 15:37:15 +01:00
Guilherme Lepsch cd0cca6f80 eldbus: fix memory leak.
Summary:

@fix

Reviewers: felipealmeida, larryolj, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 11:28:37 +01:00
Guilherme Lepsch 629b5e3d2b eldbus: production code inside Eina Safety Check assert.
Summary: Eina Safety Checks assert macros don't do anything (no-op) if EINA_SAFETY_CHECKS is undefined.

@fix

Reviewers: felipealmeida, larryolj, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 11:23:44 +01: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
José Roberto de Souza 78d5bb17d7 Revert "eldbus hackaround for proxy deletion during pending callback"
This reverts commit 6a08788d59.

This will be properly fixed on the next patch.
2014-12-17 16:58:25 -02:00
Chris Michael 6e46642dfb eldbus: Fix possible null dereference reported by Coverity
Summary: Fix Coverity CID1256952: reports a null derefence here due to
eldbus_message_new returning NULL, thus causing a null dereference
when trying to set reply->dbus_msg

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 13:24:54 -05:00
Mike Blumenkrantz 6a08788d59 eldbus hackaround for proxy deletion during pending callback
this is merely a way to avoid crashing immediately when the referenced bug is triggered. it does not fix the problem.

ref T1908
2014-12-08 15:14:24 -05:00
José Roberto de Souza dfb60c0bfe eldbus: Use the timeout parameter on eldbus_proxy_send_and_block()
Sorry by bad I had forgot to use the new parameter.
2014-12-05 13:06:39 -02:00
José Roberto de Souza b9c1dfdf03 eldbus: Add timeout parameter to eldbus_proxy_send_and_block()
As all other send functions have, we need to have here.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-05 09:53:08 -05:00
José Roberto de Souza 8b193c145e eldbus: Fix _eldbus_connection_send_and_block()
Some problems with the actual implementation:
- the reply should not be writable, as it can only be read.
- if an error happen dbus_connection_send_with_reply_and_block()
will return NULL so we need check before use it
- all other send calls remove one reference of the message

Now also it is creating a error message, so the caller can know why it fail.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-05 09:53:08 -05:00
Chris Michael e62dfdd79e eldbus: Add actual API function code for eldbus_proxy_send_and_block
Summary: This adds the actual code to send a dbus message and block
while waiting for a reply.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-04 09:49:02 -05:00
Chris Michael 34dd248551 eldbus: Add code for _eldbus_connection_send_and_block function
Summary: This function will send a message to dbus and block while
waiting for a reply

NB: This is needed for our 'port to libinput', and for our 'opening up the
drm card without systemd' efforts

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-04 09:49:02 -05:00
Chris Michael 14332f5d0d eldbus: Add API function declaration for eldbus_proxy_send_and_block
Summary: This adds a public facing API function to make dbus calls
which will block and wait for a reply. This is needed for a couple of
use cases in our Wayland efforts (libinput, etc).

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-04 09:49:02 -05:00
Chris Michael 7e7a715164 eldbus: Add function prototype for send_and_block
Summary: This just adds the function prototype into the eldbus private
header. It will be used in the new proxy function
"eldbus_proxy_send_and_block"

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-04 09:49:02 -05:00
Pierre Le Magourou ebaba7f20a eldbus: Fix wrong comments. 2014-10-21 23:42:03 +02:00
Pierre Le Magourou f50f321562 eldbus: update missing eldbus_proxy API documentation. 2014-10-20 18:32:28 +02:00
Pierre Le Magourou a86a8e1e4a eldbus: update missing eldbus_pending.h API documentation. 2014-10-20 18:32:28 +02:00
Pierre Le Magourou 321f6482cd eldbus: update missing eldbus_object API documentation. 2014-10-20 18:32:28 +02:00