net.c: make it compile without ucred
[paraslash.git] / http_recv.c
index 2e3a11b3ee0a1d667b54d06aff3fc78dd51c42e6..49c10f9550fb529a8def9ff3b03c74b3e772e4bb 100644 (file)
@@ -90,7 +90,7 @@ static char *make_request_msg(void)
 }
 
 static int http_pre_select(struct receiver_node *rn, fd_set *rfds, fd_set *wfds,
-       __unused struct timeval *timeout)
+       __a_unused struct timeval *timeout)
 {
        struct private_http_recv_data *phd = rn->private_data;
 
@@ -139,7 +139,7 @@ static int http_post_select(struct receiver_node *rn, int select_ret,
        }
        ret = recv_bin_buffer(phd->fd, rn->buf + rn->loaded, BUFSIZE - rn->loaded);
        if (ret <= 0) {
-               PARA_NOTICE_LOG("recv returned %d/%d\n", ret, BUFSIZE - rn->loaded);
+               PARA_NOTICE_LOG("recv returned %d/%zd\n", ret, BUFSIZE - rn->loaded);
                return ret < 0? -E_HTTP_RECV_BUF : 0;
        }
        rn->loaded += ret;
@@ -156,7 +156,7 @@ static void http_recv_close(struct receiver_node *rn)
 
 static void *http_recv_parse_config(int argc, char **argv)
 {
-       struct gengetopt_args_info *tmp = para_calloc(sizeof(struct gengetopt_args_info));
+       struct http_recv_args_info *tmp = para_calloc(sizeof(struct http_recv_args_info));
 
        if (!http_recv_cmdline_parser(argc, argv, tmp))
                return tmp;
@@ -168,14 +168,13 @@ static int http_recv_open(struct receiver_node *rn)
 {
        struct private_http_recv_data *phd;
        struct hostent *he;
-       struct gengetopt_args_info *conf = rn->conf;
+       struct http_recv_args_info *conf = rn->conf;
        struct sockaddr_in their_addr;
        int ret;
 
        rn->buf = para_calloc(BUFSIZE);
        rn->private_data = para_calloc(sizeof(struct private_http_recv_data));
        phd = rn->private_data;
-       optind = 0;
        ret = -E_HOST_INFO;
        if (!(he = get_host_info(conf->host_arg)))
                goto err_out;