]> git.tue.mpg.de Git - paraslash.git/commitdiff
upd sender: Don't send FEC EOF from command handler context.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 20 Sep 2021 18:28:42 +0000 (20:28 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 29 Sep 2021 17:01:31 +0000 (19:01 +0200)
Without this, the EOF packet might be sent twice: once by the command
handler which stopped the stream and once by the server process. This
does not hurt, but results in additional unnecessary network traffic,
so return early from udp_close_target() when we're running in command
handler context.

udp_send.c

index 04e2982f86bf125c5b4ce8ab2d6daa9280ea0bce..96a25d370a99d3fdcb6782ef9451ae86b1cfc3a4 100644 (file)
@@ -56,6 +56,8 @@ static void udp_close_target(struct sender_client *sc)
        size_t len;
        struct udp_target *ut = sc->private_data;
 
+       if (process_is_command_handler())
+               return;
        if (ut->sent_fec_eof)
                return;
        PARA_NOTICE_LOG("sending FEC EOF\n");