/** the list of connected clients **/
static struct list_head clients;
static int listen_fd = -1;
/** the list of connected clients **/
static struct list_head clients;
static int listen_fd = -1;
/*
* Bypass unused CCID paths: the sender does not receive application data
* from the client; by shutting down this unused communication path we can
* reduce processing costs a bit. See analogous comment in dccp_recv.c.
*/
/*
* Bypass unused CCID paths: the sender does not receive application data
* from the client; by shutting down this unused communication path we can
* reduce processing costs a bit. See analogous comment in dccp_recv.c.
*/
dc->name = make_message("%s", remote_name(dc->fd));
PARA_NOTICE_LOG("connection from %s\n", dc->name);
para_list_add(&dc->node, &clients);
add_close_on_fork_list(dc->fd);
dc->name = make_message("%s", remote_name(dc->fd));
PARA_NOTICE_LOG("connection from %s\n", dc->name);
para_list_add(&dc->node, &clients);
add_close_on_fork_list(dc->fd);
while (written < len) {
ret = write(fd, buf + written, PARA_MIN(1024, len - written));
/*
while (written < len) {
ret = write(fd, buf + written, PARA_MIN(1024, len - written));
/*
- * Error handling: CCID3 has a sending wait queue which fills up and is
- * emptied asynchronously. The EAGAIN case means that there is currently
- * no space in the wait queue, but this can change at any moment and is
- * thus not an error condition.
+ * Error handling: CCID3 has a sending wait queue which fills
+ * up and is emptied asynchronously. The EAGAIN case means that
+ * there is currently no space in the wait queue, but this can
+ * change at any moment and is thus not an error condition.
list_for_each_entry_safe(dc, tmp, &clients, node) {
if (!dc->header_sent && current_chunk) {
list_for_each_entry_safe(dc, tmp, &clients, node) {
if (!dc->header_sent && current_chunk) {
header_buf = vss_get_header(&header_len);
if (header_buf && header_len > 0) {
if (queue_chunk_or_shutdown(dc, -1U, 0) < 0)
header_buf = vss_get_header(&header_len);
if (header_buf && header_len > 0) {
if (queue_chunk_or_shutdown(dc, -1U, 0) < 0)
// PARA_DEBUG_LOG("writing %d bytes to fd %d\n", len, dc->fd);
ret = dccp_write(dc->fd, buf, len);
if (ret < 0) {
// PARA_DEBUG_LOG("writing %d bytes to fd %d\n", len, dc->fd);
ret = dccp_write(dc->fd, buf, len);
if (ret < 0) {
s->client_cmds[SENDER_ALLOW] = NULL;
s->client_cmds[SENDER_ADD] = NULL;
s->client_cmds[SENDER_DELETE] = NULL;
s->client_cmds[SENDER_ALLOW] = NULL;
s->client_cmds[SENDER_ADD] = NULL;
s->client_cmds[SENDER_DELETE] = NULL;