summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-03-27 15:54:38 -0300
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-03-29 12:44:19 -0300
commit6877ee8ad42bd4510101926a3b1e21fb3096425a (patch)
treea8a58effa867b833a11a6918e9d76601d7211076
parenta4be1e479c2c329e99d693d4921e1e39c66bc1a5 (diff)
ecore_ipc: use new efl_net_*_windows classes.
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c393
-rw-r--r--src/lib/ecore_ipc/ecore_ipc_private.h9
2 files changed, 42 insertions, 360 deletions
diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index 8f72ff99eb..0c08bfcd5f 100644
--- a/src/lib/ecore_ipc/ecore_ipc.c
+++ b/src/lib/ecore_ipc/ecore_ipc.c
@@ -205,14 +205,6 @@ _ecore_ipc_ddlt_int(int in, int prev, int mode)
205} 205}
206 206
207/* EFL_NET_SERVER_UNIX_CLASS and EFL_NET_DIALER_UNIX_CLASS should be defined at the same time, we're only checking for EFL_NET_SERVER_UNIX_CLASS in shared blocks */ 207/* EFL_NET_SERVER_UNIX_CLASS and EFL_NET_DIALER_UNIX_CLASS should be defined at the same time, we're only checking for EFL_NET_SERVER_UNIX_CLASS in shared blocks */
208#ifndef EFL_NET_SERVER_UNIX_CLASS
209static Eina_Bool _ecore_ipc_event_client_add(void *data, int ev_type, void *ev);
210static Eina_Bool _ecore_ipc_event_client_del(void *data, int ev_type, void *ev);
211static Eina_Bool _ecore_ipc_event_server_add(void *data, int ev_type, void *ev);
212static Eina_Bool _ecore_ipc_event_server_del(void *data, int ev_type, void *ev);
213static Eina_Bool _ecore_ipc_event_client_data(void *data, int ev_type, void *ev);
214static Eina_Bool _ecore_ipc_event_server_data(void *data, int ev_type, void *ev);
215#endif
216 208
217static void _ecore_ipc_event_client_add_free(void *data, void *ev); 209static void _ecore_ipc_event_client_add_free(void *data, void *ev);
218static void _ecore_ipc_event_client_del_free(void *data, void *ev); 210static void _ecore_ipc_event_client_del_free(void *data, void *ev);
@@ -231,10 +223,6 @@ EAPI int ECORE_IPC_EVENT_SERVER_DATA = 0;
231static int _ecore_ipc_init_count = 0; 223static int _ecore_ipc_init_count = 0;
232static Eina_List *servers = NULL; 224static Eina_List *servers = NULL;
233 225
234#ifndef EFL_NET_SERVER_UNIX_CLASS
235static Ecore_Event_Handler *handler[6];
236#endif
237
238static void 226static void
239ecore_ipc_post_event_server_add(Ecore_Ipc_Server *svr) 227ecore_ipc_post_event_server_add(Ecore_Ipc_Server *svr)
240{ 228{
@@ -318,10 +306,6 @@ ecore_ipc_client_add(Ecore_Ipc_Server *svr)
318EAPI int 306EAPI int
319ecore_ipc_init(void) 307ecore_ipc_init(void)
320{ 308{
321#ifndef EFL_NET_SERVER_UNIX_CLASS
322 int i = 0;
323#endif
324
325 if (++_ecore_ipc_init_count != 1) 309 if (++_ecore_ipc_init_count != 1)
326 return _ecore_ipc_init_count; 310 return _ecore_ipc_init_count;
327 311
@@ -346,30 +330,12 @@ ecore_ipc_init(void)
346 ECORE_IPC_EVENT_CLIENT_DATA = ecore_event_type_new(); 330 ECORE_IPC_EVENT_CLIENT_DATA = ecore_event_type_new();
347 ECORE_IPC_EVENT_SERVER_DATA = ecore_event_type_new(); 331 ECORE_IPC_EVENT_SERVER_DATA = ecore_event_type_new();
348 332
349#ifndef EFL_NET_SERVER_UNIX_CLASS
350 handler[i++] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD,
351 _ecore_ipc_event_client_add, NULL);
352 handler[i++] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL,
353 _ecore_ipc_event_client_del, NULL);
354 handler[i++] = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD,
355 _ecore_ipc_event_server_add, NULL);
356 handler[i++] = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DEL,
357 _ecore_ipc_event_server_del, NULL);
358 handler[i++] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA,
359 _ecore_ipc_event_client_data, NULL);
360 handler[i] = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA,
361 _ecore_ipc_event_server_data, NULL);
362#endif
363 return _ecore_ipc_init_count; 333 return _ecore_ipc_init_count;
364} 334}
365 335
366EAPI int 336EAPI int
367ecore_ipc_shutdown(void) 337ecore_ipc_shutdown(void)
368{ 338{
369#ifndef EFL_NET_SERVER_UNIX_CLASS
370 int i;
371#endif
372
373 if (--_ecore_ipc_init_count != 0) 339 if (--_ecore_ipc_init_count != 0)
374 return _ecore_ipc_init_count; 340 return _ecore_ipc_init_count;
375 341
@@ -385,11 +351,6 @@ ecore_ipc_shutdown(void)
385 ECORE_IPC_EVENT_CLIENT_DATA, 351 ECORE_IPC_EVENT_CLIENT_DATA,
386 ECORE_IPC_EVENT_SERVER_DATA); 352 ECORE_IPC_EVENT_SERVER_DATA);
387 353
388#ifndef EFL_NET_SERVER_UNIX_CLASS
389 for (i = 0; i < 6; i++)
390 ecore_event_handler_del(handler[i]);
391#endif
392
393 ecore_con_shutdown(); 354 ecore_con_shutdown();
394 355
395 /* do not unregister log domain as ecore_ipc_servers may be pending deletion 356 /* do not unregister log domain as ecore_ipc_servers may be pending deletion
@@ -416,50 +377,6 @@ static void _ecore_ipc_server_client_add(void *data, const Efl_Event *event);
416EFL_CALLBACKS_ARRAY_DEFINE(_ecore_ipc_server_cbs, 377EFL_CALLBACKS_ARRAY_DEFINE(_ecore_ipc_server_cbs,
417 { EFL_NET_SERVER_EVENT_CLIENT_ADD, _ecore_ipc_server_client_add }); 378 { EFL_NET_SERVER_EVENT_CLIENT_ADD, _ecore_ipc_server_client_add });
418 379
419
420#ifndef EFL_NET_SERVER_UNIX_CLASS
421static Ecore_Ipc_Server *
422ecore_ipc_server_add_legacy(Ecore_Ipc_Type compl_type, const char *name, int port, const void *data)
423{
424 Ecore_Ipc_Server *svr;
425 Ecore_Ipc_Type type;
426 Ecore_Con_Type extra = 0;
427
428 if (!name) return NULL;
429
430 svr = calloc(1, sizeof(Ecore_Ipc_Server));
431 if (!svr) return NULL;
432 type = compl_type;
433 type &= ~ECORE_IPC_USE_SSL;
434 if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL;
435 switch (type)
436 {
437 case ECORE_IPC_LOCAL_USER:
438 svr->legacy_server = ecore_con_server_add(ECORE_CON_LOCAL_USER | extra, name, port, svr);
439 break;
440 case ECORE_IPC_LOCAL_SYSTEM:
441 svr->legacy_server = ecore_con_server_add(ECORE_CON_LOCAL_SYSTEM | extra, name, port, svr);
442 break;
443 case ECORE_IPC_REMOTE_SYSTEM:
444 svr->legacy_server = ecore_con_server_add(ECORE_CON_REMOTE_SYSTEM | extra, name, port, svr);
445 break;
446 default:
447 free(svr);
448 return NULL;
449 }
450 if (!svr->legacy_server)
451 {
452 free(svr);
453 return NULL;
454 }
455 svr->max_buf_size = 32 * 1024;
456 svr->data = (void *)data;
457 servers = eina_list_append(servers, svr);
458 ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER);
459 return svr;
460}
461#endif
462
463/* FIXME: need to add protocol type parameter */ 380/* FIXME: need to add protocol type parameter */
464EAPI Ecore_Ipc_Server * 381EAPI Ecore_Ipc_Server *
465ecore_ipc_server_add(Ecore_Ipc_Type type, const char *name, int port, const void *data) 382ecore_ipc_server_add(Ecore_Ipc_Type type, const char *name, int port, const void *data)
@@ -474,15 +391,6 @@ ecore_ipc_server_add(Ecore_Ipc_Type type, const char *name, int port, const void
474 391
475 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL); 392 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
476 393
477#ifndef EFL_NET_SERVER_UNIX_CLASS
478 if (((type & ECORE_IPC_TYPE) == ECORE_IPC_LOCAL_USER) ||
479 ((type & ECORE_IPC_TYPE) == ECORE_IPC_LOCAL_SYSTEM))
480 {
481 DBG("no 'local' Efl.Net.Server for your system yet, use legacy Ecore_Con");
482 return ecore_ipc_server_add_legacy(type, name, port, data);
483 }
484#endif
485
486 svr = calloc(1, sizeof(Ecore_Ipc_Server)); 394 svr = calloc(1, sizeof(Ecore_Ipc_Server));
487 EINA_SAFETY_ON_NULL_RETURN_VAL(svr, NULL); 395 EINA_SAFETY_ON_NULL_RETURN_VAL(svr, NULL);
488 396
@@ -512,6 +420,30 @@ ecore_ipc_server_add(Ecore_Ipc_Type type, const char *name, int port, const void
512 EINA_SAFETY_ON_NULL_GOTO(svr->server, error_server); 420 EINA_SAFETY_ON_NULL_GOTO(svr->server, error_server);
513 } 421 }
514#endif /* EFL_NET_SERVER_UNIX_CLASS */ 422#endif /* EFL_NET_SERVER_UNIX_CLASS */
423#ifdef EFL_NET_SERVER_WINDOWS_CLASS
424 if ((type & ECORE_IPC_TYPE) == ECORE_IPC_LOCAL_USER)
425 {
426 address = ecore_con_local_path_new(EINA_FALSE, name, port);
427 EINA_SAFETY_ON_NULL_GOTO(address, error_server);
428
429 // TODO: specify SECURITY_ATTRIBUTES to use or some
430 // Efl_Net_Server_Windows API to limit access
431
432 svr->server = efl_add(EFL_NET_SERVER_WINDOWS_CLASS, ecore_main_loop_get());
433 EINA_SAFETY_ON_NULL_GOTO(svr->server, error_server);
434 }
435 else if ((type & ECORE_IPC_TYPE) == ECORE_IPC_LOCAL_SYSTEM)
436 {
437 address = ecore_con_local_path_new(EINA_TRUE, name, port);
438 EINA_SAFETY_ON_NULL_GOTO(address, error_server);
439
440 // TODO: specify SECURITY_ATTRIBUTES to use or some
441 // Efl_Net_Server_Windows API to limit access
442
443 svr->server = efl_add(EFL_NET_SERVER_WINDOWS_CLASS, ecore_main_loop_get());
444 EINA_SAFETY_ON_NULL_GOTO(svr->server, error_server);
445 }
446#endif /* EFL_NET_SERVER_WINDOWS_CLASS */
515 else if ((type & ECORE_IPC_TYPE) == ECORE_IPC_REMOTE_SYSTEM) 447 else if ((type & ECORE_IPC_TYPE) == ECORE_IPC_REMOTE_SYSTEM)
516 { 448 {
517 char buf[4096]; 449 char buf[4096];
@@ -697,51 +629,6 @@ _ecore_ipc_dialer_copier_error(void *data, const Efl_Event *event)
697EFL_CALLBACKS_ARRAY_DEFINE(_ecore_ipc_dialer_copier_cbs, 629EFL_CALLBACKS_ARRAY_DEFINE(_ecore_ipc_dialer_copier_cbs,
698 { EFL_IO_COPIER_EVENT_ERROR, _ecore_ipc_dialer_copier_error }); 630 { EFL_IO_COPIER_EVENT_ERROR, _ecore_ipc_dialer_copier_error });
699 631
700#ifndef EFL_NET_DIALER_UNIX_CLASS
701static Ecore_Ipc_Server *
702ecore_ipc_server_connect_legacy(Ecore_Ipc_Type compl_type, char *name, int port, const void *data)
703{
704 Ecore_Ipc_Server *svr;
705 Ecore_Ipc_Type type;
706 Ecore_Con_Type extra = 0;
707 int features;
708
709 svr = calloc(1, sizeof(Ecore_Ipc_Server));
710 if (!svr) return NULL;
711 type = compl_type & ECORE_IPC_TYPE;
712 features = compl_type & ECORE_IPC_SSL;
713 if ((features & ECORE_IPC_USE_SSL) == ECORE_IPC_USE_SSL)
714 extra |= ECORE_CON_USE_SSL;
715 if ((features & ECORE_IPC_NO_PROXY) == ECORE_IPC_NO_PROXY)
716 extra |= ECORE_CON_NO_PROXY;
717 switch (type)
718 {
719 case ECORE_IPC_LOCAL_USER:
720 svr->legacy_server = ecore_con_server_connect(ECORE_CON_LOCAL_USER | extra, name, port, svr);
721 break;
722 case ECORE_IPC_LOCAL_SYSTEM:
723 svr->legacy_server = ecore_con_server_connect(ECORE_CON_LOCAL_SYSTEM | extra, name, port, svr);
724 break;
725 case ECORE_IPC_REMOTE_SYSTEM:
726 svr->legacy_server = ecore_con_server_connect(ECORE_CON_REMOTE_SYSTEM | extra, name, port, svr);
727 break;
728 default:
729 free(svr);
730 return NULL;
731 }
732 if (!svr->legacy_server)
733 {
734 free(svr);
735 return NULL;
736 }
737 svr->max_buf_size = -1;
738 svr->data = (void *)data;
739 servers = eina_list_append(servers, svr);
740 ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER);
741 return svr;
742}
743#endif
744
745/* FIXME: need to add protocol type parameter */ 632/* FIXME: need to add protocol type parameter */
746EAPI Ecore_Ipc_Server * 633EAPI Ecore_Ipc_Server *
747ecore_ipc_server_connect(Ecore_Ipc_Type type, char *name, int port, const void *data) 634ecore_ipc_server_connect(Ecore_Ipc_Type type, char *name, int port, const void *data)
@@ -753,15 +640,6 @@ ecore_ipc_server_connect(Ecore_Ipc_Type type, char *name, int port, const void *
753 640
754 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL); 641 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
755 642
756#ifndef EFL_NET_DIALER_UNIX_CLASS
757 if (((type & ECORE_IPC_TYPE) == ECORE_IPC_LOCAL_USER) ||
758 ((type & ECORE_IPC_TYPE) == ECORE_IPC_LOCAL_SYSTEM))
759 {
760 DBG("no 'local' Efl.Net.Dialer for your system yet, use legacy Ecore_Con");
761 return ecore_ipc_server_connect_legacy(type, name, port, data);
762 }
763#endif
764
765 svr = calloc(1, sizeof(Ecore_Ipc_Server)); 643 svr = calloc(1, sizeof(Ecore_Ipc_Server));
766 EINA_SAFETY_ON_NULL_RETURN_VAL(svr, NULL); 644 EINA_SAFETY_ON_NULL_RETURN_VAL(svr, NULL);
767 645
@@ -796,6 +674,24 @@ ecore_ipc_server_connect(Ecore_Ipc_Type type, char *name, int port, const void *
796 EINA_SAFETY_ON_NULL_GOTO(svr->dialer.dialer, error_dialer); 674 EINA_SAFETY_ON_NULL_GOTO(svr->dialer.dialer, error_dialer);
797 } 675 }
798#endif /* EFL_NET_DIALER_UNIX_CLASS */ 676#endif /* EFL_NET_DIALER_UNIX_CLASS */
677#ifdef EFL_NET_DIALER_WINDOWS_CLASS
678 if ((type & ECORE_IPC_TYPE) == ECORE_IPC_LOCAL_USER)
679 {
680 address = ecore_con_local_path_new(EINA_FALSE, name, port);
681 EINA_SAFETY_ON_NULL_GOTO(address, error_dialer);
682
683 svr->dialer.dialer = efl_add(EFL_NET_DIALER_WINDOWS_CLASS, ecore_main_loop_get());
684 EINA_SAFETY_ON_NULL_GOTO(svr->dialer.dialer, error_dialer);
685 }
686 else if ((type & ECORE_IPC_TYPE) == ECORE_IPC_LOCAL_SYSTEM)
687 {
688 address = ecore_con_local_path_new(EINA_TRUE, name, port);
689 EINA_SAFETY_ON_NULL_GOTO(address, error_dialer);
690
691 svr->dialer.dialer = efl_add(EFL_NET_DIALER_WINDOWS_CLASS, ecore_main_loop_get());
692 EINA_SAFETY_ON_NULL_GOTO(svr->dialer.dialer, error_dialer);
693 }
694#endif /* EFL_NET_DIALER_WINDOWS_CLASS */
799 else if ((type & ECORE_IPC_TYPE) == ECORE_IPC_REMOTE_SYSTEM) 695 else if ((type & ECORE_IPC_TYPE) == ECORE_IPC_REMOTE_SYSTEM)
800 { 696 {
801 char buf[4096]; 697 char buf[4096];
@@ -910,9 +806,6 @@ ecore_ipc_server_del(Ecore_Ipc_Server *svr)
910 806
911 if (svr->dialer.dialer) _ecore_ipc_dialer_del(svr); 807 if (svr->dialer.dialer) _ecore_ipc_dialer_del(svr);
912 if (svr->server) _ecore_ipc_server_del(svr); 808 if (svr->server) _ecore_ipc_server_del(svr);
913#ifndef EFL_NET_SERVER_UNIX_CLASS
914 if (svr->legacy_server) ecore_con_server_del(svr->legacy_server);
915#endif
916 servers = eina_list_remove(servers, svr); 809 servers = eina_list_remove(servers, svr);
917 810
918 if (svr->buf) free(svr->buf); 811 if (svr->buf) free(svr->buf);
@@ -949,13 +842,7 @@ ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr)
949 if (svr->dialer.dialer) 842 if (svr->dialer.dialer)
950 return efl_net_dialer_connected_get(svr->dialer.dialer); 843 return efl_net_dialer_connected_get(svr->dialer.dialer);
951 else if (svr->server) return EINA_TRUE; 844 else if (svr->server) return EINA_TRUE;
952#ifndef EFL_NET_SERVER_UNIX_CLASS
953 else if (!svr->legacy_server) return EINA_FALSE;
954
955 return ecore_con_server_connected_get(svr->legacy_server);
956#else
957 return EINA_FALSE; 845 return EINA_FALSE;
958#endif
959} 846}
960 847
961EAPI Eina_List * 848EAPI Eina_List *
@@ -1084,19 +971,7 @@ ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int
1084 ERR("Send data to clients, not the server handle"); 971 ERR("Send data to clients, not the server handle");
1085 return 0; 972 return 0;
1086 } 973 }
1087#ifndef EFL_NET_SERVER_UNIX_CLASS
1088 else if (!svr->legacy_server) return 0;
1089
1090 {
1091 int ret;
1092
1093 ret = ecore_con_server_send(svr->legacy_server, dat, s);
1094 if (size > 0) ret += ecore_con_server_send(svr->legacy_server, data, size);
1095 return ret;
1096 }
1097#else
1098 return 0; 974 return 0;
1099#endif
1100} 975}
1101 976
1102EAPI void 977EAPI void
@@ -1113,10 +988,6 @@ ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char
1113 efl_net_server_clients_limit_set(svr->server, client_limit, reject_excess_clients); 988 efl_net_server_clients_limit_set(svr->server, client_limit, reject_excess_clients);
1114 return; 989 return;
1115 } 990 }
1116#ifndef EFL_NET_SERVER_UNIX_CLASS
1117 else if (!svr->legacy_server) return;
1118 ecore_con_server_client_limit_set(svr->legacy_server, client_limit, reject_excess_clients);
1119#endif
1120} 991}
1121 992
1122EAPI void 993EAPI void
@@ -1169,13 +1040,7 @@ ecore_ipc_server_ip_get(Ecore_Ipc_Server *svr)
1169 /* original IPC just returned IP for remote connections */ 1040 /* original IPC just returned IP for remote connections */
1170 return NULL; 1041 return NULL;
1171 } 1042 }
1172#ifndef EFL_NET_SERVER_UNIX_CLASS
1173 else if (!svr->legacy_server) return NULL;
1174
1175 return ecore_con_server_ip_get(svr->legacy_server);
1176#else
1177 return NULL; 1043 return NULL;
1178#endif
1179} 1044}
1180 1045
1181EAPI void 1046EAPI void
@@ -1201,11 +1066,6 @@ ecore_ipc_server_flush(Ecore_Ipc_Server *svr)
1201 ERR("Flush clients, not the server handle"); 1066 ERR("Flush clients, not the server handle");
1202 return; 1067 return;
1203 } 1068 }
1204#ifndef EFL_NET_SERVER_UNIX_CLASS
1205 else if (!svr->legacy_server) return;
1206
1207 ecore_con_server_flush(svr->legacy_server);
1208#endif
1209} 1069}
1210 1070
1211#define CLENC(_member) \ 1071#define CLENC(_member) \
@@ -1256,10 +1116,6 @@ ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int r
1256 } 1116 }
1257 if (cl->socket.socket) 1117 if (cl->socket.socket)
1258 EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_io_closer_closed_get(cl->socket.socket), 0); 1118 EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_io_closer_closed_get(cl->socket.socket), 0);
1259#ifndef EFL_NET_SERVER_UNIX_CLASS
1260 else if (cl->client)
1261 EINA_SAFETY_ON_TRUE_RETURN_VAL(!ecore_con_client_connected_get(cl->client), 0);
1262#endif
1263 else 1119 else
1264 { 1120 {
1265 ERR("client %p is not connected", cl); 1121 ERR("client %p is not connected", cl);
@@ -1329,19 +1185,7 @@ ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int r
1329 1185
1330 return s + size; 1186 return s + size;
1331 } 1187 }
1332#ifndef EFL_NET_SERVER_UNIX_CLASS
1333 else if (!cl->client) return 0;
1334
1335 {
1336 int ret;
1337
1338 ret = ecore_con_client_send(cl->client, dat, s);
1339 if (size > 0) ret += ecore_con_client_send(cl->client, data, size);
1340 return ret;
1341 }
1342#else
1343 return 0; 1188 return 0;
1344#endif
1345} 1189}
1346 1190
1347EAPI Ecore_Ipc_Server * 1191EAPI Ecore_Ipc_Server *
@@ -1510,9 +1354,6 @@ ecore_ipc_client_del(Ecore_Ipc_Client *cl)
1510 { 1354 {
1511 svr = cl->svr; 1355 svr = cl->svr;
1512 if (cl->socket.socket) _ecore_ipc_client_socket_del(cl); 1356 if (cl->socket.socket) _ecore_ipc_client_socket_del(cl);
1513#ifndef EFL_NET_SERVER_UNIX_CLASS
1514 if (cl->client) ecore_con_client_del(cl->client);
1515#endif
1516 if (ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) 1357 if (ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER))
1517 svr->clients = eina_list_remove(svr->clients, cl); 1358 svr->clients = eina_list_remove(svr->clients, cl);
1518 if (cl->buf) free(cl->buf); 1359 if (cl->buf) free(cl->buf);
@@ -1589,13 +1430,7 @@ ecore_ipc_client_ip_get(Ecore_Ipc_Client *cl)
1589 */ 1430 */
1590 return "0.0.0.0"; 1431 return "0.0.0.0";
1591 } 1432 }
1592#ifndef EFL_NET_SERVER_UNIX_CLASS
1593 else if (!cl->client) return NULL;
1594
1595 return ecore_con_client_ip_get(cl->client);
1596#else
1597 return NULL; 1433 return NULL;
1598#endif
1599} 1434}
1600 1435
1601EAPI void 1436EAPI void
@@ -1613,11 +1448,6 @@ ecore_ipc_client_flush(Ecore_Ipc_Client *cl)
1613 efl_io_copier_flush(cl->socket.send_copier, EINA_TRUE, EINA_TRUE); 1448 efl_io_copier_flush(cl->socket.send_copier, EINA_TRUE, EINA_TRUE);
1614 return; 1449 return;
1615 } 1450 }
1616#ifndef EFL_NET_SERVER_UNIX_CLASS
1617 else if (!cl->client) return;
1618
1619 ecore_con_client_flush(cl->client);
1620#endif
1621} 1451}
1622 1452
1623EAPI int 1453EAPI int
@@ -1626,90 +1456,6 @@ ecore_ipc_ssl_available_get(void)
1626 return ecore_con_ssl_available_get(); 1456 return ecore_con_ssl_available_get();
1627} 1457}
1628 1458
1629#ifndef EFL_NET_SERVER_UNIX_CLASS
1630static Eina_Bool
1631_ecore_ipc_event_client_add(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
1632{
1633 Ecore_Con_Event_Client_Add *e;
1634 Ecore_Ipc_Server *svr;
1635
1636 e = ev;
1637 svr = ecore_con_server_data_get(ecore_con_client_server_get(e->client));
1638 if (!eina_list_data_find(servers, svr)) return ECORE_CALLBACK_RENEW;
1639 /* handling code here */
1640 {
1641 Ecore_Ipc_Client *cl = ecore_ipc_client_add(svr);
1642
1643 if (!cl) return ECORE_CALLBACK_CANCEL;
1644 cl->client = e->client;
1645 ecore_con_client_data_set(cl->client, (void *)cl);
1646
1647 ecore_ipc_post_event_client_add(cl);
1648 }
1649 return ECORE_CALLBACK_CANCEL;
1650}
1651
1652static Eina_Bool
1653_ecore_ipc_event_client_del(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
1654{
1655 Ecore_Con_Event_Client_Del *e;
1656 Ecore_Ipc_Server *svr;
1657
1658 e = ev;
1659 if (!e->client) return ECORE_CALLBACK_RENEW;
1660 svr = ecore_con_server_data_get(ecore_con_client_server_get(e->client));
1661 if (!eina_list_data_find(servers, svr)) return ECORE_CALLBACK_RENEW;
1662 /* handling code here */
1663 {
1664 Ecore_Ipc_Client *cl;
1665
1666 cl = ecore_con_client_data_get(e->client);
1667 if (!eina_list_data_find(svr->clients, cl)) return ECORE_CALLBACK_RENEW;
1668 cl->client = NULL;
1669
1670 ecore_ipc_post_event_client_del(cl);
1671 }
1672 return ECORE_CALLBACK_CANCEL;
1673}
1674
1675static Eina_Bool
1676_ecore_ipc_event_server_add(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
1677{
1678 Ecore_Con_Event_Server_Add *e;
1679
1680 e = ev;
1681 if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return ECORE_CALLBACK_RENEW;
1682 /* handling code here */
1683 {
1684 Ecore_Ipc_Server *svr;
1685
1686 svr = ecore_con_server_data_get(e->server);
1687
1688 ecore_ipc_post_event_server_add(svr);
1689 }
1690 return ECORE_CALLBACK_CANCEL;
1691}
1692
1693static Eina_Bool
1694_ecore_ipc_event_server_del(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
1695{
1696 Ecore_Con_Event_Server_Del *e;
1697
1698 e = ev;
1699 if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return ECORE_CALLBACK_RENEW;
1700 /* handling code here */
1701 {
1702 Ecore_Ipc_Server *svr;
1703
1704 svr = ecore_con_server_data_get(e->server);
1705 svr->legacy_server = NULL;
1706
1707 ecore_ipc_post_event_server_del(svr);
1708 }
1709 return ECORE_CALLBACK_CANCEL;
1710}
1711#endif
1712
1713#define CLSZ(_n) \ 1459#define CLSZ(_n) \
1714 md = ((head >> (4 * _n)) & 0xf); \ 1460 md = ((head >> (4 * _n)) & 0xf); \
1715 if (md >= DLT_SET) s += 4; \ 1461 if (md >= DLT_SET) s += 4; \
@@ -1902,34 +1648,6 @@ ecore_ipc_client_data_process(Ecore_Ipc_Client *cl, void *data, int size, Eina_B
1902 return ECORE_CALLBACK_CANCEL; 1648 return ECORE_CALLBACK_CANCEL;
1903} 1649}
1904 1650
1905#ifndef EFL_NET_SERVER_UNIX_CLASS
1906static Eina_Bool
1907_ecore_ipc_event_client_data(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
1908{
1909 Ecore_Con_Event_Client_Data *e;
1910 Ecore_Ipc_Server *svr;
1911
1912 e = ev;
1913 svr = ecore_con_server_data_get(ecore_con_client_server_get(e->client));
1914 if (!eina_list_data_find(servers, svr)) return ECORE_CALLBACK_RENEW;
1915 /* handling code here */
1916 {
1917 Ecore_Ipc_Client *cl;
1918 Eina_Bool stolen;
1919
1920 cl = ecore_con_client_data_get(e->client);
1921
1922 ecore_ipc_client_data_process(cl, e->data, e->size, &stolen);
1923 if (stolen)
1924 {
1925 e->data = NULL;
1926 e->size = 0;
1927 }
1928 }
1929 return ECORE_CALLBACK_CANCEL;
1930}
1931#endif
1932
1933#define SVSZ(_n) \ 1651#define SVSZ(_n) \
1934 md = ((head >> (4 * _n)) & 0xf); \ 1652 md = ((head >> (4 * _n)) & 0xf); \
1935 if (md >= DLT_SET) s += 4; \ 1653 if (md >= DLT_SET) s += 4; \
@@ -2126,33 +1844,6 @@ ecore_ipc_server_data_process(Ecore_Ipc_Server *svr, void *data, int size, Eina_
2126 return ECORE_CALLBACK_CANCEL; 1844 return ECORE_CALLBACK_CANCEL;
2127} 1845}
2128 1846
2129#ifndef EFL_NET_SERVER_UNIX_CLASS
2130static Eina_Bool
2131_ecore_ipc_event_server_data(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
2132{
2133 Ecore_Con_Event_Server_Data *e;
2134
2135 e = ev;
2136 if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server)))
2137 return ECORE_CALLBACK_RENEW;
2138 /* handling code here */
2139 {
2140 Ecore_Ipc_Server *svr;
2141 Eina_Bool stolen;
2142
2143 svr = ecore_con_server_data_get(e->server);
2144
2145 ecore_ipc_server_data_process(svr, e->data, e->size, &stolen);
2146 if (stolen)
2147 {
2148 e->data = NULL;
2149 e->size = 0;
2150 }
2151 }
2152 return ECORE_CALLBACK_CANCEL;
2153}
2154#endif
2155
2156static void 1847static void
2157_ecore_ipc_event_client_add_free(void *data EINA_UNUSED, void *ev) 1848_ecore_ipc_event_client_add_free(void *data EINA_UNUSED, void *ev)
2158{ 1849{
diff --git a/src/lib/ecore_ipc/ecore_ipc_private.h b/src/lib/ecore_ipc/ecore_ipc_private.h
index 8df059417a..9978b16143 100644
--- a/src/lib/ecore_ipc/ecore_ipc_private.h
+++ b/src/lib/ecore_ipc/ecore_ipc_private.h
@@ -74,11 +74,6 @@ struct _Ecore_Ipc_Client
74 Eo *send_copier; 74 Eo *send_copier;
75 } socket; 75 } socket;
76 76
77#ifndef EFL_NET_SERVER_UNIX_CLASS
78 /* legacy until Windows and others have their local socket */
79 Ecore_Con_Client *client;
80#endif
81
82 Ecore_Ipc_Server *svr; 77 Ecore_Ipc_Server *svr;
83 void *data; 78 void *data;
84 unsigned char *buf; 79 unsigned char *buf;
@@ -107,10 +102,6 @@ struct _Ecore_Ipc_Server
107 102
108 Eo *server; 103 Eo *server;
109 104
110#ifndef EFL_NET_SERVER_UNIX_CLASS
111 Ecore_Con_Server *legacy_server;
112#endif
113
114 Eina_List *clients; 105 Eina_List *clients;
115 void *data; 106 void *data;
116 unsigned char *buf; 107 unsigned char *buf;