- struct dccp_client *dc, *tmp;
- int ret, header_len;
- char *header_buf;
-
- if (listen_fd < 0 || !len)
- return;
-
- list_for_each_entry_safe(dc, tmp, &clients, node) {
- if (!_write_ok(dc->fd))
- 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 = write(dc->fd, header_buf, header_len);
- if (ret != header_len) {
- dccp_shutdown_client(dc);
- continue;
- }
- if (!_write_ok(dc->fd))
- continue;
- }
-// PARA_DEBUG_LOG("writing %d bytes to fd %d\n", len, dc->fd);
- ret = write(dc->fd, buf, len);
- if (ret != len)
- dccp_shutdown_client(dc);
- }