]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - vss.c
vss: Make fec_active a bool.
[paraslash.git] / vss.c
diff --git a/vss.c b/vss.c
index b73562f9733a98e1bea760ea109f1a7cf883d426..30285aeff5441e540f66dc92afc8b0717a60d9b5 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -1024,7 +1024,8 @@ err:
  */
 static void vss_send(struct vss_task *vsst)
 {
-       int i, fec_active = 0;
+       int i;
+       bool fec_active = false;
        struct timeval due;
        struct fec_client *fc, *tmp_fc;
 
@@ -1038,7 +1039,7 @@ static void vss_send(struct vss_task *vsst)
                if (fc->state == FEC_STATE_DISABLED)
                        continue;
                if (!next_slice_is_due(fc, NULL)) {
-                       fec_active = 1;
+                       fec_active = true;
                        continue;
                }
                if (compute_next_fec_slice(fc, vsst) <= 0)
@@ -1048,7 +1049,7 @@ static void vss_send(struct vss_task *vsst)
                fc->current_slice_num++;
                fc->fcp->send_fec(fc->sc, (char *)fc->enc_buf,
                        fc->group.slice_bytes + FEC_HEADER_SIZE);
-               fec_active = 1;
+               fec_active = true;
        }
        if (mmd->current_chunk >= mmd->afd.afhi.chunks_total) { /* eof */
                if (!fec_active)
@@ -1066,13 +1067,12 @@ static void vss_send(struct vss_task *vsst)
                        mmd->events++;
                        set_mmd_offset();
                }
-               /*
-                * We call the send function also in case of empty chunks as
-                * they might have still some data queued which can be sent in
-                * this case.
-                */
                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,