1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-02-04 06:02:24 +00:00

In SSH-2, list each compression algorithm only once. (No particular reason

for this change, just tidiness.)

[originally from svn r4528]
This commit is contained in:
Jacob Nevins 2004-09-03 12:28:19 +00:00
parent 065c303a29
commit 47997ad904

24
ssh.c
View File

@ -4136,21 +4136,25 @@ static int do_ssh2_transport(Ssh ssh, unsigned char *in, int inlen, int ispkt)
} }
/* List client->server compression algorithms. */ /* List client->server compression algorithms. */
ssh2_pkt_addstring_start(ssh); ssh2_pkt_addstring_start(ssh);
for (i = 0; i < lenof(compressions) + 1; i++) { assert(lenof(compressions) > 1);
const struct ssh_compress *c = ssh2_pkt_addstring_str(ssh, s->preferred_comp->name);
i == 0 ? s->preferred_comp : compressions[i - 1]; for (i = 0; i < lenof(compressions); i++) {
ssh2_pkt_addstring_str(ssh, c->name); const struct ssh_compress *c = compressions[i];
if (i < lenof(compressions)) if (c != s->preferred_comp) {
ssh2_pkt_addstring_str(ssh, ","); ssh2_pkt_addstring_str(ssh, ",");
ssh2_pkt_addstring_str(ssh, c->name);
}
} }
/* List server->client compression algorithms. */ /* List server->client compression algorithms. */
ssh2_pkt_addstring_start(ssh); ssh2_pkt_addstring_start(ssh);
for (i = 0; i < lenof(compressions) + 1; i++) { assert(lenof(compressions) > 1);
const struct ssh_compress *c = ssh2_pkt_addstring_str(ssh, s->preferred_comp->name);
i == 0 ? s->preferred_comp : compressions[i - 1]; for (i = 0; i < lenof(compressions); i++) {
ssh2_pkt_addstring_str(ssh, c->name); const struct ssh_compress *c = compressions[i];
if (i < lenof(compressions)) if (c != s->preferred_comp) {
ssh2_pkt_addstring_str(ssh, ","); ssh2_pkt_addstring_str(ssh, ",");
ssh2_pkt_addstring_str(ssh, c->name);
}
} }
/* List client->server languages. Empty list. */ /* List client->server languages. Empty list. */
ssh2_pkt_addstring_start(ssh); ssh2_pkt_addstring_start(ssh);