com_next() fix.
authorAndre <maan@p133.(none)>
Sat, 25 Mar 2006 19:59:21 +0000 (20:59 +0100)
committerAndre <maan@p133.(none)>
Sat, 25 Mar 2006 19:59:21 +0000 (20:59 +0100)
Do not clear the AFS_NEXT flag in afs_send_chunk() and increase mmd->events.
Fixes a (rare) problem where the next command did not work.

afs.c
command.c

diff --git a/afs.c b/afs.c
index 0712cc2720683b3fa8f08194eba95fd5691ab996..a73b18e0596427dd2c24a31c4668d42c708ce572 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -454,7 +454,7 @@ void afs_send_chunk(void)
        if (tv_diff(&due, &now, NULL) > 0)
                return;
        buf = af->read_chunk(mmd->current_chunk, &ret);
-       mmd->new_afs_status_flags &= ~(AFS_NEXT | AFS_REPOS);
+       mmd->new_afs_status_flags &= ~AFS_REPOS;
        if (!buf) {
                if (ret < 0)
                        mmd->new_afs_status_flags = AFS_NEXT;
index d317c345314908b4629d7452e2f5fec4cb172f67..9c8ef85c4304f4c3fdcd10ae4117b866c3e2270e 100644 (file)
--- a/command.c
+++ b/command.c
@@ -879,6 +879,7 @@ static int com_next(__unused int socket_fd, int argc, __unused char **argv)
        if (argc)
                return -E_COMMAND_SYNTAX;
        mmd_lock();
+       mmd->events++;
        mmd->new_afs_status_flags |= AFS_NEXT;
        mmd_unlock();
        return 1;