summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-04-08 19:19:42 -0300
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-04-08 19:21:44 -0300
commite8a59ab6c24af84161c2fce7a988503a741366e8 (patch)
tree2e1b70f9d81a72aa72e673e368c942ade05309ec /src/lib/ecore_con
parentc90865ca485acc44fbfa680e1382b9a2a41fe350 (diff)
efl_net_socket_ssl (dialer): emit "resolved"
for dialers we should also monitor "resolved" from inner TCP socket and emit that ourselves, letting people know that we have an IP address. this is important for ecore_con_legacy.c, since the svr->ip is only decoded and stored once when this signal is emitted.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/efl_net_socket_ssl.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/lib/ecore_con/efl_net_socket_ssl.c b/src/lib/ecore_con/efl_net_socket_ssl.c
index 77f9620572..9b4a51298f 100644
--- a/src/lib/ecore_con/efl_net_socket_ssl.c
+++ b/src/lib/ecore_con/efl_net_socket_ssl.c
@@ -218,6 +218,17 @@ EFL_CALLBACKS_ARRAY_DEFINE(efl_net_socket_ssl_sock_cbs,
218 {EFL_EVENT_DEL, efl_net_socket_ssl_sock_del}); 218 {EFL_EVENT_DEL, efl_net_socket_ssl_sock_del});
219 219
220static void 220static void
221efl_net_socket_ssl_sock_resolved(void *data, const Efl_Event *event EINA_UNUSED)
222{
223 Eo *o = data;
224 Efl_Net_Socket_Ssl_Data *pd = efl_data_scope_get(o, MY_CLASS);
225
226 if (pd->torndown) return;
227
228 efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, NULL);
229}
230
231static void
221efl_net_socket_ssl_sock_connected(void *data, const Efl_Event *event EINA_UNUSED) 232efl_net_socket_ssl_sock_connected(void *data, const Efl_Event *event EINA_UNUSED)
222{ 233{
223 Eo *o = data; 234 Eo *o = data;
@@ -239,6 +250,10 @@ efl_net_socket_ssl_sock_connected(void *data, const Efl_Event *event EINA_UNUSED
239 efl_unref(o); 250 efl_unref(o);
240} 251}
241 252
253EFL_CALLBACKS_ARRAY_DEFINE(efl_net_socket_ssl_sock_dialer_cbs,
254 {EFL_NET_DIALER_EVENT_RESOLVED, efl_net_socket_ssl_sock_resolved},
255 {EFL_NET_DIALER_EVENT_CONNECTED, efl_net_socket_ssl_sock_connected});
256
242static void 257static void
243_efl_net_socket_ssl_context_del(void *data, const Efl_Event *event EINA_UNUSED) 258_efl_net_socket_ssl_context_del(void *data, const Efl_Event *event EINA_UNUSED)
244{ 259{
@@ -305,7 +320,7 @@ _efl_net_socket_ssl_adopt(Eo *o, Efl_Net_Socket_Ssl_Data *pd, Efl_Net_Socket *so
305 efl_event_callback_array_add(sock, efl_net_socket_ssl_sock_cbs(), o); 320 efl_event_callback_array_add(sock, efl_net_socket_ssl_sock_cbs(), o);
306 321
307 if (efl_isa(sock, EFL_NET_DIALER_INTERFACE)) 322 if (efl_isa(sock, EFL_NET_DIALER_INTERFACE))
308 efl_event_callback_add(sock, EFL_NET_DIALER_EVENT_CONNECTED, efl_net_socket_ssl_sock_connected, o); 323 efl_event_callback_array_add(sock, efl_net_socket_ssl_sock_dialer_cbs(), o);
309 324
310 efl_net_socket_ssl_sock_can_read_changed(o, NULL); 325 efl_net_socket_ssl_sock_can_read_changed(o, NULL);
311 efl_net_socket_ssl_sock_can_write_changed(o, NULL); 326 efl_net_socket_ssl_sock_can_write_changed(o, NULL);
@@ -448,9 +463,7 @@ _efl_net_socket_ssl_efl_object_destructor(Eo *o, Efl_Net_Socket_Ssl_Data *pd)
448 { 463 {
449 efl_event_callback_array_del(pd->sock, efl_net_socket_ssl_sock_cbs(), o); 464 efl_event_callback_array_del(pd->sock, efl_net_socket_ssl_sock_cbs(), o);
450 if (efl_isa(pd->sock, EFL_NET_DIALER_INTERFACE)) 465 if (efl_isa(pd->sock, EFL_NET_DIALER_INTERFACE))
451 { 466 efl_event_callback_array_del(pd->sock, efl_net_socket_ssl_sock_dialer_cbs(), o);
452 efl_event_callback_del(pd->sock, EFL_NET_DIALER_EVENT_CONNECTED, efl_net_socket_ssl_sock_connected, o);
453 }
454 efl_unref(pd->sock); 467 efl_unref(pd->sock);
455 pd->sock = NULL; 468 pd->sock = NULL;
456 } 469 }