@@ -353,7 +353,7 @@ static void *server(void *arg)
while (bytes < total_bytes && !READ_ONCE(stop)) {
nr_sent = send(fd, &batch,
MIN(total_bytes - bytes, sizeof(batch)), 0);
- if (nr_sent == -1 && errno == EINTR)
+ if (nr_sent == -1 && (errno == EINTR || errno == EAGAIN))
continue;
if (nr_sent == -1) {
err = -errno;
@@ -397,7 +397,7 @@ static void send_data(int lfd, int fd, char *msg)
while (bytes < total_bytes && !READ_ONCE(stop)) {
nr_recv = recv(fd, &batch,
MIN(total_bytes - bytes, sizeof(batch)), 0);
- if (nr_recv == -1 && errno == EINTR)
+ if (nr_recv == -1 && (errno == EINTR || errno == EAGAIN))
continue;
if (nr_recv == -1)
break;