]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
udp_send: Fix com_off.
authorAndre Noll <maan@systemlinux.org>
Thu, 8 Apr 2010 18:23:15 +0000 (20:23 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 8 Apr 2010 18:23:15 +0000 (20:23 +0200)
When the off command is executed, the udp sender sends an eof packet
to all configured targets. However, it then continues to send data.

Fix this by returning early in udp_send_fec() if the sender has been
switched off.

udp_send.c

index 7d13f148170270c7d4487a65d8afe4270c121446..8677ec5eeea4c17fcd0a5b9f7918fc47ea961c35 100644 (file)
@@ -230,8 +230,11 @@ static int udp_com_delete(struct sender_command_data *scd)
 static int udp_send_fec(char *buf, size_t len, void *private_data)
 {
        struct udp_target *ut = private_data;
 static int udp_send_fec(char *buf, size_t len, void *private_data)
 {
        struct udp_target *ut = private_data;
-       int ret = udp_init_session(ut);
+       int ret;
 
 
+       if (sender_status == SENDER_OFF)
+               return 0;
+       ret = udp_init_session(ut);
        if (ret < 0)
                goto fail;
        ret = send_queued_chunks(ut->fd, ut->cq, 0);
        if (ret < 0)
                goto fail;
        ret = send_queued_chunks(ut->fd, ut->cq, 0);