X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=udp_send.c;h=ba7163a8dcdbcffcc9f60772a7d34c5f3c0aec28;hb=939ece34a0c1ae2f8c32436d31ed18de6b3c24b5;hp=0343feb633c8d34319c70320e0081c701d18d0fe;hpb=5001e8462f004d5130b0e9cf7a1fb5bf7ee710ac;p=paraslash.git diff --git a/udp_send.c b/udp_send.c index 0343feb6..ba7163a8 100644 --- a/udp_send.c +++ b/udp_send.c @@ -57,7 +57,6 @@ static int sender_status; static void udp_close_target(struct sender_client *sc) { if (sc->cq != NULL) { - del_close_on_fork_list(sc->fd); cq_destroy(sc->cq); sc->cq = NULL; } @@ -69,6 +68,8 @@ static void udp_delete_target(struct sender_client *sc, const char *msg) PARA_NOTICE_LOG("deleting %s (%s) from list\n", sc->name, msg); udp_close_target(sc); + close(sc->fd); + del_close_on_fork_list(sc->fd); vss_del_fec_client(ut->fc); list_del(&sc->node); free(sc->name); @@ -159,7 +160,6 @@ static void udp_init_session(struct sender_client *sc) { if (sc->cq == NULL) { sc->cq = cq_new(UDP_CQ_BYTES); - add_close_on_fork_list(sc->fd); PARA_NOTICE_LOG("sending to udp %s\n", sc->name); } } @@ -362,6 +362,7 @@ static int udp_com_add(struct sender_command_data *scd) PARA_INFO_LOG("adding to target list (%s)\n", sc->name); ut->fc = vss_add_fec_client(sc, &ut->fcp); para_list_add(&sc->node, &targets); + add_close_on_fork_list(sc->fd); return 1; err: if (sc->fd >= 0)