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.
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);
}