Kill fields buf, loaded and output_error of struct receiver node.
authorAndre Noll <maan@systemlinux.org>
Wed, 13 Jan 2010 01:54:02 +0000 (02:54 +0100)
committerAndre Noll <maan@systemlinux.org>
Wed, 13 Jan 2010 01:54:02 +0000 (02:54 +0100)
dccp_recv.c
http_recv.c
recv.c
recv.h
udp_recv.c

index dae3bcb..0b62529 100644 (file)
@@ -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)
index cdb4bc1..035d1f1 100644 (file)
@@ -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 70866a3..05f616c 100644 (file)
--- 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 20dd9b8..837cf47 100644 (file)
--- a/recv.h
+++ b/recv.h
 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. */
index 61b5312..2657bee 100644 (file)
@@ -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;
 }