Re: xsane requests username and password after saned has exited

From: Nick Lamb (
Date: Mon Jun 04 2001 - 11:44:22 PDT

  • Next message: Henning Meier-Geinitz: "Semaphores (sys/sem.h) in sane-backends"

    On Mon, Jun 04, 2001 at 02:51:10PM +0200, Oliver Rauch wrote:
    > Hi Nick,
    > I think the reason is if the frontend dies and does not inform saned to exit
    > then saned never will exit at all.

    Without trying it my understanding is that on anything vaguely modern
    (are people trying to use SANE from DOS? from Windows 3.1?) the TCP stack
    is an OS component and will perform a full TCP shutdown on behalf of the
    frontend. So this can ONLY happen when a user turns off their PC while
    using the frontend -- little wonder that things break if you do that!

    Does anyone have evidence to contradict that? Once again I ask for the
    person who added this watchdog timer kludge to step forward.

    > The fork() in sane-net has the advantage that the network protocol works
    > invisiblie for the fronten, no frontend has to care about.
    > The advantage of the frontend initiated keep alive package is that we
    > donīt need to create a separate keep-alive process.
    > May be we could define a well_known_option "create_keepalives" that can be
    > set by GUI-frontends, so for command-line-frontends the fork() is not called.

    I think this problem (user turns off PC while using scanner remotely)
    is rare enough not to require extreme measures. Try this instead, one
    step at a time

    0. Eliminate the watchdog timer
       This will make SANE behave properly for the _normal_ case

    1. Turn on TCP keep alive socket option in saned where available
       This makes it recover (eventually) from PC crash

    2. Permit null operation/ null result packets from the server
       and send these to elicit ACK vs RST indicator from client TCP stack

    Note that the first two require NO CHANGE to the remote client, and
    the last one if it turns out to be necessary requires only some
    small changes, maybe a dozen lines.


    Source code, list archive, and docs:
    To unsubscribe: echo unsubscribe sane-devel | mail

    This archive was generated by hypermail 2b29 : Mon Jun 04 2001 - 11:43:56 PDT