use client_kill instead of directly eventing

SVN revision: 67322
This commit is contained in:
Mike Blumenkrantz 2012-01-19 08:02:41 +00:00
parent e37d4495d3
commit 1f35fa8b95
3 changed files with 9 additions and 15 deletions

View File

@ -45,7 +45,6 @@
static Eina_Bool _ecore_con_client_timer(Ecore_Con_Client *cl); static Eina_Bool _ecore_con_client_timer(Ecore_Con_Client *cl);
static void _ecore_con_cl_timer_update(Ecore_Con_Client *cl); static void _ecore_con_cl_timer_update(Ecore_Con_Client *cl);
static void _ecore_con_client_kill(Ecore_Con_Client *cl);
static Eina_Bool _ecore_con_server_timer(Ecore_Con_Server *svr); static Eina_Bool _ecore_con_server_timer(Ecore_Con_Server *svr);
static void _ecore_con_server_timer_update(Ecore_Con_Server *svr); static void _ecore_con_server_timer_update(Ecore_Con_Server *svr);
@ -105,7 +104,7 @@ static void _ecore_con_lookup_done(void *data,
static const char * _ecore_con_pretty_ip(struct sockaddr *client_addr); static const char * _ecore_con_pretty_ip(struct sockaddr *client_addr);
static void void
_ecore_con_client_kill(Ecore_Con_Client *cl) _ecore_con_client_kill(Ecore_Con_Client *cl)
{ {
if (cl->delete_me) if (cl->delete_me)

View File

@ -75,8 +75,7 @@ _ecore_con_local_win32_server_read_client_handler(void *data, Ecore_Win32_Handle
free(msg); free(msg);
} }
#endif #endif
if (!cl->delete_me) _ecore_con_client_kill(cl);
ecore_con_event_client_del(cl);
return ECORE_CALLBACK_CANCEL; return ECORE_CALLBACK_CANCEL;
} }
@ -109,8 +108,7 @@ _ecore_con_local_win32_server_peek_client_handler(void *data, Ecore_Win32_Handle
free(msg); free(msg);
} }
#endif #endif
if (!cl->host_server->delete_me) _ecore_con_server_kill(cl->host_server);
ecore_con_event_server_del(cl->host_server);
return ECORE_CALLBACK_CANCEL; return ECORE_CALLBACK_CANCEL;
ecore_main_win32_handler_del(wh); ecore_main_win32_handler_del(wh);
@ -138,8 +136,7 @@ _ecore_con_local_win32_client_peek_server_handler(void *data, Ecore_Win32_Handle
free(msg); free(msg);
} }
#endif #endif
if (!svr->delete_me) _ecore_con_server_kill(svr);
ecore_con_event_server_del(svr);
return ECORE_CALLBACK_CANCEL; return ECORE_CALLBACK_CANCEL;
ecore_main_win32_handler_del(wh); ecore_main_win32_handler_del(wh);
@ -188,8 +185,7 @@ _ecore_con_local_win32_client_read_server_handler(void *data, Ecore_Win32_Handle
free(msg); free(msg);
} }
#endif #endif
if (!svr->delete_me) _ecore_con_server_kill(svr);
ecore_con_event_server_del(svr);
return ECORE_CALLBACK_CANCEL; return ECORE_CALLBACK_CANCEL;
} }
@ -691,15 +687,14 @@ ecore_con_local_win32_server_flush(Ecore_Con_Server *svr)
ecore_con_event_server_error(svr, msg); ecore_con_event_server_error(svr, msg);
free(msg); free(msg);
} }
if (!svr->delete_me) _ecore_con_server_kill(svr);
ecore_con_event_server_del(svr);
} }
svr->write_buf_offset += written; svr->write_buf_offset += written;
if (svr->write_buf_offset >= eina_binbuf_length_get(svr->buf)) if (svr->write_buf_offset >= eina_binbuf_length_get(svr->buf))
{ {
svr->write_buf_offset = 0; svr->write_buf_offset = 0;
eina_binbuf_free(svr->buf); eina_binbuf_free(svr->buf);
svr->buf = NULL; svr->buf = NULL;
svr->want_write = 0; svr->want_write = 0;
} }
@ -741,8 +736,7 @@ ecore_con_local_win32_client_flush(Ecore_Con_Client *cl)
ecore_con_event_client_error(cl, msg); ecore_con_event_client_error(cl, msg);
free(msg); free(msg);
} }
if (!cl->delete_me) _ecore_con_client_kill(cl);
ecore_con_event_client_del(cl);
} }
cl->buf_offset += written; cl->buf_offset += written;

View File

@ -291,6 +291,7 @@ void ecore_con_event_client_data(Ecore_Con_Client *cl, unsigned char *buf, int n
void ecore_con_event_client_del(Ecore_Con_Client *cl); void ecore_con_event_client_del(Ecore_Con_Client *cl);
void ecore_con_event_client_error(Ecore_Con_Client *cl, const char *error); void ecore_con_event_client_error(Ecore_Con_Client *cl, const char *error);
void _ecore_con_server_kill(Ecore_Con_Server *svr); void _ecore_con_server_kill(Ecore_Con_Server *svr);
void _ecore_con_client_kill(Ecore_Con_Client *cl);
/* from ecore_local_win32.c */ /* from ecore_local_win32.c */
#ifdef _WIN32 #ifdef _WIN32
Eina_Bool ecore_con_local_listen(Ecore_Con_Server *svr); Eina_Bool ecore_con_local_listen(Ecore_Con_Server *svr);