static void udp_close_target(struct sender_client *sc)
{
+ const char *buf;
+ size_t len = vss_get_fec_eof_packet(&buf);
+
if (sc->cq != NULL) {
+ /* ignore return value, closing the target anyway. */
+ (void)write(sc->fd, buf, len);
cq_destroy(sc->cq);
sc->cq = NULL;
}
static void udp_shutdown_targets(void)
{
struct sender_client *sc, *tmp;
- const char *buf;
- size_t len = vss_get_fec_eof_packet(&buf);
-
list_for_each_entry_safe(sc, tmp, &targets, node)
- if (sc->cq != NULL) {
- /* ignore return value, closing the target anyway. */
- (void)write(sc->fd, buf, len);
- udp_close_target(sc);
- }
+ udp_close_target(sc);
}
static int udp_resolve_target(const char *url, struct sender_command_data *scd)