From e7e55d0ad711a46e4768066be197bb41caa5c5eb Mon Sep 17 00:00:00 2001
From: Andre Noll <maan@systemlinux.org>
Date: Wed, 13 Jan 2010 02:54:02 +0100
Subject: [PATCH] Kill fields buf, loaded and output_error of struct receiver
 node.

---
 dccp_recv.c | 10 ----------
 http_recv.c |  5 -----
 recv.c      |  3 ---
 recv.h      |  6 ------
 udp_recv.c  |  5 -----
 5 files changed, 29 deletions(-)

diff --git a/dccp_recv.c b/dccp_recv.c
index dae3bcb0..0b62529f 100644
--- a/dccp_recv.c
+++ b/dccp_recv.c
@@ -28,9 +28,6 @@
 
 #include "dccp_recv.cmdline.h"
 
-/** the size of the output buffer */
-#define DCCP_BUFSIZE 40960
-
 /**
  * data specific to the dccp receiver
  *
@@ -50,8 +47,6 @@ static void dccp_recv_close(struct receiver_node *rn)
 
 	if (pdd && pdd->fd > 0)
 		close(pdd->fd);
-	free(rn->buf);
-	rn->buf = NULL;
 	free(rn->private_data);
 	rn->private_data = NULL;
 }
@@ -80,7 +75,6 @@ static int dccp_recv_open(struct receiver_node *rn)
 	ret = mark_fd_nonblocking(fd);
 	if (ret < 0)
 		goto err;
-	rn->buf = para_calloc(DCCP_BUFSIZE);
 	rn->private_data = pdd = para_calloc(sizeof(struct private_dccp_recv_data));
 	pdd->btrp = btr_pool_new("dccp_recv", 320 * 1024);
 	pdd->fd = fd;
@@ -127,10 +121,6 @@ static void dccp_recv_post_select(struct sched *s, struct task *t)
 		return;
 	if (!FD_ISSET(pdd->fd, &s->rfds))
 		return; /* nothing to do */
-	if (rn->loaded >= DCCP_BUFSIZE) {
-		t->error = -E_DCCP_OVERRUN;
-		return;
-	}
 	ret = -E_DCCP_OVERRUN;
 	sz = btr_pool_get_buffer(pdd->btrp, &buf);
 	if (sz == 0)
diff --git a/http_recv.c b/http_recv.c
index cdb4bc15..035d1f19 100644
--- a/http_recv.c
+++ b/http_recv.c
@@ -23,9 +23,6 @@
 #include "fd.h"
 #include "buffer_tree.h"
 
-/** the output buffer size of the http receiver */
-#define BUFSIZE (32 * 1024)
-
 /**
  * the possible states of a http receiver node
  *
@@ -151,7 +148,6 @@ static void http_recv_close(struct receiver_node *rn)
 
 	close(phd->fd);
 	btr_pool_free(phd->btrp);
-	free(rn->buf);
 	free(rn->private_data);
 }
 
@@ -180,7 +176,6 @@ static int http_recv_open(struct receiver_node *rn)
 		close(fd);
 		return ret;
 	}
-	rn->buf = para_calloc(BUFSIZE);
 	rn->private_data = phd = para_calloc(sizeof(struct private_http_recv_data));
 	phd->fd = fd;
 	phd->status = HTTP_CONNECTED;
diff --git a/recv.c b/recv.c
index 70866a35..05f616cd 100644
--- a/recv.c
+++ b/recv.c
@@ -100,9 +100,6 @@ int main(int argc, char *argv[])
 
 	sot.btrn = btr_new_node("stdout", rn.btrn, NULL, NULL);
 	stdout_set_defaults(&sot);
-	sot.bufp = &rn.buf;
-	sot.loaded = &rn.loaded;
-	sot.input_error = &rn.task.error;
 	register_task(&sot.task);
 
 	rn.task.pre_select = r->pre_select;
diff --git a/recv.h b/recv.h
index 20dd9b86..837cf47c 100644
--- a/recv.h
+++ b/recv.h
@@ -12,14 +12,8 @@
 struct receiver_node {
 	/** Points to the corresponding receiver. */
 	struct receiver *receiver;
-	/** The output buffer. */
-	char *buf;
-	/** The amount of bytes in \a buf. */
-	size_t loaded;
 	/** Receiver-specific data. */
 	void *private_data;
-	/** Pointer to the error member of the consumer. */
-	int *output_error;
 	/** Pointer to the configuration data for this instance. */
 	void *conf;
 	/** The task associated with this instance. */
diff --git a/udp_recv.c b/udp_recv.c
index 61b5312f..2657beec 100644
--- a/udp_recv.c
+++ b/udp_recv.c
@@ -23,8 +23,6 @@
 #include "fd.h"
 #include "buffer_tree.h"
 
-/** The size of the receiver node buffer. */
-#define UDP_RECV_CHUNK_SIZE (128 * 1024)
 /**
  * Data specific to the udp receiver.
  *
@@ -97,7 +95,6 @@ static void udp_recv_close(struct receiver_node *rn)
 		close(purd->fd);
 	btr_pool_free(purd->btrp);
 	free(rn->private_data);
-	free(rn->buf);
 }
 
 static void *udp_recv_parse_config(int argc, char **argv)
@@ -181,7 +178,6 @@ static int udp_recv_open(struct receiver_node *rn)
 	char  *iface = c->iface_given ? c->iface_arg : NULL;
 	int ret;
 
-	rn->buf = para_calloc(UDP_RECV_CHUNK_SIZE);
 	rn->private_data = para_calloc(sizeof(struct private_udp_recv_data));
 	purd = rn->private_data;
 
@@ -207,7 +203,6 @@ static int udp_recv_open(struct receiver_node *rn)
 	return purd->fd;
 err:
 	free(rn->private_data);
-	free(rn->buf);
 	return ret;
 }
 
-- 
2.39.5