Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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@redhat.com>
- Loading branch information
Showing
7 changed files
with
185 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.