Skip to content

Commit

Permalink
squash w/ [?] Fix error handling logic for heartbeat operation.
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Nov 7, 2024
1 parent 4a99826 commit d8535ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/main_server/src/agent_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,10 @@ namespace

while (bytes_to_send) {
const int bytes_sent = send(net_obj->socket_handle(), &(heartbeat[heartbeat_length - bytes_to_send]), bytes_to_send, 0);

// We do not check for 0 because it is not considered an error condition. It only means 0
// bytes were sent. As longs as we have more bytes to send and no error has occurred, we
// keep attempting to send bytes.
if (bytes_sent == -1) {
const int errsav = errno;
if (errsav != EINTR) {
Expand Down

0 comments on commit d8535ba

Please sign in to comment.