return on timeout

This commit is contained in:
John Jones 2017-07-31 10:00:32 -05:00
parent 4542ebe1cb
commit 90b1e2c3c8

View file

@ -532,6 +532,7 @@ int libp2p_secio_unencrypted_read(struct SessionContext* session, unsigned char*
read_this_time = 0;
if ( (errno == EAGAIN) || (errno == EWOULDBLOCK)) {
// TODO: use epoll or select to wait for socket to be writable
return 0;
} else {
libp2p_logger_error("secio", "Error in libp2p_secio_unencrypted_read: %s\n", strerror(errno));
return 0;