[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-hackers] Re: lshd interruption problem

From: Niels Möller
Subject: [Savannah-hackers] Re: lshd interruption problem
Date: 05 Jun 2002 15:47:43 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Loic Dachary <address@hidden> writes:

>       Yes but lshd fails to do something so that the shell process
> notices that the connection goes down. A similar problems shows with
> rms who is using lsh to connect to the machine. There are many pending
> shells because they were apparently not notified that the connection
> went down. These shells have a pty instead of a unix socket though:

pty:s are different. There's no really good way to ensure that
processes on the slave side of a pty gets EOF on read. The current
code (since 1.3.6 or something like that) writes the character 4 (^D)
to the master side before closing it. I stole that trick from emacs

That's not quite right, but about the best solution that I can come up
with. The Right Thing would be to hack the pty implementation to have
a mode in which all future reads on the slave side will return 0, and
enable that mode via ioctl() or shutdown().

When looking at the code, it seems the non-pty case is also
improved in 1.4, it calls shutdown() on the stdin pipe. Both these
cases mainly affect the case of an orderly shutdown of the channel,
though.  The src/server_session.c:do_eof is the function where this

Bottom line is that I think lsh-1.4 will work better, and that I'd
like to hear about any problems that remain.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]