Branch: refs/heads/master
Home:
https://github.com/fabbione/kronosnet
Commit: d2e989476cc49c80c9d499d671459bd696f0323a
https://github.com/fabbione/kronosnet/commit/d2e989476cc49c80c9d499d671459b…
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Date: 2015-12-20 (Sun, 20 Dec 2015)
Changed paths:
M TODO
M kronosnetd/vty_cli_cmds.c
M libknet/handle.c
M libknet/internals.h
M libknet/libknet.h
M libknet/ping_test.c
M libknet/threads_send_recv.c
Log Message:
-----------
[send/recv] rework handling of 0 byte read/write on local sockets
considering there is no obvious use case trying to send 0 byte packets
and that 0 byte packtes are filtered by iovec calls across the all
code, there is no point trying to handle 0 byte differently from
any other socket error.
this commit makes sure that every time there is an error (-1) or a 0
byte read from the locally provided sockets, a call back is issued.
on read errors (-1) the socket will be removed from the epoll
to avoid spinning and it is safe to call knet_handle_remove_datafd
afterwards to remove it completely.
it is now mandatory to enable a sock_notify callback before adding
datafd.
read libknet.h carefully on what the callback is supposed to do
based on the type of socket your application is adding.
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>