From b80d97a65e7ce689d9598f2aed283f2fd14dde64 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 13 Jan 2010 02:34:31 +0100 Subject: [PATCH] dccp_recv: Kill non-btr code. --- dccp_recv.c | 63 +++++++++++++++++------------------------------------ 1 file changed, 20 insertions(+), 43 deletions(-) diff --git a/dccp_recv.c b/dccp_recv.c index 85842248..dae3bcb0 100644 --- a/dccp_recv.c +++ b/dccp_recv.c @@ -105,10 +105,9 @@ static void dccp_recv_pre_select(struct sched *s, struct task *t) struct receiver_node *rn = container_of(t, struct receiver_node, task); struct private_dccp_recv_data *pdd = rn->private_data; - if (rn->btrn) - if (generic_recv_pre_select(s, t) <= 0) - return; t->error = 0; + if (generic_recv_pre_select(s, t) <= 0) + return; para_fd_set(pdd->fd, &s->rfds, &s->max_fileno); } @@ -118,55 +117,33 @@ static void dccp_recv_post_select(struct sched *s, struct task *t) struct private_dccp_recv_data *pdd = rn->private_data; struct btr_node *btrn = rn->btrn; int ret; + char *buf; + size_t sz; - if (btrn) { - ret = btr_node_status(btrn, 0, BTR_NT_ROOT); - if (ret < 0) - goto err; - if (ret == 0) - return; - } else { - if (rn->output_error && *rn->output_error < 0) { - t->error = *rn->output_error; - return; - } - } + ret = btr_node_status(btrn, 0, BTR_NT_ROOT); + if (ret < 0) + goto err; + if (ret == 0) + return; if (!FD_ISSET(pdd->fd, &s->rfds)) return; /* nothing to do */ if (rn->loaded >= DCCP_BUFSIZE) { t->error = -E_DCCP_OVERRUN; return; } - if (btrn) { - char *buf; - size_t sz; - - sz = btr_pool_get_buffer(pdd->btrp, &buf); - ret = -E_DCCP_OVERRUN; - if (sz == 0) - goto err; - //buf = para_malloc(HTTP_RECV_READ_BUF_SIZE); - //sz = HTTP_RECV_READ_BUF_SIZE; - ret = recv_bin_buffer(pdd->fd, buf, sz); - if (ret == 0) - ret = -E_RECV_EOF; - if (ret < 0) - goto err; - btr_add_output_pool(pdd->btrp, ret, btrn); - return; - } - t->error = recv_bin_buffer(pdd->fd, rn->buf + rn->loaded, - DCCP_BUFSIZE - rn->loaded); - if (t->error > 0) { - rn->loaded += t->error; - return; - } - if (!t->error) - t->error = -E_RECV_EOF; + ret = -E_DCCP_OVERRUN; + sz = btr_pool_get_buffer(pdd->btrp, &buf); + if (sz == 0) + goto err; + ret = recv_bin_buffer(pdd->fd, buf, sz); + if (ret == 0) + ret = -E_RECV_EOF; + if (ret < 0) + goto err; + btr_add_output_pool(pdd->btrp, ret, btrn); return; err: - if (btrn) - btr_remove_node(rn->btrn); + btr_remove_node(rn->btrn); t->error = ret; } -- 2.39.5