]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - udp_send.c
udp_send: Force chunk queuing.
[paraslash.git] / udp_send.c
index 533af63a271f190718c45d8073f988b7971bf338..c84f416a31ed3e5071c28969b6bd5057d9da0534 100644 (file)
@@ -244,9 +244,8 @@ static int udp_send_fec(char *buf, size_t len, void *private_data)
        if (!len)
                return 0;
        if (!ret) { /* still data left in the queue */
-               ret = cq_enqueue(ut->cq, buf, len);
-               if (ret < 0)
-                       goto fail;
+               ret = cq_force_enqueue(ut->cq, buf, len);
+               assert(ret >= 0);
        }
        ret = write_nonblock(ut->fd, buf, len, 0);
        if (ret == -ERRNO_TO_PARA_ERROR(ECONNREFUSED))
@@ -254,9 +253,8 @@ static int udp_send_fec(char *buf, size_t len, void *private_data)
        if (ret < 0)
                goto fail;
        if (ret != len) {
-               ret = cq_enqueue(ut->cq, buf + ret, len - ret);
-               if (ret < 0)
-                       goto fail;
+               ret = cq_force_enqueue(ut->cq, buf + ret, len - ret);
+               assert(ret >= 0);
        }
        return 1;
 fail: