1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

Show client version

This commit is contained in:
Nicolas Viennot 2013-07-22 20:00:43 -04:00
parent e8ca45b088
commit b476eb22e2

View File

@ -100,9 +100,17 @@ static void tmate_header(struct tmate_decoder *decoder,
struct tmate_unpacker *uk) struct tmate_unpacker *uk)
{ {
char hostname[128]; char hostname[128];
decoder->protocol = unpack_int(uk); char *client_version = xstrdup("< 1.8.6");
tmate_debug("new master, protocol version: %d", decoder->protocol); decoder->protocol = unpack_int(uk);
if (decoder->protocol >= 3) {
free(client_version);
client_version = unpack_string(uk);
}
tmate_debug("new master, client version: %s, protocol version: %d",
client_version, decoder->protocol);
free(client_version);
if (gethostname(hostname, sizeof(hostname)) < 0) if (gethostname(hostname, sizeof(hostname)) < 0)
tmate_fatal("cannot get hostname"); tmate_fatal("cannot get hostname");