devilhorns pushed a commit to branch feature/wayland/multi-output.

http://git.enlightenment.org/core/efl.git/commit/?id=ddd57099128bdb53f57d79e3e64f1127f54ac955

commit ddd57099128bdb53f57d79e3e64f1127f54ac955
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Wed Apr 11 14:34:40 2018 +0900

    ecore ipc - fix send to skip data payload if null/0
    
    conversion to efl.nmet didnt deal with null/0 zised payloads properly
    and tried to send them, resulting in lots of ERR complaints which were
    not errors. fix that to not try and send such empty payloads
    
    @fix
---
 src/lib/ecore_ipc/ecore_ipc.c | 59 +++++++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 27 deletions(-)

diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index 7336d83ba8..d4b11617ce 100644
--- a/src/lib/ecore_ipc/ecore_ipc.c
+++ b/src/lib/ecore_ipc/ecore_ipc.c
@@ -969,20 +969,23 @@ ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, 
int minor, int ref, int
              return 0;
           }
 
-        slice.mem = data;
-        slice.len = size;
-        err = efl_io_writer_write(svr->dialer.input, &slice, NULL);
-        if (err)
-          {
-             ERR("could not write queue=%p %zd bytes: %s",
-                 svr->dialer.input, slice.len, eina_error_msg_get(err));
-             return 0;
-          }
-        if (slice.len < (size_t)size)
+        if ((data) && (size > 0))
           {
-             ERR("only wrote %zd of %d bytes to queue %p",
-                 slice.len, size, svr->dialer.input);
-             return 0;
+             slice.mem = data;
+             slice.len = size;
+             err = efl_io_writer_write(svr->dialer.input, &slice, NULL);
+             if (err)
+               {
+                  ERR("could not write queue=%p %zd bytes: %s",
+                      svr->dialer.input, slice.len, eina_error_msg_get(err));
+                  return 0;
+               }
+             if (slice.len < (size_t)size)
+               {
+                  ERR("only wrote %zd of %d bytes to queue %p",
+                      slice.len, size, svr->dialer.input);
+                  return 0;
+               }
           }
 
         return s + size;
@@ -1188,21 +1191,23 @@ ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, 
int minor, int ref, int r
                  slice.len, s, cl->socket.input);
              return 0;
           }
-
-        slice.mem = data;
-        slice.len = size;
-        err = efl_io_writer_write(cl->socket.input, &slice, NULL);
-        if (err)
-          {
-             ERR("could not write queue=%p %zd bytes: %s",
-                 cl->socket.input, slice.len, eina_error_msg_get(err));
-             return 0;
-          }
-        if (slice.len < (size_t)size)
+        if ((data) && (size > 0))
           {
-             ERR("only wrote %zd of %d bytes to queue %p",
-                 slice.len, size, cl->socket.input);
-             return 0;
+             slice.mem = data;
+             slice.len = size;
+             err = efl_io_writer_write(cl->socket.input, &slice, NULL);
+             if (err)
+               {
+                  ERR("could not write queue=%p %zd bytes: %s",
+                      cl->socket.input, slice.len, eina_error_msg_get(err));
+                  return 0;
+               }
+             if (slice.len < (size_t)size)
+               {
+                  ERR("only wrote %zd of %d bytes to queue %p",
+                      slice.len, size, cl->socket.input);
+                  return 0;
+               }
           }
 
         return s + size;

-- 


Reply via email to