From: Bastian Dehn Date: Sun, 4 Feb 2024 12:06:33 +0000 (+0100) Subject: sane must cancel by sane status eof X-Git-Tag: v1.0.0^2~345 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=c6dc5055a3a991c238bd61ffcc41828971230bdf;p=sane-kds-s2000w-net.git sane must cancel by sane status eof --- diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index 753a262..fc9386a 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -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) {