From b0cfbd054cba9add14976decab4b6f43dd5f6267 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 10 Jan 2009 18:19:15 +0100 Subject: [PATCH] Fix a bug in udp_send_buf(). In case multiple targets are defined and a write for one of them fails, the old code would return early rather than continue to send the chunk to the other targets. --- udp_send.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/udp_send.c b/udp_send.c index f2a430b6..7704b0a1 100644 --- a/udp_send.c +++ b/udp_send.c @@ -77,8 +77,10 @@ static void udp_send_buf(char *buf, size_t len) if (ut->fd < 0) continue; ret = write_nonblock(ut->fd, buf, len, len); - if (ret < 0) /* TODO: Use chunk queueing */ - return udp_delete_target(ut, "send error"); + if (ret < 0) { + udp_delete_target(ut, para_strerror(-ret)); + continue; + } if (ret != len) PARA_WARNING_LOG("short write %zu/%zu\n", ret, len); } -- 2.39.2