From 7bbd7e16c404d33eb727f2d9022f9ea25e9415ee Mon Sep 17 00:00:00 2001 From: discomfitor Date: Tue, 13 Mar 2012 13:44:18 +0000 Subject: [PATCH] update client flush properly, fixing bug spotted by raoulh git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@69296 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_con/ecore_con.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c index 99c4707..fe83478 100644 --- a/src/lib/ecore_con/ecore_con.c +++ b/src/lib/ecore_con/ecore_con.c @@ -2274,7 +2274,7 @@ _ecore_con_server_flush(Ecore_Con_Server *svr) static void _ecore_con_client_flush(Ecore_Con_Client *cl) { - int num, count = 0; + int num = 0, count = 0; #ifdef _WIN32 if (ecore_con_local_win32_client_flush(cl)) @@ -2317,7 +2317,7 @@ _ecore_con_client_flush(Ecore_Con_Client *cl) } if (count) ecore_con_event_client_write(cl, count); - cl->buf_offset += count; + cl->buf_offset += count, num -= count; if (cl->buf_offset >= eina_binbuf_length_get(cl->buf)) { cl->buf_offset = 0; @@ -2335,7 +2335,7 @@ _ecore_con_client_flush(Ecore_Con_Client *cl) if (cl->fd_handler) ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_READ); } - else if ((count < num) && cl->fd_handler) + else if (cl->fd_handler && (num >= 0)) ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_WRITE); } -- 2.7.4