X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=vss.c;h=d6f914e72870efb58b8fd81570e31e0b939a4c2e;hp=aec357ab7e5bdd936e438412a3c94216c72bbff2;hb=9c1aa53f0cda586aa13a022452d16a2704055578;hpb=e065f3eec9be99d82da855bf3da38d8e86752fef diff --git a/vss.c b/vss.c index aec357ab..d6f914e7 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. */ } /* @@ -912,7 +924,8 @@ static void vss_pre_select(struct sched *s, struct task *t) tv_add(now, &vsst->announce_tv, &vsst->data_send_barrier); set_eof_barrier(vsst); mmd->chunks_sent = 0; - mmd->current_chunk = mmd->repos_request; + mmd->current_chunk = afh_get_start_chunk(mmd->repos_request, + &mmd->afd.afhi); mmd->new_vss_status_flags &= ~VSS_REPOS; set_mmd_offset(); }