]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix completed cancel simple scan
authorBastian Dehn <hhaalo@arcor.de>
Tue, 24 Dec 2024 11:25:31 +0000 (12:25 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 24 Dec 2024 11:25:31 +0000 (12:25 +0100)
src/kds_s2000w_net.c

index 6fa9159ae941dcfe81adb1a0cfec8c2dd0a6066e..17ef585948703ff46441c7be8d91981166932e35 100644 (file)
@@ -146,10 +146,13 @@ void _sane_kds_s2000w_net_cancel(SANE_Handle handle)
 #endif
 
        handler* h = (handler*) handle;
+       if (h->current_scan_status->complete_scanned > 0) {
+               reset_handler(h);
+               return;
+       }
+
        h->read_info->cancel = 1;
        kds_s2000w_handler_stop_scan(h);
-
-       return;
 }
 
 SANE_Status _sane_kds_s2000w_net_get_parameters(SANE_Handle handle,