summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-04-11 14:34:40 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-04-11 14:34:40 +0900
commit86c855bdd356550513bf2b316961eceace107291 (patch)
treefcbdbe18f5379cb439597c4bf079830c9a3ad42b
parent23800a06a012209becd5b0ccaa772ef5306a2865 (diff)
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
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c59
1 files 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
969 return 0; 969 return 0;
970 } 970 }
971 971
972 slice.mem = data; 972 if ((data) && (size > 0))
973 slice.len = size;
974 err = efl_io_writer_write(svr->dialer.input, &slice, NULL);
975 if (err)
976 {
977 ERR("could not write queue=%p %zd bytes: %s",
978 svr->dialer.input, slice.len, eina_error_msg_get(err));
979 return 0;
980 }
981 if (slice.len < (size_t)size)
982 { 973 {
983 ERR("only wrote %zd of %d bytes to queue %p", 974 slice.mem = data;
984 slice.len, size, svr->dialer.input); 975 slice.len = size;
985 return 0; 976 err = efl_io_writer_write(svr->dialer.input, &slice, NULL);
977 if (err)
978 {
979 ERR("could not write queue=%p %zd bytes: %s",
980 svr->dialer.input, slice.len, eina_error_msg_get(err));
981 return 0;
982 }
983 if (slice.len < (size_t)size)
984 {
985 ERR("only wrote %zd of %d bytes to queue %p",
986 slice.len, size, svr->dialer.input);
987 return 0;
988 }
986 } 989 }
987 990
988 return s + size; 991 return s + size;
@@ -1188,21 +1191,23 @@ ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int r
1188 slice.len, s, cl->socket.input); 1191 slice.len, s, cl->socket.input);
1189 return 0; 1192 return 0;
1190 } 1193 }
1191 1194 if ((data) && (size > 0))
1192 slice.mem = data;
1193 slice.len = size;
1194 err = efl_io_writer_write(cl->socket.input, &slice, NULL);
1195 if (err)
1196 {
1197 ERR("could not write queue=%p %zd bytes: %s",
1198 cl->socket.input, slice.len, eina_error_msg_get(err));
1199 return 0;
1200 }
1201 if (slice.len < (size_t)size)
1202 { 1195 {
1203 ERR("only wrote %zd of %d bytes to queue %p", 1196 slice.mem = data;
1204 slice.len, size, cl->socket.input); 1197 slice.len = size;
1205 return 0; 1198 err = efl_io_writer_write(cl->socket.input, &slice, NULL);
1199 if (err)
1200 {
1201 ERR("could not write queue=%p %zd bytes: %s",
1202 cl->socket.input, slice.len, eina_error_msg_get(err));
1203 return 0;
1204 }
1205 if (slice.len < (size_t)size)
1206 {
1207 ERR("only wrote %zd of %d bytes to queue %p",
1208 slice.len, size, cl->socket.input);
1209 return 0;
1210 }
1206 } 1211 }
1207 1212
1208 return s + size; 1213 return s + size;