Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle ENOBUFS correctly in socketio_berkeley #590

Merged
merged 1 commit into from
Apr 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions adapters/socketio_berkeley.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,14 +939,14 @@ int socketio_send(CONCRETE_IO_HANDLE socket_io, const void* buffer, size_t size,
ssize_t send_result = send(socket_io_instance->socket, buffer, size, MSG_NOSIGNAL);
if ((size_t)send_result != size)
{
if (send_result == SOCKET_SEND_FAILURE && errno != EAGAIN)
if (send_result == SOCKET_SEND_FAILURE && errno != EAGAIN && errno != ENOBUFS)
{
LogError("Failure: sending socket failed. errno=%d (%s).", errno, strerror(errno));
result = MU_FAILURE;
}
else
{
/*send says "come back later" with EAGAIN - likely the socket buffer cannot accept more data*/
/*send says "come back later" with EAGAIN, ENOBUFS - likely the socket buffer cannot accept more data*/
/* queue data */
size_t bytes_sent = (send_result < 0 ? 0 : send_result);

Expand Down Expand Up @@ -1002,7 +1002,7 @@ void socketio_dowork(CONCRETE_IO_HANDLE socket_io)
{
if (send_result == INVALID_SOCKET)
{
if (errno == EAGAIN) /*send says "come back later" with EAGAIN - likely the socket buffer cannot accept more data*/
if (errno == EAGAIN || errno == ENOBUFS) /*send says "come back later" with EAGAIN, ENOBUFS - likely the socket buffer cannot accept more data*/
{
/*do nothing until next dowork */
break;
Expand Down