Bug 3456 - Windows client hangs if login procedure fails
Summary: Windows client hangs if login procedure fails
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Client (show other bugs)
Version: 3.0.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.1.0
Assignee: Pierre Ossman
Keywords: astrand_tester
Depends on:
Reported: 2010-03-24 14:19 CET by Peter Åstrand
Modified: 2013-05-21 09:40 CEST (History)
0 users

See Also:
Acceptance Criteria:


Description Peter Åstrand cendio 2010-03-24 14:19:13 CET
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 Pierre Ossman cendio 2012-12-11 11:19:43 CET
We're doing b3183 so assume this will get solved there.
Comment 2 Pierre Ossman cendio 2013-03-13 16:17:09 CET
Fixed in r26736 (with a lot of support code from earlier work).
Comment 3 Peter Åstrand cendio 2013-05-21 09:40:30 CEST
Works great.

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