The branch, master has been updated
via 08059d7fb37e975616bac50945ba7b0d145c242e (commit)
from 6f59dcf596103d0bc69be841627cd9926faa4139 (commit)
- Log -----------------------------------------------------------------
commit 08059d7fb37e975616bac50945ba7b0d145c242e
Author: Gabriel Braga <gabriel.braga@xxxxxxxxxxxxx>
Date: Thu Apr 4 09:48:57 2024 +0200
Handle EWOULDBLOCK at socket communication (#7596)
This adds treatment to the EWOULDBLOCK error on socket comms.
Previously only EAGAIN was treated.
-----------------------------------------------------------------------
Summary of changes:
src/socket_handler.cpp | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/socket_handler.cpp b/src/socket_handler.cpp
index 0cc5036..f1f5ef7 100644
--- a/src/socket_handler.cpp
+++ b/src/socket_handler.cpp
@@ -248,7 +248,7 @@ bool socket_handler::fill_buffer(std::string& buffer)
if (nbytes < 0)
{
- if (errno == EAGAIN)
+ if (errno == EAGAIN || errno == EWOULDBLOCK)
return read_something; // no (more) data was
waiting
else if (errno == EINTR)
{
@@ -301,10 +301,10 @@ void socket_handler::socket_write(const std::string& data)
int rtn;
while ((rtn=::write(sock, data.data()+offset, write_size)) == -1 &&
- (errno == EAGAIN || errno == EINTR))
+ (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR))
{
wait_ready_to_write(sock,write_timeout);
- LOGSTREAM(debug,"resuming write() call after EAGAIN or EINTR");
+ LOGSTREAM(debug,"resuming write() call after EAGAIN or EINTR or
EWOULDBLOCK");
}
if (rtn == -1)
hooks/post-receive
--
C++ inter-process communication library
--
libt2n-git - see http://www.intra2net.com/en/developer/libt2n for details.
To unsubscribe send a mail to libt2n-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
|