X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=dccp_recv.c;h=3be5365fe818f4b14133a87c2d561df7b9feec59;hb=d46fe38dcada4108ed49a0e621376df0f7913fe3;hp=deca7162bfecc40e93dd0d7431f7bae9218f23ec;hpb=39ef1da5509461b18beb5b8f16ff6118c20c0ac6;p=paraslash.git diff --git a/dccp_recv.c b/dccp_recv.c index deca7162..3be5365f 100644 --- a/dccp_recv.c +++ b/dccp_recv.c @@ -121,10 +121,12 @@ static void *dccp_recv_parse_config(int argc, char **argv) static void dccp_recv_pre_select(struct sched *s, struct task *t) { - struct private_dccp_recv_data *pdd = t->private_data; + struct receiver_node *rn = t->private_data; + struct private_dccp_recv_data *pdd = rn->private_data; + t->ret = 1; if (!pdd) - return ; + return; para_fd_set(pdd->fd, &s->rfds, &s->max_fileno); } @@ -133,6 +135,11 @@ static void dccp_recv_post_select(struct sched *s, struct task *t) struct receiver_node *rn = t->private_data; struct private_dccp_recv_data *pdd = rn->private_data; + t->ret = -E_DCCP_RECV_EOF; + if (rn->output_eof && *rn->output_eof) { + rn->eof = 1; + return; + } t->ret = 1; if (!s->select_ret || !pdd || !FD_ISSET(pdd->fd, &s->rfds)) return; /* nothing to do */