#include "dccp_recv.cmdline.h"
-/** the size of the output buffer */
-#define DCCP_BUFSIZE 40960
-
/**
* data specific to the dccp receiver
*
if (pdd && pdd->fd > 0)
close(pdd->fd);
- free(rn->buf);
- rn->buf = NULL;
free(rn->private_data);
rn->private_data = NULL;
}
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;
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)
#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
*
close(phd->fd);
btr_pool_free(phd->btrp);
- free(rn->buf);
free(rn->private_data);
}
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;
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;
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. */
#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.
*
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)
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;
return purd->fd;
err:
free(rn->private_data);
- free(rn->buf);
return ret;
}