]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
sane must cancel by sane status eof
authorBastian Dehn <hhaalo@arcor.de>
Sun, 4 Feb 2024 12:06:33 +0000 (13:06 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 4 Feb 2024 12:06:33 +0000 (13:06 +0100)
src/kds_s2000w_net.c

index 753a2624268d8ccfad4aeea40247fea2ce569c82..fc9386ad9ac9aae1d35b86c764687b348162a88a 100644 (file)
@@ -207,6 +207,12 @@ SANE_Status _sane_kds_s2000w_net_start(SANE_Handle handle)
        return SANE_STATUS_GOOD;
 }
 
+void _sane_kds_s2000w_net_cancel(SANE_Handle handle)
+{
+       cancel = 1;
+       return;
+}
+
 SANE_Status _sane_kds_s2000w_net_read(SANE_Handle handle, SANE_Byte* data,
        SANE_Int max_length, SANE_Int* length)
 {
@@ -214,6 +220,7 @@ SANE_Status _sane_kds_s2000w_net_read(SANE_Handle handle, SANE_Byte* data,
        if (read_size >= current_metadata.size) {
                read_size = 0;
                return SANE_STATUS_EOF;
+               _sane_kds_s2000w_net_cancel(NULL);
        }
 
        int length_count = 0;
@@ -238,12 +245,6 @@ SANE_Status _sane_kds_s2000w_net_read(SANE_Handle handle, SANE_Byte* data,
        return SANE_STATUS_GOOD;
 }
 
-void _sane_kds_s2000w_net_cancel(SANE_Handle handle)
-{
-       cancel = 1;
-       return;
-}
-
 SANE_Status _sane_kds_s2000w_net_set_io_mode(SANE_Handle handle,
        SANE_Bool non_blocking)
 {