- if (tv_diff(&due, now, NULL) <= 0) {
- char *buf;
- size_t len;
-
- if (!mmd->chunks_sent) {
- mmd->stream_start = *now;
- mmd->events++;
- set_mmd_offset();
- }
- vss_get_chunk(mmd->current_chunk, vsst, &buf, &len);
- for (i = 0; senders[i].name; i++) {
- /*
- * We call ->send() even if len is zero because senders
- * might have data queued which can be sent now.
- */
- if (!senders[i].send)
- continue;
- senders[i].send(mmd->current_chunk, mmd->chunks_sent,
- buf, len, vsst->header_buf, vsst->header_len);
- }
+ if (tv_diff(&due, now, NULL) > 0)
+ return;
+ if (!mmd->chunks_sent) {
+ mmd->stream_start = *now;
+ mmd->events++;
+ set_mmd_offset();
+ }
+ ret = vss_get_chunk(mmd->current_chunk, vsst, &buf, &len);
+ if (ret < 0) {
+ PARA_ERROR_LOG("could not get chunk %lu: %s\n",
+ mmd->current_chunk, para_strerror(-ret));
+ } else {