Commit Graph

61 Commits

Author SHA1 Message Date
Cedric BAIL 18de24baeb ecore_con: use only Eina_Magic infrastructure for set and check in Ecore_Con_Url.
Summary:
We can not have half our code rely on Ecore magic check and the other half
use Eina_Magic or this will lead to inconsistency with Eina_Magic definition.

Reviewers: zmike, segfaultxavi, bu5hm4n, raster

Reviewed By: raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10383
2019-10-14 09:38:23 -04:00
Mike Blumenkrantz 36661a436e efl-net: namespace events to avoid naming conflicts
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8260
2019-03-08 12:17:51 -08:00
Mike Blumenkrantz 6326e18b3f efl.file: improve api a bit
Summary:
the previous implementation/api had a number of issues:
* "file" property contained both "file" and "key" values
  - also performed file loading operation
* "load_error" property which was specific to image objects
* no methods for controlling file loading/unloading

this patch attempts the following changes:
* split "file" property into "file" and "key" properties
  - also remove "key" from existing "mmap" property
* remove "load_error"
* directly return error codes from operations
* add "load" and "unload" methods for directly controlling load state
* add implicit file loading if file/mmap is set during construction
* rewrite all efl.file implementations to move file loading into load() method
* rewrite all usage of efl.file api based on these changes
* add C extension functions to mimic previous behavior

ref T7577

Reviewers: segfaultxavi, bu5hm4n, cedric

Reviewed By: segfaultxavi

Subscribers: vitor.sousa, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7577

Differential Revision: https://phab.enlightenment.org/D8018
2019-02-27 13:17:10 -05:00
Wonki Kim 1cdedaa33b ecore_con: Fix potentional problems around ecore_con
non-thread safe functions are used like rand(), strerror().
this patch replace them with thread safe one.
and also this patch contains a change to fix a memory leak problem.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7917
2019-02-13 16:37:08 -08:00
Marcel Hollerbach 37d2d378ec eolian: drop class function overriding
Until this commit eo did class functions as part of the vtable, which
enabled those functions to be overwritten in classes inheriting another
class. However in task T7675 we decided that this is not really good for
bindings, as most OOP languages do not support this sort of feature.

After this commit eolian realizes class function completly outside of
the vtable, the c-symbol that is the class funciton is now just directly
redirecting to a implementation, without the involvement of the vtable.

This also means a change to the syntax created by eo:

Calling before:
  class_function(CLASS_A);
Calling after:
   class_function();

Implementation before:
   class_function(const Eo *obj, void *pd) { ... }
Implementation after:
   class_function(void) { ... }

This fixes T7675.

Co-authored-by: lauromauro <lauromoura@expertisesolutions.com.br>

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D7901
2019-02-13 16:59:58 +01:00
Cedric BAIL 33fd77e9e4 ecore: move close_on_destructor to close_on_invalidate as that describe the behavior best.
Fix all use to correctly behave on invalidate.
2018-05-01 10:39:01 -07:00
Arnaud Ferraris fcadb54640 ecore_con_url: implement transfer speed limitation options
Summary: Add MAX_SEND_SPEED & MAX_RECV_SPEED cURL options handling in ecore_con_url.

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-03-26 16:01:53 -07:00
Carsten Haitzler 1c74aaa7e9 Revert "cxx: Fix manual code after efl_app change."
This reverts commit 135154303b.

Revert "efl: move signal events from efl.loop to efl.app"
This reverts commit 3dbca39f98.

Revert "efl: add test suite for efl_app"
This reverts commit 3e94be5d73.

Revert "efl: create Efl.App class, the parent of Efl.Loop"
This reverts commit 28fe00b94e.

Go back to before efl.app because I think this should be done with
superclassing here not a parent object. reasons?

1. multiple loops per single thread make no sense. so if multilpe loop
objects they wont be contained in a single app object and then deleted
like this.
2. the app object is not really sharable in this design so it cant be
accessed from other threads
3. it makes it harder to get the main loop or app object (well 2 func
calls one calling the other and more typing. it is longer to type and
more work where it is not necessary, and again it can't work from
other threads unless we go duplicating efl.app per thread and then
what is the point of splittyign out the signal events from efl.loop
then?)

