Bug 3456 - Windows client hangs if login procedure fails
: Windows client hangs if login procedure fails
: ThinLinc
: 3.0.0
: PC Unknown
: P2 Normal
: 4.1.0
Assigned To:
  Show dependency treegraph
Reported: 2010-03-24 14:19 by
Modified: 2013-05-21 09:40 (History)
Acceptance Criteria:



You need to log in before you can comment on or make changes to this bug.

Description From cendio 2010-03-24 14:19:13
The login procedure can fail. This can be either because thinlinc-login does
something wrong, or in that vsmserver gives an invalid response. We have a
mechanism to deal with this: In this case, thinlinc-login reports "ERROR". For
example, it can report:

THINLINC-LOGIN: ERROR: Unexpected EOF while reading HTTP message

This works fine with the Linux client, but not with the Windows one. On Linux,
this seems to work. Running this test:

/opt/thinlinc/lib/tlclient/ssh -N demo.thinlinc.com false

and stracing ssh shows that ssh closes stdin and stdout after the command has
finished. (Note, however, that SSH and the connection should continue running.
This is by design, so that we can fallback to use a TCP tunnel to old
vsmservers which lacks thinlinc-login.). I guess in this case, xmlrpc++ will
raise an exception, since it got EOF. 

On Windows, this doesn't work. I don't know the details of xmlrpc++, but
tlclient_ssh has logic for handling a ERROR_BROKEN_PIPE from ReadFile. If
xmlrpc++ also has this, the problem is most likely that Putty does not close
the output handle after the command is finished. It looks like that from a
quick glance at the code:

        if (console_backend_mode) {
        fprintf(stderr, "COMMAND_EXITSTATUS: %d\n", ssh->exitcode);

A flush, but no close. 

This problem has been verified both with the nightly build (3.1-ish) as well as
3.0.0. One idea is to simply start migrating away from Putty to OpenSSH 
(bug 3183).
------- Comment #1 From cendio 2012-12-11 11:19:43 -------
We're doing b3183 so assume this will get solved there.
------- Comment #2 From cendio 2013-03-13 16:17:09 -------
Fixed in r26736 (with a lot of support code from earlier work).
------- Comment #3 From cendio 2013-05-21 09:40:30 -------
Works great.