- 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)
- continue;
- }
- dc->header_sent = 1;
- }
- ret = send_queued_chunks(dc);
- if (ret < 0) {
- dccp_shutdown_client(dc);
- continue;
- }
-// PARA_DEBUG_LOG("writing %d bytes to fd %d\n", len, dc->fd);
- ret = dccp_write(dc->fd, buf, len);
- if (ret < 0) {
- PARA_NOTICE_LOG("%s\n", PARA_STRERROR(-ret));
- dccp_shutdown_client(dc);
- continue;
- }
- if (ret != len)
- queue_chunk_or_shutdown(dc, current_chunk, ret);
+ /* If CCID identifiable, present client as <host>#<port>~<ccid> */
+ tx_ccid = dccp_get_tx_ccid(sc->fd);
+ if (tx_ccid != -1) {
+ char *tmp = make_message("%s~%d", sc->name, tx_ccid);
+
+ free(sc->name);
+ sc->name = tmp;
+ }
+ /*
+ * 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.
+ */
+ if (shutdown(sc->fd, SHUT_RD) < 0) {
+ PARA_WARNING_LOG("%s\n", strerror(errno));
+ shutdown_client(sc, dss);
+ return;
+ }
+ dfc = para_calloc(sizeof(*dfc));
+ sc->private_data = dfc;
+ k = OPT_UINT32_VAL(DCCP_DATA_SLICES_PER_GROUP);
+ n = OPT_UINT32_VAL(DCCP_SLICES_PER_GROUP);
+ if (k == 0 || n == 0 || k >= n) {
+ PARA_WARNING_LOG("invalid FEC parameters, using defaults\n");
+ dfc->fcp.data_slices_per_group = 3;
+ dfc->fcp.slices_per_group = 4;
+ } else {
+ dfc->fcp.data_slices_per_group = k;
+ dfc->fcp.slices_per_group = n;