Skip to content

Commit

Permalink
Merge !1617: daemon/session2: avoid incorrectly generated errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Sep 25, 2024
2 parents bc78327 + 5a4bb44 commit 7ef1a7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions daemon/session2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,8 @@ static int session2_transport_pushv(struct session2 *s,
} else {
int ret = uv_udp_try_send((uv_udp_t*)handle,
(uv_buf_t *)iov, iovcnt, comm->comm_addr);
if (ret > 0) // equals buffer size, only confuses us
ret = 0;
if (ret == UV_EAGAIN) {
ret = kr_error(ENOBUFS);
session2_event(s, PROTOLAYER_EVENT_OS_BUFFER_FULL, NULL);
Expand Down Expand Up @@ -1480,6 +1482,8 @@ static int session2_transport_pushv(struct session2 *s,
ret = kr_error(ENOBUFS);
session2_event(s, PROTOLAYER_EVENT_OS_BUFFER_FULL, NULL);
}
else if (ret > 0) // iovec_sum was checked, let's not get confused anymore
ret = 0;

if (false && ret == UV_EAGAIN) {
uv_write_t *req = malloc(sizeof(*req));
Expand Down

0 comments on commit 7ef1a7c

Please sign in to comment.