etc.
2018-03-03 13:40:33 +09:00
Mike Blumenkrantz 28fe00b94e efl: create Efl.App class, the parent of Efl.Loop 2018-02-26 14:02:51 -05:00
Carsten Haitzler 9bedda14b3 efl loop - rename ecore_main_loop_get to efl_main_loop_get
ecore_main_loop_get() is really a new "eo api" but it's using our old
ecore_* namespace, so move to the new efl namespace.
2018-01-02 16:13:54 +09:00
Andy Williams d234458dfc Fix and simpligy windows behaviour.
Author: Vincent Torri
2017-12-31 16:08:31 +00:00
Guilherme Iscaro ef03ecd89c Ecore_Con: Fix wrong comparison.
Otherwise it will always evaluate to false.
2017-07-28 15:22:51 -03:00
Cedric BAIL deb6f0d2cd ecore_con: avoid potential crash during shutdown due to Ecore_Event queue. 2017-03-09 16:17:58 -08:00
Daniel Zaoui f8d7602f46 Ecore_Con_Url/Curl: add consistency for _c init/shutdown
_c_init was not called from Ecore_Con_Url although _c_shutdown was.
2016-12-23 23:03:24 +02:00
Gustavo Sverzut Barbieri 0073e87761 efl_net_dialer_http: fix HEAD requests.
We do not need to keep a "only_head" flag, but we must set
CURLOPT_NOBODY instead of going the "CUSTOMREQUEST" route, otherwise
curl won't follow redirects, etc.
2016-12-12 03:17:35 -02:00
Gustavo Sverzut Barbieri c5fc33d378 ecore_con_url: only close the request if we got a final response.
if we're doing 30x redirects or anything else, keep going. If it's an
error it will be reported later, otherwise EOS. Fact is we're only
interested if 20x.
2016-12-09 22:18:27 -02:00
Gustavo Sverzut Barbieri 2cb3466ddf ecore_con_url: now on top of efl_net_dialer_http.
Rewrite Ecore_Con_Url as a non-Eo (since it's just legacy) that is
built on top of Efl_Net_Dialer_Http.

Since there are some legacy behavior we do not want to expose in the
new classes, hack around and manipulate the curl_easy_setopt()
directly in those cases.

This includes the cookies: there is no reason why we should expose
independent files for read (COOKIEFILE) and write (COOKIEJAR), real
world applications can manipulate the files directly, like copying
from a template to a RDWR before using, etc.
2016-11-29 16:03:14 -02: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
Gustavo Sverzut Barbieri e12afd772c efl_net_dialer_websocket: EFL now does WebSocket!
The Efl.Net.Dialer.Websocket is just like other Efl.Net.Dialers: you
can dial, you can close, monitor connected/address resolved and so
on. And you can use WebSocket primitives and events such as
text_send(), binary_send(), ping() and close_request() (since
WebSockets use a close process where you should state a close
reason). See efl_net_dialer_websocket_example.c

Even if WebSocket is a message-based protocol (like "packets" from
UDP), you can use efl_net_dialer_websocket_streaming_mode_set() to
tell it to handle text or binary messages as a stream. Then all the
Efl.Io.Reader and Efl.Io.Writer APIs work as expected, see
efl_io_copier_example.c updates.
2016-09-02 00:08:50 -03:00
Vitor Sousa f02ff462e7 efl callbacks: update some events calls to no longer trigger legacy callbacks 2016-08-30 13:59:59 -03:00
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01: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
Tom Hacohen 6202cc7485 Adjust the code according to the eo event stop changes.
This was changed in the previous commit.
2016-06-20 18:02:00 +01:00
Tom Hacohen a6a2338962 Revert "Eo: Remove eo_del() and make eo_unref() the replacement."
This reverts commit 546ff7bbba.

It seems that eo_del() is useful and removing it was creating bugs.
The issue is that the way we defined parents in eo, both the parent and
the programmer share a reference to the object. When we eo_unref() that
reference as the programmer, eo has no way to know it's this specific
reference we are freeing, and not a general one, so in some
circumstances, for example:
eo_ref(child);
eo_unref(child); // trying to delete here
eo_unref(container); // container is deleted here
eo_unref(child); // child already has 0 refs before this point.

We would have an issue with references and objects being freed too soon
and in general, issue with the references.

Having eo_del() solves that, because this one explicitly unparents if
there is a parent, meaning the reference ownership is explicitly taken
by the programmer.

eo_del() is essentially a convenience function around "check if has
parent, and if so unparent, otherwise, unref". Which should be used when
you want to delete an object although it has a parent, and is equivalent
to eo_unref() when it doesn't have one.
2016-06-01 13:33:21 +01:00
Cedric Bail 75a53ece10 eo: for consistency use object like all our API. 2016-05-18 08:18:04 -07:00
Tom Hacohen 546ff7bbba Eo: Remove eo_del() and make eo_unref() the replacement.
We used to have eo_del() as the mirrored action to eo_add(). No longer,
now you just always eo_unref() to delete an object. This change makes it
so the reference of the parent is shared with the reference the
programmer has. So eo_parent_set(obj, NULL) can free an object, and so
does eo_unref() (even if there is a parent).

This means Eo no longer complains if you have a parent during deletion.
2016-05-17 16:23:23 +01:00
Tom Hacohen f14305024e Eo event: rename Eo_Event->event_info to Eo_Event->info.
The previous naming was redundant and too long.
2016-04-12 15:23:55 +01: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
Tom Hacohen e71e6561ee Eo callbacks: Migrate all of the EFL to the new event cb signatures. 2016-02-29 11:33:27 +00:00
Carsten Haitzler 7eba161414 ecore-con-url- split out the curl dleopener and resolver and headers
this splits out out "manual" dlopen (eina_module_load) of curl into
its own .c file and special header out of ecore_con_url.c to tidy up
that code a bit and isolate our curl magic loading/handling
2015-09-03 12:22:01 +09:00
Srivardhan Hebbar 9dcb827d12 ecore_con: add eo_event handler to efl_networ_url.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-29 18:22:09 +02:00
Tom Hacohen 92fb2917cb Eo: Remove eo_error_set() and clean up finalizer()
This is another cleanup in perparation for the Eo stable release.
This is no longer needed thanks to the proper error reporting with
eo_constructor()'s new return value.

The finalizer change cleans it up a bit so it catches more cases/issues.
This also means that the finalizer cleans up the object in all cases,
and not only some.

@feature.
2015-05-20 16:25:38 +01:00
Tom Hacohen 7c769163d9 Ecore con url: Fix wrong object destruction.
Because we defer the deletion of this object until we get all the
responses from the network, we must manually free it. A better solution
would possibly be to just free the requests upon object deletion instead
of deferring the deletion.

@fix
2015-05-20 16:10:50 +01:00
Tom Hacohen 29d11200c6 Ecore con url: correctly destruct the object. 2015-05-20 16:10:50 +01:00
Tom Hacohen 6efbfe227a Eo: Add a return value to eo_constructor().
From now on, constructors should return a value, usually the object
being worked on, or NULL (if the constructor failed). This can also
be used for implementing singletons, by just always returning the same
object from the constructor.

This is one of the final steps towards stabilizing Eo.

@feature
2015-05-20 13:03:24 +01:00
Srivardhan Hebbar 183cef932e ecore_con: changed Ecore_Con_Url to Efl_Network_Url.
Summary: This is just the beginning. I tried for one class to check.
Tell me if this is fine, I'll change in other classes also. The goal
is to simplify and make our API clearer to understand to new comers.

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-18 11:36:16 +02:00
Raoul Hecky a01b243405 ecore-con: try to load libcurl.so.5 before .so.4
Curl is using a strange soname bumping where soname version is changed by configure when it detects some differences with off_t.
Explanations here: http://curl.haxx.se/dev/readme-curl_off_t.html

As we are not using curl_off_t in our code, we can simply load libcurl.so.5 if present.
2015-04-24 09:23:34 +02:00
Srivardhan Hebbar 709037a95d ecore_con: fix stack overflow in ecore_con_url_timer issue.
Summary:
last_ms is not needed at all. If curl_multi_timeout returns non zero, then its error, if it returns zero, then its fine. If ms is zero, then call curl_multi_perform immediately.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Subscribers: cedric

Maniphest Tasks: T2200

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-10 12:05:05 +02:00
Srivardhan Hebbar 3a64b0ccd3 ecore_con: fix ftp upload function to follow documentation.
Summary:
While creating a Ecore_con_url object, the url is given in this format "ftp://ftp.example.com". While uploading a file, this function was prefixing "ftp://" to this url which resulted in DNS failure, and upload fail. So corrected the issue.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-27 18:41:05 +01:00
Boris Faure 3a7b9a86cf ecore_con_url: add ecore_con_url_head()
Just like ecore_con_url_get() or ecore_con_url_post() but to a HTTP HEAD.

@feature
2015-02-19 22:52:50 +01:00
Boris Faure b64c770046 ecore_con_url: use an enum instead of multiple defines 2015-02-19 22:52:50 +01:00
zmike f55c756c17 curl usage better accounts for timeouts
curl is dumb. it needs to poll its own fd for data, it gets confused with its own timeouts, and sometimes it forgets that it's supposed to be doing anything.

this fixes:

* connection timeout processing
* connection data processing order

also curl_multi_timeout calls are now done from a single function to handle all of this stupidness in one place

maybe backport after more testing...
2015-01-02 23:21:55 -05:00
Carsten Haitzler b97778a1c2 ecore-con - url. fix curl init check to not access NULL _c context
this fixes T1738 (or should)
2014-11-07 08:45:18 +09:00
Tom Hacohen a58c1b6c97 Ecore con url: Migrate to eo. 2014-09-01 11:12:17 +01:00
Mike Blumenkrantz 7b0db79c2d revert all recent ecore-con related eo changes. completely broken.
please test things before committing.

reverts all changes since and including f6156c9a62
2014-08-30 08:12:54 -04:00