- list_for_each_entry_safe(dc, tmp, &clients, node) {
- ret = write_ok(dc->fd);
- if (ret < 0) {
- dccp_shutdown_client(dc);
- continue;
- }
- if (!ret)
- continue;
- if (!dc->header_sent && af->get_header_info && current_chunk) {
- header_buf = af->get_header_info(&header_len);
- if (!header_buf || header_len <= 0)
- continue; /* header not yet available */
- ret = dccp_write(dc->fd, header_buf, header_len);
- if (ret != header_len) {
- int err = errno;
- PARA_ERROR_LOG("header write: %d/%d (%s)\n",
- ret, header_len, ret < 0?
- strerror(err) : "");
- dccp_shutdown_client(dc);
- continue;
- }
- dc->header_sent = 1;
- ret = write_ok(dc->fd);
- if (ret < 0) {
- dccp_shutdown_client(dc);
- continue;
- }
- if (!ret)
- continue;
- }
-// PARA_DEBUG_LOG("writing %d bytes to fd %d\n", len, dc->fd);
- ret = dccp_write(dc->fd, buf, len);
- if (ret != len)
- dccp_shutdown_client(dc);
+ /* 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;