]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
read faster images
authorBastian Dehn <hhaalo@arcor.de>
Tue, 27 Feb 2024 16:51:12 +0000 (17:51 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 27 Feb 2024 17:03:43 +0000 (18:03 +0100)
src/kds_s2000w_handler.c
src/kds_s2000w_net.c

index 98110a33c558252982d4a96d39deae627ee7a288..842c0d756bd137707fe2caeaaccacc659297f760 100644 (file)
@@ -111,7 +111,6 @@ void _delete_current_image(handler* h)
        kds_s2000w_client_response_free(resp);
        resp = NULL;
        h->current_scan_status->available_images--;
-       sleep(1);
 }
 
 void _download_current_image(handler* h)
@@ -133,7 +132,6 @@ void _download_current_image(handler* h)
        kds_s2000w_client_response_free(resp);
        resp = NULL;
        h->current_scan_status->downloaded_images++;
-       sleep(1);
 }
 
 void _get_current_scan_status(handler* h)
@@ -162,7 +160,6 @@ void _get_current_scan_status(handler* h)
        status_resp_obj = NULL;
        kds_s2000w_client_response_free(resp);
        resp = NULL;
-       sleep(1);
 }
 
 handler* init_handler()
index 10f96b401f240ca162bbf05fe06c6cc175c61c1f..bf159d5a779dde5c77f5d5a187ed95f0b38020fb 100644 (file)
@@ -174,14 +174,14 @@ SANE_Status _sane_kds_s2000w_net_start(SANE_Handle handle)
        }
 
        for (int i = 0; i < 10; i++) {
-               sleep(1);
                kds_s2000w_handler_get_parameters(h);
                if (h->current_metadata->valid)
                        break;
        }
 
        if (h->current_scan_status->complete_scanned
-               && h->current_scan_status->current_image_number >= h->current_scan_status->downloaded_images)
+               && h->current_scan_status->current_image_number >= h->current_scan_status->downloaded_images
+               && h->current_scan_status->available_images <= 0)
                return SANE_STATUS_NO_DOCS;
 
        return SANE_STATUS_GOOD;