Re: SANE protocol error ?

From: Henning Meier-Geinitz (henning@meier-geinitz.de)
Date: Sat May 19 2001 - 09:40:11 PDT

  • Next message: Henning Meier-Geinitz: "Re: Return values of sane_init() (Was: EOF detection)"

    Hi,

    On Mon, Apr 30, 2001 at 12:07:41AM +0200, Petter Reinholdtsen wrote:
    > If I understand correctly, the function sanei_w_control_option_req()
    > will try to send the value of the option even if the action is
    > SANE_ACTION_GET_VALUE, and thus mostly send uninitialized values to
    > the SANE server. I haven't examined this part, but I suspect the
    > server ignore the value, and send a reply with the value of the
    > option.

    Not exactly. It just send the data to sane_control_option, where it's
    overwritten if action is SANE_ACTION_GET_VALUE.

    > Why isn't the test == SANE_ACTION_GET_VALUE?

    I don't know. Probably this was forgotten when the bug concerning
    SET_AUTO was found.

    > What would be the effect of changing this test to only send the value
    > if it contains anything interesting?

    I think there wouldn't be a problem. But the net protocl version
    number must be increased and yet another test for this version number
    has to be inserted so the new version remains compatible to old saned/net.
    I'm not sure if it's worth it.

    > The problem is triggered by
    > calls like:
    >
    > SANE_Int num_dev_options;
    > status = sane_control_option (device, 0, SANE_ACTION_GET_VALUE,
    > &num_dev_options, 0);
    >
    > In this case, the 'value' of num_dev_options is pushed on the wire.

    Yes, but isn't the only problem with this that some garbage is
    transported through the wire?

    Bye,
      Henning

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Sat May 19 2001 - 09:47:16 PDT