X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinplink.c;h=8ffa4651030c9901b5a2f3d0923af1424f29b381;hb=9f9d72ec58642e91b4f93ee4405a8086ee2fb2f0;hp=43f53bb0426829891504e07b911b9b870b660fd0;hpb=b266d671acee34f9305950bfd87054b3b7fcded6;p=PuTTY.git diff --git a/windows/winplink.c b/windows/winplink.c index 43f53bb0..8ffa4651 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -303,6 +303,7 @@ int main(int argc, char **argv) int errors; int got_host = FALSE; int use_subsystem = 0; + int just_test_share_exists = FALSE; unsigned long now, next, then; sklist = NULL; @@ -364,6 +365,8 @@ int main(int argc, char **argv) } else if (!strcmp(p, "-pgpfp")) { pgp_fingerprints(); exit(1); + } else if (!strcmp(p, "-shareexists")) { + just_test_share_exists = TRUE; } else { fprintf(stderr, "plink: unknown option \"%s\"\n", p); errors = 1; @@ -596,6 +599,19 @@ int main(int argc, char **argv) logctx = log_init(NULL, conf); console_provide_logctx(logctx); + 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. */