net backend problems (was: Re: [sane-devel] a backend test)
mh
crapsite at gmx.net
Wed Mar 20 10:01:57 GMT 2002
Henning Meier-Geinitz, Mittwoch, 20. März 2002 00:00:
...
> That doesn't mean that I don't find bugs but they are located in the
> backends not in tst-backend currently. I'm looking into the net
> backend and wire code currently. Lots of pleasure...
While you're working on the net backend, could you please take a look at the
following problem ? It was introduced by a patch to solve the endianness
problems, which I send to the list last year and which you applied, after no
one complaint.
This code will blow up, if e.g. a frontend requests only one byte or if
calling read() (in sane_read()) results in nread == 1.
In this case, the frontend/net backend will hang forever.
If you don't have a better solution already, please review the attached
patch.
To make testing a little easier, the patched net backend reads the
environment variable SANE_FORCE_WRONG_ENDIANNESS. If you set it,
you can test byte-swapping also, if server/client have the same byte order.
To test scanning "one byte at a time", either hack the frontend, or uncomment
the line
/* max_length = 1;*/
in sane_read().
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: net.patch
Type: text/x-diff
Size: 8572 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20020320/183039af/attachment.patch>
More information about the sane-devel
mailing list