X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=http_send.c;h=9a55ba0ecb1f540d93d12442e693cf642f8aa5c0;hp=63bfec03c9d1cd17ac4b34a7609c32c28c218ead;hb=5b8e525dfb2f18a4e0d67b9da264259159ad2184;hpb=69bc5e6d0f3e1535c04555928e016141a71d4619 diff --git a/http_send.c b/http_send.c index 63bfec03..9a55ba0e 100644 --- a/http_send.c +++ b/http_send.c @@ -98,7 +98,7 @@ static void http_send(long unsigned current_chunk, static void http_post_select(fd_set *rfds, __a_unused fd_set *wfds) { - int ret, fd, match; + int ret, fd; struct sender_client *sc, *tmp; struct private_http_sender_data *phsd; @@ -147,11 +147,8 @@ static void http_post_select(fd_set *rfds, __a_unused fd_set *wfds) ret = mark_fd_nonblocking(fd); if (ret < 0) goto err_out; - match = acl_lookup(fd, &http_acl); - PARA_DEBUG_LOG("acl lookup returned %d\n", match); - ret = -E_ACL_PERM; - if ((match && !conf.http_default_deny_given) || - (!match && conf.http_default_deny_given)) + ret = acl_check_access(fd, &http_acl, conf.http_default_deny_given); + if (ret < 0) goto err_out; numclients++; sc = para_calloc(sizeof(*sc)); @@ -207,19 +204,15 @@ static int http_com_off(__a_unused struct sender_command_data *scd) static int http_com_deny(struct sender_command_data *scd) { - if (conf.http_default_deny_given) - acl_del_entry(&http_acl, scd->addr, scd->netmask); - else - acl_add_entry(&http_acl, scd->addr, scd->netmask); + acl_deny(scd->addr, scd->netmask, &http_acl, + conf.http_default_deny_given); return 1; } static int http_com_allow(struct sender_command_data *scd) { - if (conf.http_default_deny_given) - acl_add_entry(&http_acl, scd->addr, scd->netmask); - else - acl_del_entry(&http_acl, scd->addr, scd->netmask); + acl_allow(scd->addr, scd->netmask, &http_acl, + conf.http_default_deny_given); return 1; }