ecore con: Fix UDP sockets.
authorChidambar Zinnoury <chidambar.zinnoury@zefla.fr>
Fri, 20 Nov 2015 16:46:38 +0000 (17:46 +0100)
committerChidambar Zinnoury <chidambar.zinnoury@zefla.fr>
Fri, 20 Nov 2015 16:46:38 +0000 (17:46 +0100)
 The client structure holds a file descriptor, which is not initialized (which means 0) in case of UDP as there is no client-specific socket.

 However, we check for the file descriptor being positive before closing it in the client destructor, which means that we actually end up closing the 0 file descriptor.

 That means that things were going crazy with real strange things happening afterwards…

src/lib/ecore_con/ecore_con.c

index 1582c26..5a2736f 100644 (file)
@@ -2360,6 +2360,7 @@ _ecore_con_svr_udp_handler(void *data,
    EINA_SAFETY_ON_NULL_RETURN_VAL(cl, ECORE_CALLBACK_RENEW);
 
    cl->host_server = svr_obj;
+   cl->fd = -1;
    cl->client_addr = malloc(client_addr_len);
    if (!cl->client_addr)
      {