]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - http_send.c
aft.c: Fix a memory leak in open_and_update_audio_file().
[paraslash.git] / http_send.c
index d2bd3531cf4069c428e6091fa1d722830e88269e..7c1ea344e0f96e4ca515b6f797d8384ee1145e65 100644 (file)
@@ -249,8 +249,8 @@ static void http_post_select(fd_set *rfds, fd_set *wfds)
                err_msg = "server full";
                goto err_out;
        }
-       match = host_in_acl(hc->fd, &http_acl);
-       PARA_DEBUG_LOG("host_in_acl: %d\n", match);
+       match = acl_lookup(hc->fd, &http_acl);
+       PARA_DEBUG_LOG("acl lookup returned %d\n", match);
        if ((match && !conf.http_default_deny_given) ||
                        (!match && conf.http_default_deny_given)) {
                err_msg = "permission denied";
@@ -307,7 +307,7 @@ static void http_pre_select(int *max_fileno, fd_set *rfds, fd_set *wfds)
        }
 }
 
-static int open_tcp_port(int port)
+static int http_open(int port)
 {
        int ret;
 
@@ -331,7 +331,7 @@ static int http_com_on(__a_unused struct sender_command_data *scd)
 {
        if (self->status == SENDER_ON)
                return 1;
-       return open_tcp_port(conf.http_port_arg);
+       return http_open(conf.http_port_arg);
 }
 
 static int http_com_off(__a_unused struct sender_command_data *scd)
@@ -349,18 +349,18 @@ 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)
-               del_acl_entry(&http_acl, scd->addr, scd->netmask);
+               acl_del_entry(&http_acl, scd->addr, scd->netmask);
        else
-               add_acl_entry(&http_acl, scd->addr, scd->netmask);
+               acl_add_entry(&http_acl, scd->addr, scd->netmask);
        return 1;
 }
 
 static int http_com_allow(struct sender_command_data *scd)
 {
        if (conf.http_default_deny_given)
-               add_acl_entry(&http_acl, scd->addr, scd->netmask);
+               acl_add_entry(&http_acl, scd->addr, scd->netmask);
        else
-               del_acl_entry(&http_acl, scd->addr, scd->netmask);
+               acl_del_entry(&http_acl, scd->addr, scd->netmask);
        return 1;
 }
 
@@ -369,7 +369,7 @@ static char *http_info(void)
        char *clnts = NULL, *ret;
        struct http_client *hc, *tmp_hc;
 
-       char *acl_contents = get_acl_contents(&http_acl);
+       char *acl_contents = acl_get_contents(&http_acl);
        list_for_each_entry_safe(hc, tmp_hc, &clients, node) {
                char *tmp = make_message("%s%s ", clnts? clnts : "", hc->name);
                free(clnts);
@@ -429,8 +429,8 @@ void http_send_init(struct sender *s)
        s->client_cmds[SENDER_ADD] = NULL;
        s->client_cmds[SENDER_DELETE] = NULL;
        self = s;
-       init_acl(&http_acl, conf.http_access_arg, conf.http_access_given);
+       acl_init(&http_acl, conf.http_access_arg, conf.http_access_given);
        if (!conf.http_no_autostart_given)
-               open_tcp_port(conf.http_port_arg); /* ignore errors */
+               http_open(conf.http_port_arg); /* ignore errors */
        PARA_DEBUG_LOG("%s", "http sender init complete\n");
 }