]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - http_send.c
http_send.c: Only pass the fd to host_in_access_perm_list().
[paraslash.git] / http_send.c
index 7fe216b1a226987300dbd8aea89441a6da1da98a..ab437f4b72eb96308f07451925b9e9c150656c03 100644 (file)
@@ -214,14 +214,14 @@ static int v4_addr_match(uint32_t addr_1, uint32_t addr_2, uint8_t netmask)
        return (htonl(addr_1) & mask) == (htonl(addr_2) & mask);
 }
 
-static int host_in_access_perm_list(struct http_client *hc)
+static int host_in_acl(int fd)
 {
        struct access_info *ai, *tmp;
        struct sockaddr_storage ss;
        socklen_t sslen = sizeof(ss);
        struct in_addr v4_addr;
 
-       if (getpeername(hc->fd, (struct sockaddr *)&ss, &sslen) < 0) {
+       if (getpeername(fd, (struct sockaddr *)&ss, &sslen) < 0) {
                PARA_ERROR_LOG("Can not determine peer address: %s\n", strerror(errno));
                goto no_match;
        }
@@ -294,8 +294,8 @@ static void http_post_select(fd_set *rfds, fd_set *wfds)
                err_msg = "server full";
                goto err_out;
        }
-       match = host_in_access_perm_list(hc);
-       PARA_DEBUG_LOG("host_in_access_perm_list: %d\n", match);
+       match = host_in_acl(hc->fd);
+       PARA_DEBUG_LOG("host_in_acl: %d\n", match);
        if ((match && !conf.http_default_deny_given) ||
                        (!match && conf.http_default_deny_given)) {
                err_msg = "permission denied";