From: Andre Noll Date: Sat, 10 Jan 2009 17:19:15 +0000 (+0100) Subject: Fix a bug in udp_send_buf(). X-Git-Tag: v0.3.4~75^2~25 X-Git-Url: http://git.tuebingen.mpg.de/?a=commitdiff_plain;ds=sidebyside;h=b0cfbd054cba9add14976decab4b6f43dd5f6267;hp=179eaa231466840f793b8b45467662cb909dbb16;p=paraslash.git 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. --- 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); }