X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=http_recv.c;h=2f334787200e4a0134df6a108a0c4dc8a7dd0775;hp=7db8ba193c1eaa2fd6046efd91011c25d37da032;hb=eeeab4239843e716b3fd4dd259985a4cd4c487a5;hpb=e2eebf654cae2fc004cee516a0e165127c0214ca diff --git a/http_recv.c b/http_recv.c index 7db8ba19..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);