- list_for_each_entry_safe(dc, tmp, &clients, node) {
- if (!dc->header_sent && current_chunk) {
- size_t header_len;
- 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;
- }
- if (!len)
- 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);
- }
-}
-
-static void dccp_shutdown_clients(void)