X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=send_common.c;h=61a12c827342758fa97949db669872e8b2d504b8;hb=e2167286448ce2ed9a01a548e7e9832563035088;hp=5a9ddf641796931e70accd1fa1ae3a74bfbff57d;hpb=2b004fc5dc0c652c6eb4daf84e5875f2c852ca72;p=paraslash.git diff --git a/send_common.c b/send_common.c index 5a9ddf64..61a12c82 100644 --- a/send_common.c +++ b/send_common.c @@ -46,8 +46,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); @@ -188,6 +190,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. * @@ -236,7 +254,7 @@ void generic_com_on(struct sender_status *ss, unsigned protocol) return; } add_close_on_fork_list(fd); - ss->listen_fd = ret; + ss->listen_fd = fd; return; }