mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01: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:
parent
065c303a29
commit
47997ad904
24
ssh.c
24
ssh.c
@ -4136,21 +4136,25 @@ static int do_ssh2_transport(Ssh ssh, unsigned char *in, int inlen, int ispkt)
|
||||
}
|
||||
/* List client->server compression algorithms. */
|
||||
ssh2_pkt_addstring_start(ssh);
|
||||
for (i = 0; i < lenof(compressions) + 1; i++) {
|
||||
const struct ssh_compress *c =
|
||||
i == 0 ? s->preferred_comp : compressions[i - 1];
|
||||
ssh2_pkt_addstring_str(ssh, c->name);
|
||||
if (i < lenof(compressions))
|
||||
assert(lenof(compressions) > 1);
|
||||
ssh2_pkt_addstring_str(ssh, s->preferred_comp->name);
|
||||
for (i = 0; i < lenof(compressions); i++) {
|
||||
const struct ssh_compress *c = compressions[i];
|
||||
if (c != s->preferred_comp) {
|
||||
ssh2_pkt_addstring_str(ssh, ",");
|
||||
ssh2_pkt_addstring_str(ssh, c->name);
|
||||
}
|
||||
}
|
||||
/* List server->client compression algorithms. */
|
||||
ssh2_pkt_addstring_start(ssh);
|
||||
for (i = 0; i < lenof(compressions) + 1; i++) {
|
||||
const struct ssh_compress *c =
|
||||
i == 0 ? s->preferred_comp : compressions[i - 1];
|
||||
ssh2_pkt_addstring_str(ssh, c->name);
|
||||
if (i < lenof(compressions))
|
||||
assert(lenof(compressions) > 1);
|
||||
ssh2_pkt_addstring_str(ssh, s->preferred_comp->name);
|
||||
for (i = 0; i < lenof(compressions); i++) {
|
||||
const struct ssh_compress *c = compressions[i];
|
||||
if (c != s->preferred_comp) {
|
||||
ssh2_pkt_addstring_str(ssh, ",");
|
||||
ssh2_pkt_addstring_str(ssh, c->name);
|
||||
}
|
||||
}
|
||||
/* List client->server languages. Empty list. */
|
||||
ssh2_pkt_addstring_start(ssh);
|
||||
|
Loading…
Reference in New Issue
Block a user