check barriers also in afs_send_chunk()
authorAndre <maan@p133.(none)>
Tue, 9 May 2006 17:25:12 +0000 (19:25 +0200)
committerAndre <maan@p133.(none)>
Tue, 9 May 2006 17:25:12 +0000 (19:25 +0200)
As this function is called even if the select timeout didn't expire,
we'll have to check the eof_barrier and the data_send barrier also
early in afs_send_chunk() and return if there's time left.

afs.c

diff --git a/afs.c b/afs.c
index 0f4cd20..6cc58bb 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -452,6 +452,11 @@ void afs_send_chunk(void)
        afs_next_chunk_time(&due);
        if (tv_diff(&due, &now, NULL) > 0)
                return;
+       if (chk_barrier("eof", &now, &eof_barrier, &due, 1) < 0)
+               return;
+       if (chk_barrier("data send", &now, &data_send_barrier,
+                       &due, 1) < 0)
+               return;
        buf = af->read_chunk(mmd->current_chunk, &ret);
        mmd->new_afs_status_flags &= ~AFS_REPOS;
        if (!buf) {