fix writes/flushes with servers for ecore-con
authorMike Blumenkrantz <m.blumenkran@samsung.com>
Thu, 14 Mar 2013 11:48:05 +0000 (11:48 +0000)
committerMike Blumenkrantz <m.blumenkran@samsung.com>
Thu, 14 Mar 2013 11:48:05 +0000 (11:48 +0000)
ChangeLog
NEWS
src/lib/ecore_con/ecore_con.c

index 27019c6..76f31dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-14  Mike Blumenkrantz
+
+        * fix use of ecore_con_*_flush functions with unconnected objects
+        * fix setting of write flags on ecore-con servers during connect
+
 2013-03-13  Cedric Bail
 
        * Edje: use Eina_Cow to reduce memory usage.
diff --git a/NEWS b/NEWS
index d8785c1..ea4a824 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -197,3 +197,5 @@ Fixes:
     * fix bug scroll works when PgDn, PgUp, Home, End key in entry is pressed in preedit state
     * clean up gnutls session initialization
     * fix bug not check data value when get deiconify message
+    * fix use of ecore_con_*_flush functions with unconnected objects
+    * fix setting of write flags on ecore-con servers during connect
index b4da457..3947e7e 100644 (file)
@@ -1821,8 +1821,13 @@ svr_try_connect_plain(Ecore_Con_Server *svr)
            ecore_con_event_server_add(svr);
      }
 
-   if (svr->fd_handler && (!svr->buf))
-     ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ);
+   if (svr->fd_handler)
+     {
+        if (svr->buf)
+          ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_WRITE);
+        else
+          ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ);
+     }
 
    if (!svr->delete_me)
      return ECORE_CON_CONNECTED;
@@ -2258,12 +2263,13 @@ _ecore_con_server_flush(Ecore_Con_Server *svr)
    Eina_Binbuf *buf_p;
 
    DBG("(svr=%p,buf=%p)", svr, svr->buf);
+   if (!svr->fd_handler) return;
 #ifdef _WIN32
    if (ecore_con_local_win32_server_flush(svr))
      return;
 #endif
 
-   if ((!svr->buf) && (!svr->ecs_buf) && svr->fd_handler)
+   if ((!svr->buf) && (!svr->ecs_buf))
      {
         ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ);
         return;
@@ -2361,12 +2367,13 @@ _ecore_con_client_flush(Ecore_Con_Client *cl)
 {
    int num = 0, count = 0;
 
+   if (!cl->fd_handler) return;
 #ifdef _WIN32
    if (ecore_con_local_win32_client_flush(cl))
      return;
 #endif
 
-   if (!cl->buf && cl->fd_handler)
+   if (!cl->buf)
      {
         ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_READ);
         return;