Commit Graph

12 Commits

Author SHA1 Message Date
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
Daniel Zaoui 3235c83c36 Ecore_Con_Url/Curl: add referencing on _c structure
The _c structure used to store the Curl function pointers needs
referencing to be sure it is not freed although still needed.
The non-referencing was leading to a crash during the destruction
of the dialers. The _c was still used although it has been freed
by ecore_con_url_shutdown.
2016-12-23 23:02:45 +02:00
Gustavo Sverzut Barbieri 4aca800bde efl_net_dialer_http: export SSL controls.
verify peer, hostname and set CA/CRL files.
2016-11-29 16:02:25 -02:00
Gustavo Sverzut Barbieri 3cf20ea8e8 efl_net_dialer_http: special headers and date parse/serialize.
CURL needs some special curl_easy_setopt() calls to enable automatic
gzip deflate (CURLOPT_ENCODING) and
If-Modified-Since/If-Unmodified-Since logic.

As If-Modified-Since/If-Unmodified-Since requires a timestamp string,
let's expose class methods to handle those.
2016-11-29 16:02:25 -02:00
Andrii Kroitor 9a1f3891d4 ecore_con_url_curl.h: add missing include on windows
Summary: windows has its own sockets implementation

Reviewers: raster, bowonryu, vtorri, Hermet

Reviewed By: Hermet

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4279
2016-09-06 16:36:59 +09:00
Gustavo Sverzut Barbieri 57e765a758 efl_net_dialer_http: use CURLOPT_NOSIGNAL.
EFL uses its own signal handlers, so we must disable CURL's usage of
those.
2016-09-02 00:08:50 -03:00
Gustavo Sverzut Barbieri 6ddd01bffb efl_net_dialer_http: fix interaction with CURL on receiving data.
When CURLOPT_WRITEFUNCTION returns less then the requested amount,
CURL will fail, not call us back with the remaining data.

Then in such cases we must pause CURL and read nothing.

When unpausing we need to kick curl with timeout action so FD handlers
will be re-arranged.

Last but not least, sync our buffer limit with CURL, otherwise it may
always fail if we're smaller than CURL.
2016-09-02 00:08:50 -03:00
Jean-Philippe Andre ba80f7e5b0 ecore_con: Add missing socket.h
Reported and patched by @netstar

Fixes T4461
2016-08-30 20:52:02 +09:00
Gustavo Sverzut Barbieri b004b8a4f9 efl_net_dialer_http: keep fd directly.
provide curl with CURLOPT_OPENSOCKETFUNCTION and keep the fd in our
private data.

This is required because on _efl_net_dialer_http_efl_io_writer_write()
we may have no fdhandler.

It happened to me while implementing the WebSocket that uses a
bi-directional communication on top of HTTP and the server sent the
whole message, CURL reads:

   recvfrom(7, "...", 16384, 0, NULL, NULL) = 86
   recvfrom(7, "", 16384, 0, NULL, NULL) = 0

After the empty (second) recvfrom(), CURL will remove the fdhandler:

    DBG:ecore_con lib/ecore_con/efl_net_dialer_http.c:482 _efl_net_dialer_http_curlm_socket_manage() dialer=0x4000000040000005 fdhandler=(nil), fd=7, curl_easy=0x5561846ca8d0, flags=0x4

However I should be able to write to this socket, in my case I need to
reply to a PING request with a PONG.
2016-08-30 00:36:00 -03:00
Gustavo Sverzut Barbieri f125942231 efl_net_dialer_http: use the proper error code
CURLcode is for curl_easy, while CURLMcode is for curl_multi.

Thanks to clang that spotted it.
2016-08-24 14:33:33 -03:00
Gustavo Sverzut Barbieri b791c79ca0 WIP: efl.net: Introduce Efl.Net.Dialer.Http
This class implements the Efl.Net.Dialer interface using libcurl to
perform HTTP requests. That means it's an Efl.Net.Dialer,
Efl.Net.Socket, Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus
being usable with Efl.Io.Copier as demonstrated in the
efl_io_copier_example.c
2016-08-22 18:25:15 -03: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