]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - udp_send.c
upd_send.c: Use write_nonblock() rather than write_all().
[paraslash.git] / udp_send.c
index 50161c1333642d2021b47c3b0a05ff4bd43f10f6..8bbcbae7fa611473d1abd67a65d70506380aa8a5 100644 (file)
@@ -61,14 +61,13 @@ static void udp_send_buf(char *buf, size_t len)
        int ret;
 
        list_for_each_entry_safe(ut, tmp, &targets, node) {
-               size_t written = len;
                if (ut->fd < 0)
                        continue;
-               ret = write_all(ut->fd, buf, &written);
+               ret = write_nonblock(ut->fd, buf, len, len);
                if (ret < 0) /* TODO: Use chunk queueing */
                        return udp_delete_target(ut, "send error");
-               if (written != len)
-                       PARA_WARNING_LOG("short write %zu/%zu\n", written, len);
+               if (ret != len)
+                       PARA_WARNING_LOG("short write %zu/%zu\n", ret, len);
        }
 }