cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9c571f01f7af8db1df238daa3136bf639247ac55

commit 9c571f01f7af8db1df238daa3136bf639247ac55
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Thu May 14 18:19:57 2015 +0200

    ecore_con: it doesn't make sense to get port on local protocol.
---
 src/lib/ecore_con/ecore_con.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c
index 3e6ad7a..dee26e1 100644
--- a/src/lib/ecore_con/ecore_con.c
+++ b/src/lib/ecore_con/ecore_con.c
@@ -955,6 +955,15 @@ ecore_con_client_ip_get(const Ecore_Con *obj)
 EOLIAN static int
 _ecore_con_client_ecore_con_base_port_get(Eo *obj EINA_UNUSED, 
Ecore_Con_Client_Data *cl)
 {
+   Ecore_Con_Server_Data *sd = eo_data_scope_get(cl->host_server, 
ECORE_CON_SERVER_CLASS);
+
+   if (sd->type != ECORE_CON_REMOTE_TCP &&
+       sd->type != ECORE_CON_REMOTE_MCAST &&
+       sd->type != ECORE_CON_REMOTE_UDP &&
+       sd->type != ECORE_CON_REMOTE_BROADCAST &&
+       sd->type != ECORE_CON_REMOTE_NODELAY)
+     return -1;
+
    if (cl->client_addr->sa_family == AF_INET)
      return ((struct sockaddr_in *)cl->client_addr)->sin_port;
 #ifdef HAVE_IPV6

-- 


Reply via email to