From 79f1448682abd2703f4756ef6f2d330590e92b67 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sun, 16 May 2010 03:04:18 +0000 Subject: [PATCH] CEEEEEEEEEEEEEEEEEEEEEEEEDRIC! *spank* SVN revision: 48907 --- legacy/ecore/src/lib/ecore_con/Ecore_Con.h | 17 ++++++------ legacy/ecore/src/lib/ecore_con/ecore_con.c | 32 ++++++++++++++-------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h index 1fb694cd17..7061f9fcfb 100644 --- a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h +++ b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h @@ -81,14 +81,15 @@ extern "C" { typedef enum _Ecore_Con_Type { - ECORE_CON_LOCAL_USER, - ECORE_CON_LOCAL_SYSTEM, - ECORE_CON_LOCAL_ABSTRACT, - ECORE_CON_REMOTE_TCP, - ECORE_CON_REMOTE_MCAST, - ECORE_CON_REMOTE_UDP, - ECORE_CON_REMOTE_BROADCAST, - ECORE_CON_REMOTE_NODELAY, + ECORE_CON_LOCAL_USER = 0, + ECORE_CON_LOCAL_SYSTEM = 1, + ECORE_CON_LOCAL_ABSTRACT = 2, + ECORE_CON_REMOTE_TCP = 3, + ECORE_CON_REMOTE_MCAST = 4, + ECORE_CON_REMOTE_UDP = 5, + ECORE_CON_REMOTE_BROADCAST = 6, + ECORE_CON_REMOTE_NODELAY = 7, + ECORE_CON_USE_SSL2 = (1 << 4), ECORE_CON_USE_SSL3 = (1 << 5), ECORE_CON_USE_TLS = (1 << 6) diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con.c b/legacy/ecore/src/lib/ecore_con/ecore_con.c index 2e17290f22..5a912e8cb7 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con.c +++ b/legacy/ecore/src/lib/ecore_con/ecore_con.c @@ -217,24 +217,27 @@ ecore_con_server_add(Ecore_Con_Type compl_type, const char *name, int port, type = compl_type & ECORE_CON_TYPE; - if ((type == ECORE_CON_LOCAL_USER) || (type == ECORE_CON_LOCAL_SYSTEM) || + if ((type == ECORE_CON_LOCAL_USER) || + (type == ECORE_CON_LOCAL_SYSTEM) || (type == ECORE_CON_LOCAL_ABSTRACT)) { /* Local */ if (!ecore_con_local_listen(svr, _ecore_con_svr_handler, svr)) goto error; } - - if (type == ECORE_CON_REMOTE_TCP || type == ECORE_CON_REMOTE_NODELAY) + + if ((type == ECORE_CON_REMOTE_TCP) || + (type == ECORE_CON_REMOTE_NODELAY)) { /* TCP */ if (!ecore_con_info_tcp_listen(svr, _ecore_con_cb_tcp_listen, svr)) goto error; } - else if (type == ECORE_CON_REMOTE_MCAST || type == ECORE_CON_REMOTE_UDP) + else if ((type == ECORE_CON_REMOTE_MCAST) || + (type == ECORE_CON_REMOTE_UDP)) { /* UDP and MCAST */ if (!ecore_con_info_udp_listen(svr, _ecore_con_cb_udp_listen, svr)) goto error; } - + servers = eina_list_append(servers, svr); ECORE_MAGIC_SET(svr, ECORE_MAGIC_CON_SERVER); @@ -308,22 +311,29 @@ ecore_con_server_connect(Ecore_Con_Type compl_type, const char *name, int port, type = compl_type & ECORE_CON_TYPE; - if ((type == ECORE_CON_REMOTE_TCP || type == ECORE_CON_REMOTE_NODELAY - || type == ECORE_CON_REMOTE_UDP || ECORE_CON_REMOTE_BROADCAST) && (port < 0)) return NULL; - - if ((type == ECORE_CON_LOCAL_USER) || (type == ECORE_CON_LOCAL_SYSTEM) || + if (((type == ECORE_CON_REMOTE_TCP) || + (type == ECORE_CON_REMOTE_NODELAY) || + (type == ECORE_CON_REMOTE_UDP) || + (type == ECORE_CON_REMOTE_BROADCAST)) && + (port < 0)) + goto error; + + if ((type == ECORE_CON_LOCAL_USER) || + (type == ECORE_CON_LOCAL_SYSTEM) || (type == ECORE_CON_LOCAL_ABSTRACT)) { /* Local */ if (!ecore_con_local_connect(svr, _ecore_con_cl_handler, svr, _ecore_con_event_server_add_free)) goto error; } - if (type == ECORE_CON_REMOTE_TCP || type == ECORE_CON_REMOTE_NODELAY) + if ((type == ECORE_CON_REMOTE_TCP) || + (type == ECORE_CON_REMOTE_NODELAY)) { /* TCP */ if (!ecore_con_info_tcp_connect(svr, _ecore_con_cb_tcp_connect, svr)) goto error; } - else if (type == ECORE_CON_REMOTE_UDP || type == ECORE_CON_REMOTE_BROADCAST) + else if ((type == ECORE_CON_REMOTE_UDP) || + (type == ECORE_CON_REMOTE_BROADCAST)) { /* UDP and MCAST */ if (!ecore_con_info_udp_connect(svr, _ecore_con_cb_udp_connect, svr)) goto error;