sane-project-website/old-archive/2001-04/0310.html

111 wiersze
4.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: SANE protocol error ?</TITLE>
<META NAME="Author" CONTENT="Petter Reinholdtsen (pere@hungry.com)">
<META NAME="Subject" CONTENT="SANE protocol error ?">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>SANE protocol error ?</H1>
<!-- received="Sun Apr 29 15:01:07 2001" -->
<!-- isoreceived="20010429220107" -->
<!-- sent="Mon, 30 Apr 2001 00:07:41 +0200" -->
<!-- isosent="20010429220741" -->
<!-- name="Petter Reinholdtsen" -->
<!-- email="pere@hungry.com" -->
<!-- subject="SANE protocol error ?" -->
<!-- id="E14tzLx-0004MH-00@minerva" -->
<STRONG>From:</STRONG> Petter Reinholdtsen (<A HREF="mailto:pere@hungry.com?Subject=Re:%20SANE%20protocol%20error%20?&In-Reply-To=&lt;E14tzLx-0004MH-00@minerva&gt;"><EM>pere@hungry.com</EM></A>)<BR>
<STRONG>Date:</STRONG> Sun Apr 29 2001 - 15:07:41 PDT
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0311.html">mKlein: "same old &quot;no device&quot; problem"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0309.html">Petter Reinholdtsen: "Re: scanimage -T using Purify..."</A>
<!-- nextthread="start" -->
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#310">[ date ]</A>
<A HREF="index.html#310">[ thread ]</A>
<A HREF="subject.html#310">[ subject ]</A>
<A HREF="author.html#310">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
If I understand correctly, the function sanei_w_control_option_req()
<BR>
will try to send the value of the option even if the action is
<BR>
SANE_ACTION_GET_VALUE, and thus mostly send uninitialized values to
<BR>
the SANE server. I haven't examined this part, but I suspect the
<BR>
server ignore the value, and send a reply with the value of the
<BR>
option. The code looks like this:
<BR>
<P>&nbsp;&nbsp;/* Up to and including version 2, we incorrectly attempted to encode
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the option value even the action was SANE_ACTION_SET_AUTO. */
<BR>
&nbsp;&nbsp;if (w-&gt;version &lt; 3 || req-&gt;action != SANE_ACTION_SET_AUTO)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sanei_w_word (w, &amp;req-&gt;value_type);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sanei_w_word (w, &amp;req-&gt;value_size);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;w_option_value (w, req-&gt;value_type, req-&gt;value_size, &amp;req-&gt;value);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
<P>Why isn't the test == SANE_ACTION_GET_VALUE? What would be the effect
<BR>
of changing this test to only send the value if it contains anything
<BR>
interesting? The problem is triggered by calls like:
<BR>
<P>&nbsp;&nbsp;SANE_Int num_dev_options;
<BR>
&nbsp;&nbsp;status = sane_control_option (device, 0, SANE_ACTION_GET_VALUE,
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;num_dev_options, 0);
<BR>
<P>In this case, the 'value' of num_dev_options is pushed on the wire.
<BR>
<PRE>
--
##&gt; Petter Reinholdtsen &lt;## | <A HREF="mailto:pere@td.org.uit.no?Subject=Re:%20SANE%20protocol%20error%20?&In-Reply-To=&lt;E14tzLx-0004MH-00@minerva&gt;">pere@td.org.uit.no</A>
<P>--
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20SANE%20protocol%20error%20?&In-Reply-To=&lt;E14tzLx-0004MH-00@minerva&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0311.html">mKlein: "same old &quot;no device&quot; problem"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0309.html">Petter Reinholdtsen: "Re: scanimage -T using Purify..."</A>
<!-- nextthread="start" -->
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#310">[ date ]</A>
<A HREF="index.html#310">[ thread ]</A>
<A HREF="subject.html#310">[ subject ]</A>
<A HREF="author.html#310">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Sun Apr 29 2001 - 15:01:39 PDT</EM>
</EM>
</SMALL>
</BODY>
</HTML>