X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=vss.c;h=3ace49e9e90e8fb27144964a0f61f1fae267e843;hp=cfa64a143cb1f5d665990dc6aeb23ef94d064d4c;hb=e8ca7526ddebc98f3023736f77fa13b65034767b;hpb=c5e38315901ea63efd169af5d4ba3f3c66db7de9 diff --git a/vss.c b/vss.c index cfa64a14..3ace49e9 100644 --- a/vss.c +++ b/vss.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1997-2013 Andre Noll + * Copyright (C) 1997-2014 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -11,8 +11,14 @@ * senders. */ +#include +#include #include #include +#include +#include +#include +#include #include "para.h" #include "error.h" @@ -565,8 +571,14 @@ static int setup_next_fec_group(struct fec_client *fc, struct vss_task *vsst) if (payload_size < g->slice_bytes) memset(fc->extra_header_buf + payload_size, 0, g->slice_bytes - payload_size); - fc->src_data[i] = fc->extra_header_buf; - assert(i == g->num_header_slices - 1); + /* + * There might be more than one header slice to fill although + * only the first one will be used. Set all header slices to + * our extra buffer. + */ + while (i < g->num_header_slices) + fc->src_data[i++] = fc->extra_header_buf; + break; /* we don't want i to be increased. */ } /* @@ -1114,12 +1126,11 @@ static void vss_send(struct vss_task *vsst) } } -static void vss_post_select(struct sched *s, struct task *t) +static int vss_post_select(struct sched *s, struct task *t) { int ret, i; struct vss_task *vsst = container_of(t, struct vss_task, task); - if (mmd->sender_cmd_data.cmd_num >= 0) { int num = mmd->sender_cmd_data.cmd_num, sender_num = mmd->sender_cmd_data.sender_num; @@ -1151,6 +1162,7 @@ static void vss_post_select(struct sched *s, struct task *t) (vss_next() && vss_playing())) tv_add(now, &vsst->announce_tv, &vsst->data_send_barrier); vss_send(vsst); + return 0; } /**