X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=http_recv.c;h=2f334787200e4a0134df6a108a0c4dc8a7dd0775;hp=8cb984ffe26ed93de1ddaf6c632c14bbcbb238df;hb=eeeab4239843e716b3fd4dd259985a4cd4c487a5;hpb=625fdbbafaf3842753bff02b349eaaf9554d846d diff --git a/http_recv.c b/http_recv.c index 8cb984ff..2f334787 100644 --- a/http_recv.c +++ b/http_recv.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2013 Andre Noll + * Copyright (C) 2005 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -7,7 +7,12 @@ /** \file http_recv.c paraslash's http receiver */ #include +#include +#include #include +#include +#include +#include #include "para.h" #include "error.h" @@ -55,12 +60,12 @@ static char *make_request_msg(void) return ret; } -static void http_recv_pre_select(struct sched *s, struct task *t) +static void http_recv_pre_select(struct sched *s, void *context) { - struct receiver_node *rn = container_of(t, struct receiver_node, task); + struct receiver_node *rn = context; struct private_http_recv_data *phd = rn->private_data; - if (generic_recv_pre_select(s, t) <= 0) + if (generic_recv_pre_select(s, rn) <= 0) return; if (phd->status == HTTP_CONNECTED) para_fd_set(rn->fd, &s->wfds, &s->max_fileno); @@ -73,16 +78,16 @@ static void http_recv_pre_select(struct sched *s, struct task *t) * area with data read from the socket. In any case, update the state of the * connection if necessary. */ -static int http_recv_post_select(struct sched *s, struct task *t) +static int http_recv_post_select(struct sched *s, void *context) { - struct receiver_node *rn = container_of(t, struct receiver_node, task); + struct receiver_node *rn = context; struct private_http_recv_data *phd = rn->private_data; struct btr_node *btrn = rn->btrn; int ret, iovcnt; struct iovec iov[2]; size_t num_bytes; - ret = task_get_notification(t); + ret = task_get_notification(rn->task); if (ret < 0) goto out; ret = btr_node_status(btrn, 0, BTR_NT_ROOT); @@ -193,9 +198,6 @@ void http_recv_init(struct receiver *r) r->post_select = http_recv_post_select; r->parse_config = http_recv_parse_config; r->free_config = http_recv_free_config; - r->help = (struct ggo_help) { - .short_help = http_recv_args_info_help, - .detailed_help = http_recv_args_info_detailed_help - }; + r->help = (struct ggo_help)DEFINE_GGO_HELP(http_recv); http_recv_cmdline_parser_free(&dummy); }