]> asedeno.scripts.mit.edu Git - PuTTY.git/commit - unix/uxplink.c
New Plink operating mode: 'plink -shareexists'.
authorSimon Tatham <anakin@pobox.com>
Fri, 25 Sep 2015 10:46:28 +0000 (11:46 +0100)
committerSimon Tatham <anakin@pobox.com>
Fri, 25 Sep 2015 11:11:27 +0000 (12:11 +0100)
commit7c2ea22784912b65e19027a9a9cf499258179742
tree0587e0a4ded6a0281481efe03eed1551950788dd
parent14892997d635aaf63d8a9c7630b9bf15389bef04
New Plink operating mode: 'plink -shareexists'.

A Plink invocation of the form 'plink -shareexists <session>' tests
for a currently live connection-sharing upstream for the session in
question. <session> can be any syntax you'd use with Plink to make the
actual connection (a host/port number, a bare saved session name,
-load, whatever).

I envisage this being useful for things like adaptive proxying - e.g.
if you want to connect to host A which you can't route to directly,
and you might already have a connection to either of hosts B or C
which are viable proxies, then you could write a proxy shell script
which checks whether you already have an upstream for B or C and goes
via whichever one is currently active.

Testing for the upstream's existence has to be done by actually
connecting to its socket, because on Unix the mere existence of a
Unix-domain socket file doesn't guarantee that there's a process
listening to it. So we make a test connection, and then immediately
disconnect; hence, that shows up in the upstream's event log.
13 files changed:
putty.h
raw.c
rlogin.c
ssh.c
ssh.h
sshshare.c
telnet.c
testback.c
unix/uxplink.c
unix/uxpty.c
unix/uxser.c
windows/winplink.c
windows/winser.c