X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=udp_send.c;h=9092985725b5289ee7391eba3df2c12ae4e62844;hp=35637f7ada278e9dcfbe06d8447c0ec58aadc457;hb=e7f4c5362b313e84bf048b87c35deea21d564a4b;hpb=23b1141809ea872a144d8dbe6d123e93e74094de diff --git a/udp_send.c b/udp_send.c index 35637f7a..90929857 100644 --- a/udp_send.c +++ b/udp_send.c @@ -54,7 +54,12 @@ static int sender_status; 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; } @@ -165,15 +170,8 @@ static void udp_init_session(struct sender_client *sc) 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)