X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=dccp_send.c;h=55454aaa30c807bcec4f26ad8be6cd01a3bc2085;hb=2204e02fa430b2506bb499389777973ea397148e;hp=5449a6a9664f070b0115d3bdb2a6f9471718f796;hpb=d85091bebd5abb6f473a31dd118f4d853d1317c9;p=paraslash.git diff --git a/dccp_send.c b/dccp_send.c index 5449a6a9..55454aaa 100644 --- a/dccp_send.c +++ b/dccp_send.c @@ -188,13 +188,10 @@ static void dccp_send(long unsigned current_chunk, struct dccp_client *dc, *tmp; int ret; char *header_buf; - size_t header_len; - - if (listen_fd < 0 || !len) - return; 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) @@ -207,6 +204,8 @@ static void dccp_send(long unsigned current_chunk, 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) {