diff --git a/putty.h b/putty.h index 0fac7592..d1136bfb 100644 --- a/putty.h +++ b/putty.h @@ -512,7 +512,11 @@ struct BackendVtable { * connection-sharing upstream exists for a given configuration. */ bool (*test_for_upstream)(const char *host, int port, Conf *conf); - const char *name; + /* 'id' is a machine-readable name for the backend, used in + * saved-session storage. 'displayname' is a human-readable name + * for error messages. */ + const char *id, *displayname; + int protocol; int default_port; }; diff --git a/raw.c b/raw.c index 226739b0..142eed89 100644 --- a/raw.c +++ b/raw.c @@ -324,7 +324,7 @@ const struct BackendVtable raw_backend = { raw_unthrottle, raw_cfg_info, NULL /* test_for_upstream */, - "raw", + "raw", "Raw", PROT_RAW, 0 }; diff --git a/rlogin.c b/rlogin.c index 2cc66fb6..50bae179 100644 --- a/rlogin.c +++ b/rlogin.c @@ -422,7 +422,7 @@ const struct BackendVtable rlogin_backend = { rlogin_unthrottle, rlogin_cfg_info, NULL /* test_for_upstream */, - "rlogin", + "rlogin", "Rlogin", PROT_RLOGIN, 513 }; diff --git a/settings.c b/settings.c index 2bc99689..97bbc962 100644 --- a/settings.c +++ b/settings.c @@ -82,7 +82,7 @@ const struct BackendVtable *backend_vt_from_name(const char *name) { const struct BackendVtable *const *p; for (p = backends; *p != NULL; p++) - if (!strcmp((*p)->name, name)) + if (!strcmp((*p)->id, name)) return *p; return NULL; } @@ -556,7 +556,7 @@ void save_open_settings(settings_w *sesskey, Conf *conf) const struct BackendVtable *vt = backend_vt_from_proto(conf_get_int(conf, CONF_protocol)); if (vt) - p = vt->name; + p = vt->id; } write_setting_s(sesskey, "Protocol", p); write_setting_i(sesskey, "PortNumber", conf_get_int(conf, CONF_port)); diff --git a/ssh.c b/ssh.c index 87d4c624..8ee3284f 100644 --- a/ssh.c +++ b/ssh.c @@ -1190,7 +1190,7 @@ const struct BackendVtable ssh_backend = { ssh_unthrottle, ssh_cfg_info, ssh_test_for_upstream, - "ssh", + "ssh", "SSH", PROT_SSH, 22 }; diff --git a/telnet.c b/telnet.c index 3f3170cd..2496d4ee 100644 --- a/telnet.c +++ b/telnet.c @@ -1064,7 +1064,7 @@ const struct BackendVtable telnet_backend = { telnet_unthrottle, telnet_cfg_info, NULL /* test_for_upstream */, - "telnet", + "telnet", "Telnet", PROT_TELNET, 23 }; diff --git a/testback.c b/testback.c index f26f395c..0916c8ec 100644 --- a/testback.c +++ b/testback.c @@ -57,14 +57,14 @@ const struct BackendVtable null_backend = { null_init, null_free, null_reconfig, null_send, null_sendbuffer, null_size, null_special, null_get_specials, null_connected, null_exitcode, null_sendok, null_ldisc, null_provide_ldisc, null_unthrottle, - null_cfg_info, NULL /* test_for_upstream */, "null", -1, 0 + null_cfg_info, NULL /* test_for_upstream */, "null", "null", -1, 0 }; const struct BackendVtable loop_backend = { loop_init, loop_free, null_reconfig, loop_send, null_sendbuffer, null_size, null_special, null_get_specials, null_connected, null_exitcode, null_sendok, null_ldisc, null_provide_ldisc, null_unthrottle, - null_cfg_info, NULL /* test_for_upstream */, "loop", -1, 0 + null_cfg_info, NULL /* test_for_upstream */, "loop", "loop", -1, 0 }; struct loop_state { diff --git a/unix/uxplink.c b/unix/uxplink.c index d49aa8f0..463c9a60 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -891,8 +891,8 @@ int main(int argc, char **argv) if (just_test_share_exists) { if (!backvt->test_for_upstream) { - fprintf(stderr, "Connection sharing not supported for connection " - "type '%s'\n", backvt->name); + fprintf(stderr, "Connection sharing not supported for this " + "connection type (%s)'\n", backvt->displayname); return 1; } if (backvt->test_for_upstream(conf_get_str(conf, CONF_host), diff --git a/unix/uxpty.c b/unix/uxpty.c index 0e52ee93..38a6f6a1 100644 --- a/unix/uxpty.c +++ b/unix/uxpty.c @@ -1601,7 +1601,7 @@ const struct BackendVtable pty_backend = { pty_unthrottle, pty_cfg_info, NULL /* test_for_upstream */, - "pty", + "pty", "pty", -1, 0 }; diff --git a/unix/uxser.c b/unix/uxser.c index f38a8eac..4d5e4d3e 100644 --- a/unix/uxser.c +++ b/unix/uxser.c @@ -576,7 +576,7 @@ const struct BackendVtable serial_backend = { serial_unthrottle, serial_cfg_info, NULL /* test_for_upstream */, - "serial", + "serial", "Serial", PROT_SERIAL, 0 }; diff --git a/windows/winplink.c b/windows/winplink.c index 22f57cf0..ec9c31e5 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -413,8 +413,8 @@ int main(int argc, char **argv) if (just_test_share_exists) { if (!vt->test_for_upstream) { - fprintf(stderr, "Connection sharing not supported for connection " - "type '%s'\n", vt->name); + fprintf(stderr, "Connection sharing not supported for this " + "connection type (%s)'\n", vt->displayname); return 1; } if (vt->test_for_upstream(conf_get_str(conf, CONF_host), diff --git a/windows/winser.c b/windows/winser.c index c63aefeb..947456ac 100644 --- a/windows/winser.c +++ b/windows/winser.c @@ -444,7 +444,7 @@ const struct BackendVtable serial_backend = { serial_unthrottle, serial_cfg_info, NULL /* test_for_upstream */, - "serial", + "serial", "Serial", PROT_SERIAL, 0 };