SANE protocol error ?

From: Petter Reinholdtsen (pere@hungry.com)
Date: Sun Apr 29 2001 - 15:07:41 PDT

  • Next message: mKlein: "same old "no device" problem"

    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. The code looks like this:

      /* Up to and including version 2, we incorrectly attempted to encode
         the option value even the action was SANE_ACTION_SET_AUTO. */
      if (w->version < 3 || req->action != SANE_ACTION_SET_AUTO)
        {
          sanei_w_word (w, &req->value_type);
          sanei_w_word (w, &req->value_size);
          w_option_value (w, req->value_type, req->value_size, &req->value);
        }

    Why isn't the test == SANE_ACTION_GET_VALUE? What would be the effect
    of changing this test to only send the value if it contains anything
    interesting? 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.

    -- 
    ##>  Petter Reinholdtsen  <##  |  pere@td.org.uit.no
    

    -- 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 : Sun Apr 29 2001 - 15:01:39 PDT