[sane-devel] bug in test backend

Oliver Rauch oliver.rauch at rauch-domain.de
Wed Dec 18 16:01:34 GMT 2002


On Wednesday 18 December 2002 12:26, Henning Meier-Geinitz wrote:
>
> > It also does make sense to allow sane_control_option etc
> > after EOF although that is not explictly shown in the code flow example.
>
> If I understand the code flow correctly, sane_cancel must be called if
> anything but sane_start, sane_read, or sane_get_parameters should be
> called.

Although I do not like this I get the impression that you describe the idea
how it should be handled.


> Have I said before that I don't like the double meaning of
> sane_cancel ("stop current action" + "this was the last scan in a
> series")? :-)
>
> The frame is over after EOF. So why do we need sane_cancel here in
> normal operation?

I think the intention is to make sure that the backend nows that the
frontend will not ask for any additional images.

What I remember about some discussions with David Mosberger and Andreas Beck 
is the following example:

we have a scanner that produces several images at the same time.
- sane_start is called the first time => e.g. 10 images are scanned at the 
same time.
- sane_read until EOF => first image is transmitted to the frontend
- sane_start
- sane_read until EOF => second image is transmitted to the frontend

when the frontend does not ask for more images and does not call sane_cancel 
then the backend does not know that it can throw awy the last eight images.

so a sane_start indicates: give me more
a sane_cancel indicates: throw away the rest.

Oliver



-- 
http://www.xsane.org
http://www.mostang.com/sane
http://www.rauch-domain.de
mailto:Oliver.Rauch at Rauch-Domain.DE



More information about the sane-devel mailing list