diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-09-25 10:39:43 +0200 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-09-25 10:39:43 +0200 |
commit | 5a4bb4472ab98b401a2f0d3a09bac52fbeb9c297 (patch) | |
tree | a0d85d66e90494cfa48398e648440199d575d1d0 /daemon/session2.c | |
parent | Merge !1609: local-data: generate CNAMEs from DNAMEs (diff) | |
download | knot-resolver-5a4bb4472ab98b401a2f0d3a09bac52fbeb9c297.tar.xz knot-resolver-5a4bb4472ab98b401a2f0d3a09bac52fbeb9c297.zip |
daemon/session2: avoid incorrectly generated errors
The _try_ functions additionally return positive values on success,
and the code around didn't deal with that.
So far there's no evidence that this caused any issues beyond debug-logs:
[prlayr] ... iteration of group ... ended with status 'Unknown error ...
Diffstat (limited to 'daemon/session2.c')
-rw-r--r-- | daemon/session2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/daemon/session2.c b/daemon/session2.c index 0be121fa..91aeb829 100644 --- a/daemon/session2.c +++ b/daemon/session2.c @@ -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); @@ -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)); |