]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - http_send.c
Rename mark_fd_nonblock() to mark_fd_nonblocking().
[paraslash.git] / http_send.c
index bbf634100c6de88e95c2e426de5c5a09d4dcfc80..f3ae608b4b5ac235894faaeca609eed4694ef50c 100644 (file)
@@ -6,17 +6,22 @@
 
 /** \file http_send.c paraslash's http sender */
 
+#include <sys/types.h>
+#include <dirent.h>
 
+#include "para.h"
+#include "error.h"
+#include "string.h"
 #include "server.cmdline.h"
+#include "afh.h"
+#include "afs.h"
 #include "server.h"
 #include "http.h"
 #include "vss.h"
 #include "send.h"
 #include "list.h"
 #include "close_on_fork.h"
-#include "error.h"
 #include "net.h"
-#include "string.h"
 #include "fd.h"
 #include "chunk_queue.h"
 
@@ -165,11 +170,11 @@ static void http_send( long unsigned current_chunk,
                                hc->status != HTTP_READY_TO_STREAM)
                        continue;
                if (hc->status == HTTP_READY_TO_STREAM) {
-                       unsigned hlen;
+                       size_t hlen;
                        char *hbuf = vss_get_header(&hlen);
                        if (hbuf && hlen > 0 && current_chunk) {
                                /* need to send header */
-                               PARA_INFO_LOG("queueing header: %d\n", hlen);
+                               PARA_INFO_LOG("queueing header: %zu\n", hlen);
                                if (queue_chunk_or_shutdown(hc, -1U, 0) < 0)
                                        continue;
                        } else
@@ -281,7 +286,7 @@ static void http_post_select(fd_set *rfds, fd_set *wfds)
        numclients++;
        para_list_add(&hc->node, &clients);
        add_close_on_fork_list(hc->fd);
-       mark_fd_nonblock(hc->fd);
+       mark_fd_nonblocking(hc->fd);
        return;
 err_out:
        PARA_WARNING_LOG("ignoring connect request from %s (%s)\n",
@@ -335,7 +340,7 @@ static int open_tcp_port(int port)
                self->status = SENDER_OFF;
                return server_fd;
        }
-       ret = mark_fd_nonblock(server_fd);
+       ret = mark_fd_nonblocking(server_fd);
        if (ret < 0) {
                PARA_EMERG_LOG("%s\n", PARA_STRERROR(-ret));
                exit(EXIT_FAILURE);
@@ -460,7 +465,7 @@ static void init_access_control_list(void)
                if (!p)
                        goto err;
                *p = '\0';
-               if (!inet_aton(arg, &scd.addr))
+               if (!inet_pton(AF_INET, arg, &scd.addr))
                        goto err;
                scd.netmask = atoi(++p);
                if (scd.netmask < 0 || scd.netmask > 32)