From 1d109a3ed76fd7ef8317c238b6ada9128f765d6d Mon Sep 17 00:00:00 2001 From: cedric Date: Fri, 24 Aug 2012 10:30:27 +0000 Subject: [PATCH] eet: add eet_connection_empty. This is needed to fix a bug when multiplexing eet_connection with something else. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eet@75651 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 4 ++++ NEWS | 1 + src/lib/Eet.h | 14 ++++++++++++++ src/lib/eet_connection.c | 6 ++++++ 4 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index ce6ba0e..8079e30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -611,3 +611,7 @@ 2012-08-09 Cedric Bail * Don't copy string around for nothing. + +2012-08-24 Cedric Bail + + * Add eet_connection_empty. diff --git a/NEWS b/NEWS index 4b8370c..a84db86 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ Changes since Eet 1.6.0: Additions: * Add code to detect overrun and underrun during Eet Data Descriptor setup. + * Add eet_connection_empty. Fixes: * Force destruction of all pending file when shuting down eet. diff --git a/src/lib/Eet.h b/src/lib/Eet.h index 864bdf8..a60f562 100644 --- a/src/lib/Eet.h +++ b/src/lib/Eet.h @@ -4192,6 +4192,20 @@ eet_connection_received(Eet_Connection *conn, size_t size); /** + * Tell if the Eet_Connection as received some partial data. + * @param conn Connection handler to request. + * @return EINA_TRUE if there is some data pending inside, EINA_FALSE otherwise. + * + * Eet_Connection buffer data until the received data can be unserialized correctly. This + * function let you know if there is some data inside that buffer waiting for more data to + * be received before being processed. + * + * @since 1.7 + * @ingroup Eet_Connection_Group + */ +EAPI Eina_Bool eet_connection_empty(Eet_Connection *conn); + +/** * Convert a complex structure and prepare it to be send. * @param conn Connection handler to track. * @param edd The data descriptor to use when encoding. diff --git a/src/lib/eet_connection.c b/src/lib/eet_connection.c index 7b6b934..c044e3d 100644 --- a/src/lib/eet_connection.c +++ b/src/lib/eet_connection.c @@ -170,6 +170,12 @@ _eet_connection_raw_send(Eet_Connection *conn, } EAPI Eina_Bool +eet_connection_empty(Eet_Connection *conn) +{ + return conn->size ? EINA_FALSE : EINA_TRUE; +} + +EAPI Eina_Bool eet_connection_send(Eet_Connection *conn, Eet_Data_Descriptor *edd, const void *data_in, -- 2.7.4