Fix a bug in udp_send_buf().
authorAndre Noll <maan@systemlinux.org>
Sat, 10 Jan 2009 17:19:15 +0000 (18:19 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 10 Jan 2009 17:19:15 +0000 (18:19 +0100)
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

index f2a430b..7704b0a 100644 (file)
@@ -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);
        }