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 0712cc2..a73b18e 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 d317c34..9c8ef85 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;