summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-12-07 12:15:16 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2018-12-07 12:23:11 +0100
commit33c00de365ab8ed2adebd86e5e3dc6091afc0fa9 (patch)
treefe0abdfc084f80f3c2c997f0ccfab2d5d45f3b25 /src/lib/ecore_con
parente6f66e56fdc0989e73fc54809dea5368df68cfab (diff)
eo: make efl_future_then have a data pointer in addition of the object pointer.
Summary: In the case when you have multiple future in flight related to one object, you couldn't use the previous version of efl_future_then. Now all function calls take a void* pointer that allow multiple future to have their private data request data accessible in all the callback. This should not break released API as Eo.h is not released yet and so was efl_future_Eina_FutureXXX_then. Depends on D7332 Reviewers: felipealmeida, segfaultxavi, vitor.sousa, SanghyeonLee, bu5hm4n Reviewed By: segfaultxavi Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7472 Differential Revision: https://phab.enlightenment.org/D7379
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/efl_net_dialer_http.c8
-rw-r--r--src/lib/ecore_con/efl_net_dialer_ssl.c6
-rw-r--r--src/lib/ecore_con/efl_net_dialer_tcp.c6
-rw-r--r--src/lib/ecore_con/efl_net_dialer_udp.c6
-rw-r--r--src/lib/ecore_con/efl_net_dialer_unix.c6
-rw-r--r--src/lib/ecore_con/efl_net_dialer_websocket.c12
-rw-r--r--src/lib/ecore_con/efl_net_server_windows.c6
7 files changed, 25 insertions, 25 deletions
diff --git a/src/lib/ecore_con/efl_net_dialer_http.c b/src/lib/ecore_con/efl_net_dialer_http.c
index bc004ba..8bfe967 100644
--- a/src/lib/ecore_con/efl_net_dialer_http.c
+++ b/src/lib/ecore_con/efl_net_dialer_http.c
@@ -1717,7 +1717,7 @@ _efl_net_dialer_http_efl_io_writer_can_write_set(Eo *o, Efl_Net_Dialer_Http_Data
1717 efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); 1717 efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
1718} 1718}
1719 1719
1720static Eina_Value _efl_net_dialer_http_pending_close(Eo *o, Eina_Value value); 1720static Eina_Value _efl_net_dialer_http_pending_close(Eo *o, void *data, Eina_Value value);
1721 1721
1722EOLIAN static Eina_Error 1722EOLIAN static Eina_Error
1723_efl_net_dialer_http_efl_io_closer_close(Eo *o, Efl_Net_Dialer_Http_Data *pd) 1723_efl_net_dialer_http_efl_io_closer_close(Eo *o, Efl_Net_Dialer_Http_Data *pd)
@@ -1733,8 +1733,8 @@ _efl_net_dialer_http_efl_io_closer_close(Eo *o, Efl_Net_Dialer_Http_Data *pd)
1733 if ((!pd->pending_close) && (pd->easy)) 1733 if ((!pd->pending_close) && (pd->easy))
1734 { 1734 {
1735 efl_future_then(o, efl_loop_job(efl_loop_get(o)), 1735 efl_future_then(o, efl_loop_job(efl_loop_get(o)),
1736 .success = _efl_net_dialer_http_pending_close, 1736 .success = _efl_net_dialer_http_pending_close,
1737 .storage = &pd->pending_close); 1737 .storage = &pd->pending_close);
1738 DBG("dialer=%p closed from CURL callback, schedule close job=%p", o, pd->pending_close); 1738 DBG("dialer=%p closed from CURL callback, schedule close job=%p", o, pd->pending_close);
1739 } 1739 }
1740 return 0; 1740 return 0;
@@ -1766,7 +1766,7 @@ _efl_net_dialer_http_efl_io_closer_close(Eo *o, Efl_Net_Dialer_Http_Data *pd)
1766} 1766}
1767 1767
1768static Eina_Value 1768static Eina_Value
1769_efl_net_dialer_http_pending_close(Eo *o, const Eina_Value value EINA_UNUSED) 1769_efl_net_dialer_http_pending_close(Eo *o, void *data EINA_UNUSED, const Eina_Value value EINA_UNUSED)
1770{ 1770{
1771 Efl_Net_Dialer_Http_Data *pd = efl_data_scope_get(o, MY_CLASS); 1771 Efl_Net_Dialer_Http_Data *pd = efl_data_scope_get(o, MY_CLASS);
1772 1772
diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.c b/src/lib/ecore_con/efl_net_dialer_ssl.c
index d3e83f6..78b5879 100644
--- a/src/lib/ecore_con/efl_net_dialer_ssl.c
+++ b/src/lib/ecore_con/efl_net_dialer_ssl.c
@@ -128,7 +128,7 @@ _efl_net_dialer_ssl_ssl_context_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_
128} 128}
129 129
130static Eina_Value 130static Eina_Value
131_efl_net_dialer_ssl_connect_timeout(Eo *o, const Eina_Value v) 131_efl_net_dialer_ssl_connect_timeout(Eo *o, void *data EINA_UNUSED, const Eina_Value v)
132{ 132{
133 Eina_Error err = ETIMEDOUT; 133 Eina_Error err = ETIMEDOUT;
134 134
@@ -143,8 +143,8 @@ static void
143_timeout_schedule(Eo *o, Efl_Net_Dialer_Ssl_Data *pd, double timeout) 143_timeout_schedule(Eo *o, Efl_Net_Dialer_Ssl_Data *pd, double timeout)
144{ 144{
145 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), timeout), 145 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), timeout),
146 .success = _efl_net_dialer_ssl_connect_timeout, 146 .success = _efl_net_dialer_ssl_connect_timeout,
147 .storage = &pd->connect_timeout); 147 .storage = &pd->connect_timeout);
148} 148}
149 149
150EOLIAN static Eina_Error 150EOLIAN static Eina_Error
diff --git a/src/lib/ecore_con/efl_net_dialer_tcp.c b/src/lib/ecore_con/efl_net_dialer_tcp.c
index 57f5cf9..9a7a795 100644
--- a/src/lib/ecore_con/efl_net_dialer_tcp.c
+++ b/src/lib/ecore_con/efl_net_dialer_tcp.c
@@ -90,7 +90,7 @@ _efl_net_dialer_tcp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Tcp_Data *pd)
90} 90}
91 91
92static Eina_Value 92static Eina_Value
93_efl_net_dialer_tcp_connect_timeout(Eo *o, const Eina_Value v) 93_efl_net_dialer_tcp_connect_timeout(Eo *o, void *data EINA_UNUSED, const Eina_Value v)
94{ 94{
95 Efl_Net_Dialer_Tcp_Data *pd = efl_data_scope_get(o, MY_CLASS); 95 Efl_Net_Dialer_Tcp_Data *pd = efl_data_scope_get(o, MY_CLASS);
96 Eina_Error err = ETIMEDOUT; 96 Eina_Error err = ETIMEDOUT;
@@ -108,8 +108,8 @@ static void
108_timeout_schedule(Eo *o, Efl_Net_Dialer_Tcp_Data *pd) 108_timeout_schedule(Eo *o, Efl_Net_Dialer_Tcp_Data *pd)
109{ 109{
110 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), pd->timeout_dial), 110 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), pd->timeout_dial),
111 .success = _efl_net_dialer_tcp_connect_timeout, 111 .success = _efl_net_dialer_tcp_connect_timeout,
112 .storage = &pd->connect.timeout); 112 .storage = &pd->connect.timeout);
113} 113}
114 114
115static void 115static void
diff --git a/src/lib/ecore_con/efl_net_dialer_udp.c b/src/lib/ecore_con/efl_net_dialer_udp.c
index f3e7ef2..351d077 100644
--- a/src/lib/ecore_con/efl_net_dialer_udp.c
+++ b/src/lib/ecore_con/efl_net_dialer_udp.c
@@ -82,7 +82,7 @@ _efl_net_dialer_udp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Udp_Data *pd)
82} 82}
83 83
84static Eina_Value 84static Eina_Value
85_efl_net_dialer_udp_resolver_timeout(Eo *o, const Eina_Value v) 85_efl_net_dialer_udp_resolver_timeout(Eo *o, void *data EINA_UNUSED, const Eina_Value v)
86{ 86{
87 Efl_Net_Dialer_Udp_Data *pd = efl_data_scope_get(o, MY_CLASS); 87 Efl_Net_Dialer_Udp_Data *pd = efl_data_scope_get(o, MY_CLASS);
88 Eina_Error err = ETIMEDOUT; 88 Eina_Error err = ETIMEDOUT;
@@ -104,8 +104,8 @@ static void
104_timeout_schedule(Eo *o, Efl_Net_Dialer_Udp_Data *pd) 104_timeout_schedule(Eo *o, Efl_Net_Dialer_Udp_Data *pd)
105{ 105{
106 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), pd->timeout_dial), 106 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), pd->timeout_dial),
107 .success = _efl_net_dialer_udp_resolver_timeout, 107 .success = _efl_net_dialer_udp_resolver_timeout,
108 .storage = &pd->resolver.timeout); 108 .storage = &pd->resolver.timeout);
109} 109}
110 110
111static Eina_Error 111static Eina_Error
diff --git a/src/lib/ecore_con/efl_net_dialer_unix.c b/src/lib/ecore_con/efl_net_dialer_unix.c
index d644d5d..95e2b06 100644
--- a/src/lib/ecore_con/efl_net_dialer_unix.c
+++ b/src/lib/ecore_con/efl_net_dialer_unix.c
@@ -71,7 +71,7 @@ _efl_net_dialer_unix_efl_object_destructor(Eo *o, Efl_Net_Dialer_Unix_Data *pd)
71} 71}
72 72
73static Eina_Value 73static Eina_Value
74_efl_net_dialer_unix_connect_timeout(Eo *o, const Eina_Value v) 74_efl_net_dialer_unix_connect_timeout(Eo *o, void *data EINA_UNUSED, const Eina_Value v)
75{ 75{
76 Efl_Net_Dialer_Unix_Data *pd = efl_data_scope_get(o, MY_CLASS); 76 Efl_Net_Dialer_Unix_Data *pd = efl_data_scope_get(o, MY_CLASS);
77 Eina_Error err = ETIMEDOUT; 77 Eina_Error err = ETIMEDOUT;
@@ -130,8 +130,8 @@ static void
130_timeout_schedule(Eo *o, Efl_Net_Dialer_Unix_Data *pd) 130_timeout_schedule(Eo *o, Efl_Net_Dialer_Unix_Data *pd)
131{ 131{
132 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), pd->timeout_dial), 132 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), pd->timeout_dial),
133 .success = _efl_net_dialer_unix_connect_timeout, 133 .success = _efl_net_dialer_unix_connect_timeout,
134 .storage = &pd->connect.timeout); 134 .storage = &pd->connect.timeout);
135} 135}
136 136
137EOLIAN static Eina_Error 137EOLIAN static Eina_Error
diff --git a/src/lib/ecore_con/efl_net_dialer_websocket.c b/src/lib/ecore_con/efl_net_dialer_websocket.c
index 3c5339d..30545f2 100644
--- a/src/lib/ecore_con/efl_net_dialer_websocket.c
+++ b/src/lib/ecore_con/efl_net_dialer_websocket.c
@@ -735,7 +735,7 @@ _efl_net_dialer_websocket_job_receive(Eo *o, Efl_Net_Dialer_Websocket_Data *pd)
735} 735}
736 736
737static Eina_Value 737static Eina_Value
738_efl_net_dialer_websocket_job(Eo *o, const Eina_Value v) 738_efl_net_dialer_websocket_job(Eo *o, void *data EINA_UNUSED, const Eina_Value v)
739{ 739{
740 Efl_Net_Dialer_Websocket_Data *pd = efl_data_scope_get(o, MY_CLASS); 740 Efl_Net_Dialer_Websocket_Data *pd = efl_data_scope_get(o, MY_CLASS);
741 741
@@ -765,8 +765,8 @@ _efl_net_dialer_websocket_job_schedule(Eo *o, Efl_Net_Dialer_Websocket_Data *pd)
765 if (!loop) return; 765 if (!loop) return;
766 766
767 efl_future_then(o, efl_loop_job(loop), 767 efl_future_then(o, efl_loop_job(loop),
768 .success = _efl_net_dialer_websocket_job, 768 .success = _efl_net_dialer_websocket_job,
769 .storage = &pd->job); 769 .storage = &pd->job);
770} 770}
771 771
772static void 772static void
@@ -1486,7 +1486,7 @@ _efl_net_dialer_websocket_binary_send(Eo *o, Efl_Net_Dialer_Websocket_Data *pd,
1486} 1486}
1487 1487
1488static Eina_Value 1488static Eina_Value
1489_efl_net_dialer_websocket_close_request_timeout(Eo *o, const Eina_Value v) 1489_efl_net_dialer_websocket_close_request_timeout(Eo *o, void *data EINA_UNUSED, const Eina_Value v)
1490{ 1490{
1491 DBG("server did not close the TCP socket, timeout"); 1491 DBG("server did not close the TCP socket, timeout");
1492 efl_event_callback_call(o, EFL_IO_CLOSER_EVENT_CLOSED, NULL); 1492 efl_event_callback_call(o, EFL_IO_CLOSER_EVENT_CLOSED, NULL);
@@ -1505,8 +1505,8 @@ _efl_net_dialer_websocket_close_request(Eo *o, Efl_Net_Dialer_Websocket_Data *pd
1505 eina_future_cancel(pd->close_timeout); 1505 eina_future_cancel(pd->close_timeout);
1506 1506
1507 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), 2.0), 1507 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), 2.0),
1508 .success = _efl_net_dialer_websocket_close_request_timeout, 1508 .success = _efl_net_dialer_websocket_close_request_timeout,
1509 .storage = &pd->close_timeout); 1509 .storage = &pd->close_timeout);
1510 1510
1511 efl_io_writer_can_write_set(o, EINA_FALSE); 1511 efl_io_writer_can_write_set(o, EINA_FALSE);
1512 1512
diff --git a/src/lib/ecore_con/efl_net_server_windows.c b/src/lib/ecore_con/efl_net_server_windows.c
index 8859036..68e7fe9 100644
--- a/src/lib/ecore_con/efl_net_server_windows.c
+++ b/src/lib/ecore_con/efl_net_server_windows.c
@@ -312,7 +312,7 @@ _efl_net_server_windows_efl_net_server_address_get(const Eo *o EINA_UNUSED, Efl_
312} 312}
313 313
314static Eina_Value 314static Eina_Value
315_efl_net_server_windows_pending_announce_job(Eo *o, const Eina_Value v) 315_efl_net_server_windows_pending_announce_job(Eo *o, void *data EINA_UNUSED, const Eina_Value v)
316{ 316{
317 Efl_Net_Server_Windows_Data *pd = efl_data_scope_get(o, MY_CLASS); 317 Efl_Net_Server_Windows_Data *pd = efl_data_scope_get(o, MY_CLASS);
318 Eo *client; 318 Eo *client;
@@ -339,8 +339,8 @@ _efl_net_server_windows_pending_announce_job_schedule(Eo *o, Efl_Net_Server_Wind
339 loop = efl_loop_get(o); 339 loop = efl_loop_get(o);
340 if (!loop) return; 340 if (!loop) return;
341 efl_future_then(o, efl_loop_job(loop), 341 efl_future_then(o, efl_loop_job(loop),
342 .success = _efl_net_server_windows_pending_announce_job, 342 .success = _efl_net_server_windows_pending_announce_job,
343 .storage = &pd->pending_announcer_job); 343 .storage = &pd->pending_announcer_job);
344} 344}
345 345
346EOLIAN static void 346EOLIAN static void