kuri pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=503e7a5b03d12d6d50a81d829383fb866763143c
commit 503e7a5b03d12d6d50a81d829383fb866763143c Author: Nicolas Aguirre <[email protected]> Date: Fri Jan 3 18:57:56 2014 +0100 ecore_con - Fix binary buffer when using ECORE_CON_REMOTE_UDP. ERR<7807>: lib/eina/eina_binbuf_template_c.x:95 eina_binbuf_append_length() *** Eina Magic Check Failed !!! This fix a problem where eina_binbuf was used without calling eina_binbuf_new when ECORE_CON_REMOTE_UDP is used. --- src/lib/ecore_con/ecore_con.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c index 33f6f77..5813956 100644 --- a/src/lib/ecore_con/ecore_con.c +++ b/src/lib/ecore_con/ecore_con.c @@ -799,22 +799,24 @@ ecore_con_client_send(Ecore_Con_Client *cl, if (cl->host_server && ((cl->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_UDP)) sendto(cl->host_server->fd, data, size, 0, (struct sockaddr *)cl->client_addr, cl->client_addr_len); - else if (!cl->buf) + else { - cl->buf = eina_binbuf_new(); - EINA_SAFETY_ON_NULL_RETURN_VAL(cl->buf, 0); -#ifdef TCP_CORK - if ((cl->fd >= 0) && ((cl->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK)) + if (!cl->buf) { - int state = 1; - if (setsockopt(cl->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0) - /* realistically this isn't anything serious so we can just log and continue */ - ERR("corking failed! %s", strerror(errno)); - } + cl->buf = eina_binbuf_new(); + EINA_SAFETY_ON_NULL_RETURN_VAL(cl->buf, 0); +#ifdef TCP_CORK + if ((cl->fd >= 0) && ((cl->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK)) + { + int state = 1; + if (setsockopt(cl->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0) + /* realistically this isn't anything serious so we can just log and continue */ + ERR("corking failed! %s", strerror(errno)); + } #endif + } + eina_binbuf_append_length(cl->buf, data, size); } - eina_binbuf_append_length(cl->buf, data, size); - return size; } --
