X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=dccp_recv.c;h=d5f3cadbcbd60fb6745b8e36d9701642d93994d6;hp=ea6884b16a1ffcda3002eb6b6340b2cff257b7be;hb=74c88020bd325865fe26ed25ea8ad0ace0924136;hpb=b66dfd41e268e64b65d2990bdec3d3a7e119e234 diff --git a/dccp_recv.c b/dccp_recv.c index ea6884b1..d5f3cadb 100644 --- a/dccp_recv.c +++ b/dccp_recv.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2012 Andre Noll + * Copyright (C) 2006-2013 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -19,11 +19,11 @@ #include "list.h" #include "sched.h" #include "ggo.h" +#include "buffer_tree.h" #include "recv.h" #include "string.h" #include "net.h" #include "fd.h" -#include "buffer_tree.h" #include "dccp_recv.cmdline.h" @@ -124,7 +124,7 @@ static void dccp_recv_pre_select(struct sched *s, struct task *t) para_fd_set(rn->fd, &s->rfds, &s->max_fileno); } -static void dccp_recv_post_select(struct sched *s, struct task *t) +static int dccp_recv_post_select(struct sched *s, struct task *t) { struct receiver_node *rn = container_of(t, struct receiver_node, task); struct btr_node *btrn = rn->btrn; @@ -132,6 +132,9 @@ static void dccp_recv_post_select(struct sched *s, struct task *t) int ret, iovcnt; size_t num_bytes; + ret = task_get_notification(t); + if (ret < 0) + goto out; ret = btr_node_status(btrn, 0, BTR_NT_ROOT); if (ret <= 0) goto out; @@ -149,10 +152,9 @@ static void dccp_recv_post_select(struct sched *s, struct task *t) btr_add_output_pool(rn->btrp, num_bytes - iov[0].iov_len, btrn); } out: - if (ret >= 0) - return; - btr_remove_node(&rn->btrn); - t->error = ret; + if (ret < 0) + btr_remove_node(&rn->btrn); + return ret; } static void dccp_recv_free_config(void *conf) @@ -176,7 +178,7 @@ void dccp_recv_init(struct receiver *r) r->open = dccp_recv_open; r->close = dccp_recv_close; r->pre_select = dccp_recv_pre_select; - r->post_select = dccp_recv_post_select; + r->new_post_select = dccp_recv_post_select; r->parse_config = dccp_recv_parse_config; r->free_config = dccp_recv_free_config; r->help = (struct ggo_help) {