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 04e2982..96a25d3 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");