summaryrefslogtreecommitdiff
path: root/legacy/ecore/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-06-04 09:03:04 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-06-04 09:03:04 +0000
commitf472e919e287d2efe09fc2edd7316877a2cb1d28 (patch)
treecb52cd35c8ae45758c7d233893af38e345aad170 /legacy/ecore/src
parent9dc6c51fa0420f21d5de65971e4060fabdd6e1e8 (diff)
add ECORE_{CON,IPC}_NO_PROXY flag to disable proxying on specified connections
SVN revision: 71681
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_con/Ecore_Con.h7
-rw-r--r--legacy/ecore/src/lib/ecore_con/ecore_con.c3
-rw-r--r--legacy/ecore/src/lib/ecore_con/ecore_con_private.h3
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h3
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c10
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h3
6 files changed, 21 insertions, 8 deletions
diff --git a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h
index 7fe84951f9..e706df303f 100644
--- a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h
+++ b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h
@@ -653,7 +653,12 @@ typedef enum _Ecore_Con_Type
653 /** Use both TLS and SSL3 */ 653 /** Use both TLS and SSL3 */
654 ECORE_CON_USE_MIXED = ECORE_CON_USE_SSL3 | ECORE_CON_USE_TLS, 654 ECORE_CON_USE_MIXED = ECORE_CON_USE_SSL3 | ECORE_CON_USE_TLS,
655 /** Attempt to use the loaded certificate */ 655 /** Attempt to use the loaded certificate */
656 ECORE_CON_LOAD_CERT = (1 << 7) 656 ECORE_CON_LOAD_CERT = (1 << 7),
657 /** Disable all types of proxy on the server
658 * @note Only functional for clients
659 * @since 1.2
660 */
661 ECORE_CON_NO_PROXY = (1 << 8)
657} Ecore_Con_Type; 662} Ecore_Con_Type;
658 663
659/** 664/**
diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con.c b/legacy/ecore/src/lib/ecore_con/ecore_con.c
index 5ba6624b44..c327873f1e 100644
--- a/legacy/ecore/src/lib/ecore_con/ecore_con.c
+++ b/legacy/ecore/src/lib/ecore_con/ecore_con.c
@@ -448,13 +448,14 @@ ecore_con_server_connect(Ecore_Con_Type compl_type,
448 svr->data = (void *)data; 448 svr->data = (void *)data;
449 svr->created = EINA_FALSE; 449 svr->created = EINA_FALSE;
450 svr->use_cert = (compl_type & ECORE_CON_SSL & ECORE_CON_LOAD_CERT) == ECORE_CON_LOAD_CERT; 450 svr->use_cert = (compl_type & ECORE_CON_SSL & ECORE_CON_LOAD_CERT) == ECORE_CON_LOAD_CERT;
451 svr->disable_proxy = (compl_type & ECORE_CON_SSL & ECORE_CON_NO_PROXY) == ECORE_CON_NO_PROXY;
451 svr->reject_excess_clients = EINA_FALSE; 452 svr->reject_excess_clients = EINA_FALSE;
452 svr->clients = NULL; 453 svr->clients = NULL;
453 svr->client_limit = -1; 454 svr->client_limit = -1;
454 455
455 type = compl_type & ECORE_CON_TYPE; 456 type = compl_type & ECORE_CON_TYPE;
456 457
457 if (type > ECORE_CON_LOCAL_ABSTRACT) 458 if ((!svr->disable_proxy) && (type > ECORE_CON_LOCAL_ABSTRACT))
458 { 459 {
459 /* never use proxies on local connections */ 460 /* never use proxies on local connections */
460 if (_ecore_con_proxy_once) 461 if (_ecore_con_proxy_once)
diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con_private.h b/legacy/ecore/src/lib/ecore_con/ecore_con_private.h
index e3b9adb830..4f8fd36521 100644
--- a/legacy/ecore/src/lib/ecore_con/ecore_con_private.h
+++ b/legacy/ecore/src/lib/ecore_con/ecore_con_private.h
@@ -9,7 +9,7 @@
9#define ECORE_MAGIC_CON_URL 0x77074255 9#define ECORE_MAGIC_CON_URL 0x77074255
10 10
11#define ECORE_CON_TYPE 0x0f 11#define ECORE_CON_TYPE 0x0f
12#define ECORE_CON_SSL 0xf0 12#define ECORE_CON_SSL 0xf00
13 13
14#if USE_GNUTLS 14#if USE_GNUTLS
15# include <gnutls/gnutls.h> 15# include <gnutls/gnutls.h>
@@ -179,6 +179,7 @@ struct _Ecore_Con_Server
179 Eina_Bool connecting : 1; /* @c EINA_FALSE if just initialized or connected */ 179 Eina_Bool connecting : 1; /* @c EINA_FALSE if just initialized or connected */
180 Eina_Bool handshaking : 1; /* @c EINA_TRUE if server is ssl handshaking */ 180 Eina_Bool handshaking : 1; /* @c EINA_TRUE if server is ssl handshaking */
181 Eina_Bool upgrade : 1; /* STARTTLS queued */ 181 Eina_Bool upgrade : 1; /* STARTTLS queued */
182 Eina_Bool disable_proxy : 1; /* proxy should never be used with this connection */
182 Eina_Bool ssl_prepared : 1; 183 Eina_Bool ssl_prepared : 1;
183 Eina_Bool use_cert : 1; /* @c EINA_TRUE if using certificate auth */ 184 Eina_Bool use_cert : 1; /* @c EINA_TRUE if using certificate auth */
184 Ecore_Con_Ssl_State ssl_state; /* current state of ssl handshake on the server */ 185 Ecore_Con_Ssl_State ssl_state; /* current state of ssl handshake on the server */
diff --git a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
index 999340328f..f77870f84d 100644
--- a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
+++ b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
@@ -222,7 +222,8 @@ typedef enum _Ecore_Ipc_Type
222 ECORE_IPC_LOCAL_USER, 222 ECORE_IPC_LOCAL_USER,
223 ECORE_IPC_LOCAL_SYSTEM, 223 ECORE_IPC_LOCAL_SYSTEM,
224 ECORE_IPC_REMOTE_SYSTEM, 224 ECORE_IPC_REMOTE_SYSTEM,
225 ECORE_IPC_USE_SSL = 16 225 ECORE_IPC_USE_SSL = (1 << 4),
226 ECORE_IPC_NO_PROXY = (1 << 5)
226} Ecore_Ipc_Type; 227} Ecore_Ipc_Type;
227 228
228typedef struct _Ecore_Ipc_Event_Client_Add Ecore_Ipc_Event_Client_Add; 229typedef struct _Ecore_Ipc_Event_Client_Add Ecore_Ipc_Event_Client_Add;
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
index 54ee3ad053..339ca5a218 100644
--- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
+++ b/legacy/ecore/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
412 Ecore_Ipc_Server *svr; 412 Ecore_Ipc_Server *svr;
413 Ecore_Ipc_Type type; 413 Ecore_Ipc_Type type;
414 Ecore_Con_Type extra = 0; 414 Ecore_Con_Type extra = 0;
415 int features;
415 416
416 svr = calloc(1, sizeof(Ecore_Ipc_Server)); 417 svr = calloc(1, sizeof(Ecore_Ipc_Server));
417 if (!svr) return NULL; 418 if (!svr) return NULL;
418 type = compl_type; 419 type = compl_type & ECORE_IPC_TYPE;
419 type &= ~ECORE_IPC_USE_SSL; 420 features = compl_type & ECORE_IPC_SSL;
420 if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL; 421 if ((features & ECORE_IPC_USE_SSL) == ECORE_IPC_USE_SSL)
422 extra |= ECORE_CON_USE_SSL;
423 if ((features & ECORE_IPC_NO_PROXY) == ECORE_IPC_NO_PROXY)
424 extra |= ECORE_CON_NO_PROXY;
421 switch (type) 425 switch (type)
422 { 426 {
423 case ECORE_IPC_LOCAL_USER: 427 case ECORE_IPC_LOCAL_USER:
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
index 57f784976d..d8c663c95d 100644
--- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
+++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
@@ -38,7 +38,8 @@ extern int _ecore_ipc_log_dom;
38#define ECORE_MAGIC_IPC_CLIENT 0x78875665 38#define ECORE_MAGIC_IPC_CLIENT 0x78875665
39 39
40typedef struct _Ecore_Ipc_Msg_Head Ecore_Ipc_Msg_Head; 40typedef struct _Ecore_Ipc_Msg_Head Ecore_Ipc_Msg_Head;
41 41#define ECORE_IPC_TYPE 0x0f
42#define ECORE_IPC_SSL 0xf0
42 43
43#if defined (_MSC_VER) || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100) 44#if defined (_MSC_VER) || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100)
44# pragma pack(1) 45# pragma pack(1)