From 8a9d69e62e86748c8d7fea3cde30609c0b97d551 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Mon, 4 Jun 2012 09:03:04 +0000 Subject: [PATCH] add ECORE_{CON,IPC}_NO_PROXY flag to disable proxying on specified connections git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@71681 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 4 ++++ NEWS | 8 ++++---- src/lib/ecore_con/Ecore_Con.h | 7 ++++++- src/lib/ecore_con/ecore_con.c | 3 ++- src/lib/ecore_con/ecore_con_private.h | 3 ++- src/lib/ecore_ipc/Ecore_Ipc.h | 3 ++- src/lib/ecore_ipc/ecore_ipc.c | 10 +++++++--- src/lib/ecore_ipc/ecore_ipc_private.h | 3 ++- 8 files changed, 29 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ab9361..4a24452 100644 --- a/ChangeLog +++ b/ChangeLog @@ -702,3 +702,7 @@ 2012-05-30 Leif Middelschulte (T_UNIX) * Add ECORE_X_RANDR_OUTPUT_POLICY_ASK + +2012-06-04 Mike Blumenkrantz + + * ECORE_{CON,IPC}_NO_PROXY now available for disabling proxying on certain connections diff --git a/NEWS b/NEWS index e0caaa2..5e638f4 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,10 @@ Additions: - Add transparency support on Windows (GDI engine only) * ecore_x: - Add Ecore_X_Error_Code enumeration + * ecore_x: + - ECORE_X_RANDR_OUTPUT_POLICY_ASK + * ecore_con: + - ECORE_{CON,IPC}_NO_PROXY now available for disabling proxying on certain connections Fixes: * ecore @@ -18,10 +22,6 @@ Fixes: - Force cancel of all running Ecore_Thread on shutdown. - Make Ecore_Thread work reliably when called without a running main loop. -Additions: - - * ecore_x: - - ECORE_X_RANDR_OUTPUT_POLICY_ASK Ecore 1.2.0 diff --git a/src/lib/ecore_con/Ecore_Con.h b/src/lib/ecore_con/Ecore_Con.h index 7fe8495..e706df3 100644 --- a/src/lib/ecore_con/Ecore_Con.h +++ b/src/lib/ecore_con/Ecore_Con.h @@ -653,7 +653,12 @@ typedef enum _Ecore_Con_Type /** Use both TLS and SSL3 */ ECORE_CON_USE_MIXED = ECORE_CON_USE_SSL3 | ECORE_CON_USE_TLS, /** Attempt to use the loaded certificate */ - ECORE_CON_LOAD_CERT = (1 << 7) + ECORE_CON_LOAD_CERT = (1 << 7), + /** Disable all types of proxy on the server + * @note Only functional for clients + * @since 1.2 + */ + ECORE_CON_NO_PROXY = (1 << 8) } Ecore_Con_Type; /** diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c index 5ba6624..c327873 100644 --- a/src/lib/ecore_con/ecore_con.c +++ b/src/lib/ecore_con/ecore_con.c @@ -448,13 +448,14 @@ ecore_con_server_connect(Ecore_Con_Type compl_type, svr->data = (void *)data; svr->created = EINA_FALSE; svr->use_cert = (compl_type & ECORE_CON_SSL & ECORE_CON_LOAD_CERT) == ECORE_CON_LOAD_CERT; + svr->disable_proxy = (compl_type & ECORE_CON_SSL & ECORE_CON_NO_PROXY) == ECORE_CON_NO_PROXY; svr->reject_excess_clients = EINA_FALSE; svr->clients = NULL; svr->client_limit = -1; type = compl_type & ECORE_CON_TYPE; - if (type > ECORE_CON_LOCAL_ABSTRACT) + if ((!svr->disable_proxy) && (type > ECORE_CON_LOCAL_ABSTRACT)) { /* never use proxies on local connections */ if (_ecore_con_proxy_once) diff --git a/src/lib/ecore_con/ecore_con_private.h b/src/lib/ecore_con/ecore_con_private.h index e3b9adb..4f8fd36 100644 --- a/src/lib/ecore_con/ecore_con_private.h +++ b/src/lib/ecore_con/ecore_con_private.h @@ -9,7 +9,7 @@ #define ECORE_MAGIC_CON_URL 0x77074255 #define ECORE_CON_TYPE 0x0f -#define ECORE_CON_SSL 0xf0 +#define ECORE_CON_SSL 0xf00 #if USE_GNUTLS # include @@ -179,6 +179,7 @@ struct _Ecore_Con_Server Eina_Bool connecting : 1; /* @c EINA_FALSE if just initialized or connected */ Eina_Bool handshaking : 1; /* @c EINA_TRUE if server is ssl handshaking */ Eina_Bool upgrade : 1; /* STARTTLS queued */ + Eina_Bool disable_proxy : 1; /* proxy should never be used with this connection */ Eina_Bool ssl_prepared : 1; Eina_Bool use_cert : 1; /* @c EINA_TRUE if using certificate auth */ Ecore_Con_Ssl_State ssl_state; /* current state of ssl handshake on the server */ diff --git a/src/lib/ecore_ipc/Ecore_Ipc.h b/src/lib/ecore_ipc/Ecore_Ipc.h index 9993403..f77870f 100644 --- a/src/lib/ecore_ipc/Ecore_Ipc.h +++ b/src/lib/ecore_ipc/Ecore_Ipc.h @@ -222,7 +222,8 @@ typedef enum _Ecore_Ipc_Type ECORE_IPC_LOCAL_USER, ECORE_IPC_LOCAL_SYSTEM, ECORE_IPC_REMOTE_SYSTEM, - ECORE_IPC_USE_SSL = 16 + ECORE_IPC_USE_SSL = (1 << 4), + ECORE_IPC_NO_PROXY = (1 << 5) } Ecore_Ipc_Type; typedef struct _Ecore_Ipc_Event_Client_Add Ecore_Ipc_Event_Client_Add; diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c index 54ee3ad..339ca5a 100644 --- a/src/lib/ecore_ipc/ecore_ipc.c +++ b/src/lib/ecore_ipc/ecore_ipc.c @@ -412,12 +412,16 @@ ecore_ipc_server_connect(Ecore_Ipc_Type compl_type, char *name, int port, const Ecore_Ipc_Server *svr; Ecore_Ipc_Type type; Ecore_Con_Type extra = 0; + int features; svr = calloc(1, sizeof(Ecore_Ipc_Server)); if (!svr) return NULL; - type = compl_type; - type &= ~ECORE_IPC_USE_SSL; - if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL; + type = compl_type & ECORE_IPC_TYPE; + features = compl_type & ECORE_IPC_SSL; + if ((features & ECORE_IPC_USE_SSL) == ECORE_IPC_USE_SSL) + extra |= ECORE_CON_USE_SSL; + if ((features & ECORE_IPC_NO_PROXY) == ECORE_IPC_NO_PROXY) + extra |= ECORE_CON_NO_PROXY; switch (type) { case ECORE_IPC_LOCAL_USER: diff --git a/src/lib/ecore_ipc/ecore_ipc_private.h b/src/lib/ecore_ipc/ecore_ipc_private.h index 57f7849..d8c663c 100644 --- a/src/lib/ecore_ipc/ecore_ipc_private.h +++ b/src/lib/ecore_ipc/ecore_ipc_private.h @@ -38,7 +38,8 @@ extern int _ecore_ipc_log_dom; #define ECORE_MAGIC_IPC_CLIENT 0x78875665 typedef struct _Ecore_Ipc_Msg_Head Ecore_Ipc_Msg_Head; - +#define ECORE_IPC_TYPE 0x0f +#define ECORE_IPC_SSL 0xf0 #if defined (_MSC_VER) || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100) # pragma pack(1) -- 2.7.4