summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2017-07-26 18:48:45 -0300
committerStefan Schmidt <stefan@osg.samsung.com>2017-07-27 16:54:34 +0200
commit45a767632d417043936622f78597c06dc7a8cf94 (patch)
treeeea5357c87b853acba29e2ab82dd592642b57dbf /src/lib/ecore_con
parent97f6803be14212c8b5fb70071e312cf1e51f8fe5 (diff)
Ecore_Conn: Enable CLOEXEC by default.
This flag should be enabled by default in order to avoid socket leaks.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/ecore_con_legacy.c3
-rw-r--r--src/lib/ecore_con/efl_net_server_fd.c1
-rw-r--r--src/lib/ecore_con/efl_net_server_fd.eo2
-rw-r--r--src/lib/ecore_con/efl_net_server_ssl.eo2
4 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/ecore_con/ecore_con_legacy.c b/src/lib/ecore_con/ecore_con_legacy.c
index 35cdef87cd..1cb007f8b1 100644
--- a/src/lib/ecore_con/ecore_con_legacy.c
+++ b/src/lib/ecore_con/ecore_con_legacy.c
@@ -1496,11 +1496,9 @@ _ecore_con_server_server_set(Ecore_Con_Server *svr, Eo *server)
1496 1496
1497 if (efl_isa(inner_server, EFL_NET_SERVER_FD_CLASS)) 1497 if (efl_isa(inner_server, EFL_NET_SERVER_FD_CLASS))
1498 { 1498 {
1499 efl_net_server_fd_close_on_exec_set(inner_server, EINA_TRUE);
1500 efl_net_server_fd_reuse_address_set(inner_server, EINA_TRUE); 1499 efl_net_server_fd_reuse_address_set(inner_server, EINA_TRUE);
1501 efl_net_server_fd_reuse_port_set(inner_server, EINA_TRUE); 1500 efl_net_server_fd_reuse_port_set(inner_server, EINA_TRUE);
1502 } 1501 }
1503
1504 if (efl_isa(inner_server, EFL_NET_SERVER_TCP_CLASS)) 1502 if (efl_isa(inner_server, EFL_NET_SERVER_TCP_CLASS))
1505 { 1503 {
1506 /* old ecore_con did not map ipv4 to ipv6... */ 1504 /* old ecore_con did not map ipv4 to ipv6... */
@@ -1516,7 +1514,6 @@ _ecore_con_server_server_set(Ecore_Con_Server *svr, Eo *server)
1516 { 1514 {
1517 /* old ecore_con did not map ipv4 to ipv6... */ 1515 /* old ecore_con did not map ipv4 to ipv6... */
1518 efl_net_server_ssl_ipv6_only_set(inner_server, EINA_TRUE); 1516 efl_net_server_ssl_ipv6_only_set(inner_server, EINA_TRUE);
1519 efl_net_server_ssl_close_on_exec_set(inner_server, EINA_TRUE);
1520 efl_net_server_ssl_reuse_address_set(inner_server, EINA_TRUE); 1517 efl_net_server_ssl_reuse_address_set(inner_server, EINA_TRUE);
1521 efl_net_server_ssl_reuse_port_set(inner_server, EINA_TRUE); 1518 efl_net_server_ssl_reuse_port_set(inner_server, EINA_TRUE);
1522 } 1519 }
diff --git a/src/lib/ecore_con/efl_net_server_fd.c b/src/lib/ecore_con/efl_net_server_fd.c
index 03448ec856..f1ff38bd77 100644
--- a/src/lib/ecore_con/efl_net_server_fd.c
+++ b/src/lib/ecore_con/efl_net_server_fd.c
@@ -100,6 +100,7 @@ EOLIAN static Efl_Object *
100_efl_net_server_fd_efl_object_constructor(Eo *o, Efl_Net_Server_Fd_Data *pd) 100_efl_net_server_fd_efl_object_constructor(Eo *o, Efl_Net_Server_Fd_Data *pd)
101{ 101{
102 pd->family = AF_UNSPEC; 102 pd->family = AF_UNSPEC;
103 pd->close_on_exec = EINA_TRUE;
103 return efl_constructor(efl_super(o, MY_CLASS)); 104 return efl_constructor(efl_super(o, MY_CLASS));
104} 105}
105 106
diff --git a/src/lib/ecore_con/efl_net_server_fd.eo b/src/lib/ecore_con/efl_net_server_fd.eo
index 0b3f55df98..6f3ab66332 100644
--- a/src/lib/ecore_con/efl_net_server_fd.eo
+++ b/src/lib/ecore_con/efl_net_server_fd.eo
@@ -71,7 +71,7 @@ class Efl.Net.Server.Fd (Efl.Loop.Fd, Efl.Net.Server) {
71 @property close_on_exec { 71 @property close_on_exec {
72 [[Controls Close-on-Exec() using FD_CLOEXEC. 72 [[Controls Close-on-Exec() using FD_CLOEXEC.
73 73
74 Children socket will inherit the server's setting by 74 Children socket will not inherit the server's setting by
75 default. One can change the behavior using each instance 75 default. One can change the behavior using each instance
76 @Efl.Io.Closer.close_on_exec.set. 76 @Efl.Io.Closer.close_on_exec.set.
77 ]] 77 ]]
diff --git a/src/lib/ecore_con/efl_net_server_ssl.eo b/src/lib/ecore_con/efl_net_server_ssl.eo
index d34e2df909..594104d1b7 100644
--- a/src/lib/ecore_con/efl_net_server_ssl.eo
+++ b/src/lib/ecore_con/efl_net_server_ssl.eo
@@ -71,7 +71,7 @@ class Efl.Net.Server.Ssl (Efl.Loop_User, Efl.Net.Server) {
71 @property close_on_exec { 71 @property close_on_exec {
72 [[Controls Close-on-Exec() using FD_CLOEXEC. 72 [[Controls Close-on-Exec() using FD_CLOEXEC.
73 73
74 Children socket will inherit the server's setting by 74 Children socket will not inherit the server's setting by
75 default. One can change the behavior using each instance 75 default. One can change the behavior using each instance
76 @Efl.Io.Closer.close_on_exec.set. 76 @Efl.Io.Closer.close_on_exec.set.
77 ]] 77 ]]