X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxplink.c;h=8351a6ea7280528acbe8660a0db18e66237823c0;hb=48eafd66aa274c32fc8169a0d36619663905c210;hp=64c3cabcdacc66afd58e6ec87b9684e14725a863;hpb=9e20c81bc9c945565dd182854eeffa03b63f830a;p=PuTTY.git diff --git a/unix/uxplink.c b/unix/uxplink.c index 64c3cabc..8351a6ea 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -533,8 +533,8 @@ void sigwinch(int signum) * In Plink our selects are synchronous, so these functions are * empty stubs. */ -int uxsel_input_add(int fd, int rwx) { return 0; } -void uxsel_input_remove(int id) { } +uxsel_id *uxsel_input_add(int fd, int rwx) { return NULL; } +void uxsel_input_remove(uxsel_id *id) { } /* * Short description of parameters. @@ -581,6 +581,8 @@ static void usage(void) printf(" -N don't start a shell/command (SSH-2 only)\n"); printf(" -nc host:port\n"); printf(" open tunnel in place of session (SSH-2 only)\n"); + printf(" -shareexists\n"); + printf(" test whether a connection-sharing upstream exists\n"); exit(1); } @@ -607,6 +609,7 @@ int main(int argc, char **argv) int errors; int use_subsystem = 0; int got_host = FALSE; + int just_test_share_exists = FALSE; unsigned long now; struct winsize size; @@ -685,6 +688,8 @@ int main(int argc, char **argv) --argc; provide_xrm_string(*++argv); } + } else if (!strcmp(p, "-shareexists")) { + just_test_share_exists = TRUE; } else { fprintf(stderr, "plink: unknown option \"%s\"\n", p); errors = 1; @@ -959,6 +964,19 @@ int main(int argc, char **argv) !conf_get_str_nthstrkey(conf, CONF_portfwd, 0)) conf_set_int(conf, CONF_ssh_simple, TRUE); + if (just_test_share_exists) { + if (!back->test_for_upstream) { + fprintf(stderr, "Connection sharing not supported for connection " + "type '%s'\n", back->name); + return 1; + } + if (back->test_for_upstream(conf_get_str(conf, CONF_host), + conf_get_int(conf, CONF_port), conf)) + return 0; + else + return 1; + } + /* * Start up the connection. */