Skip to content

Commit

Permalink
[ACR] Fix critical socketio_berkeley bug where socketio_send() will d…
Browse files Browse the repository at this point in the history
…rop packets if send() returns -1 and errno=EAGAIN
  • Loading branch information
ewertons committed Sep 20, 2019
1 parent 83f5ca9 commit bac62b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adapters/socketio_berkeley.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ int socketio_send(CONCRETE_IO_HANDLE socket_io, const void* buffer, size_t size,
{
/*send says "come back later" with EAGAIN - likely the socket buffer cannot accept more data*/
/* queue data */
size_t bytes_sent = (send_result < 0 ? 0: send_result);
size_t bytes_sent = (send_result < 0 ? 0 : send_result);

if (add_pending_io(socket_io_instance, buffer + bytes_sent, size - bytes_sent, on_send_complete, callback_context) != 0)
{
Expand Down

0 comments on commit bac62b9

Please sign in to comment.