[sane-devel] bug in test backend

Oliver Rauch oliver.rauch@rauch-domain.de
Wed, 18 Dec 2002 17:01:34 +0100


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 examp=
le.
>
> 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 id=
ea
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 B=
eck=20
is the following example:

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

when the frontend does not ask for more images and does not call sane_can=
cel=20
then the backend does not know that it can throw awy the last eight image=
s.

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

Oliver



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