X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=send_common.c;h=3e8a7c0dc85049dcfc52a5982083a69d3e1babc6;hp=acb7aa6d06777863cccffe8a317749618b11060b;hb=8f69a1302a52163c61142531c4a6944510c3ec12;hpb=d31995b3074bb19aa4da66ce5c4774ca9ed101a1 diff --git a/send_common.c b/send_common.c index acb7aa6d..3e8a7c0d 100644 --- a/send_common.c +++ b/send_common.c @@ -74,8 +74,10 @@ void shutdown_client(struct sender_client *sc, struct sender_status *ss) { PARA_INFO_LOG("shutting down %s on fd %d\n", sc->name, sc->fd); free(sc->name); - close(sc->fd); - del_close_on_fork_list(sc->fd); + if (!process_is_command_handler()) { + close(sc->fd); + del_close_on_fork_list(sc->fd); + } cq_destroy(sc->cq); list_del(&sc->node); free(sc->private_data); @@ -216,6 +218,22 @@ void generic_com_allow(struct sender_command_data *scd, acl_allow(scd->host, scd->netmask, &ss->acl, ss->default_deny); } +/** + * Empty the access control list of a sender. + * + * \param acl The access control list of the sender. + * + * This is called from the ->shutdown methods of the http and the dccp sender. + */ +void generic_acl_deplete(struct list_head *acl) +{ + /* + * Since default_deny is false, the ACL is considered a blacklist. A + * netmask of zero matches any IP address, so this call empties the ACL. + */ + acl_allow("0.0.0.0", 0 /* netmask */, acl, 0 /* default_deny */); +} + /** * Deny connections from the given range of IP addresses. *