Skip to content

Commit

Permalink
[C] Increment work_count based on the actual work done.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyazelenko committed Oct 15, 2024
1 parent 57ff2fe commit 9a04bd6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions aeron-driver/src/main/c/aeron_driver_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,34 +176,37 @@ int aeron_driver_receiver_do_work(void *clientd)

if (NULL != image->endpoint)
{
if (aeron_publication_image_send_pending_status_message(image, now_ns) < 0)
int send_result = aeron_publication_image_send_pending_status_message(image, now_ns);
if (send_result < 0)
{
AERON_APPEND_ERR("%s", "receiver send SM");
aeron_driver_receiver_log_error(receiver);
}
else
{
work_count++;
work_count += send_result;
}

if (aeron_publication_image_send_pending_loss(image) < 0)
send_result = aeron_publication_image_send_pending_loss(image);
if (send_result < 0)
{
AERON_APPEND_ERR("%s", "receiver send NAK");
aeron_driver_receiver_log_error(receiver);
}
else
{
work_count++;
work_count += send_result;
}

if (aeron_publication_image_initiate_rttm(image, now_ns) < 0)
send_result = aeron_publication_image_initiate_rttm(image, now_ns);
if (send_result < 0)
{
AERON_APPEND_ERR("%s", "receiver send RTTM");
aeron_driver_receiver_log_error(receiver);
}
else
{
work_count++;
work_count += send_result;
}
}
}
Expand Down

0 comments on commit 9a04bd6

Please sign in to comment.