+ int ret = xwrite(sc->fd, buf, len);
+
+ if (ret < 0)
+ dccp_shutdown_client(sc);
+}
+
+static void dccp_post_select(fd_set *rfds, __a_unused fd_set *wfds)
+{
+ struct sender_client *sc;
+ struct dccp_fec_client *dfc;
+ int tx_ccid;
+ uint32_t k, n;
+
+ sc = accept_sender_client(dss, rfds);
+ if (!sc)
+ return;
+
+ /* 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 \ref 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;
+ }
+ dfc->fcp.init_fec = dccp_init_fec;
+ dfc->fcp.send_fec = dccp_send_fec;
+ dfc->fcp.need_periodic_header = false;
+ dfc->fc = vss_add_fec_client(sc, &dfc->fcp);