mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-02-04 06:02:24 +00:00
Tidy up SSH packet-level debugging
[originally from svn r1344]
This commit is contained in:
parent
7901347083
commit
d1e305543a
21
ssh.c
21
ssh.c
@ -942,23 +942,18 @@ static int s_wrpkt_prepare(void)
|
|||||||
|
|
||||||
pktout.body[-1] = pktout.type;
|
pktout.body[-1] = pktout.type;
|
||||||
|
|
||||||
|
if (ssh1_compressing) {
|
||||||
|
unsigned char *compblk;
|
||||||
|
int complen;
|
||||||
#ifdef DUMP_PACKETS
|
#ifdef DUMP_PACKETS
|
||||||
debug(("Packet payload pre-compression:\n"));
|
debug(("Packet payload pre-compression:\n"));
|
||||||
dmemdump(pktout.body - 1, pktout.length + 1);
|
dmemdump(pktout.body - 1, pktout.length + 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ssh1_compressing) {
|
|
||||||
unsigned char *compblk;
|
|
||||||
int complen;
|
|
||||||
zlib_compress_block(pktout.body - 1, pktout.length + 1,
|
zlib_compress_block(pktout.body - 1, pktout.length + 1,
|
||||||
&compblk, &complen);
|
&compblk, &complen);
|
||||||
ssh1_pktout_size(complen - 1);
|
ssh1_pktout_size(complen - 1);
|
||||||
memcpy(pktout.body - 1, compblk, complen);
|
memcpy(pktout.body - 1, compblk, complen);
|
||||||
sfree(compblk);
|
sfree(compblk);
|
||||||
#ifdef DUMP_PACKETS
|
|
||||||
debug(("Packet payload post-compression:\n"));
|
|
||||||
dmemdump(pktout.body - 1, pktout.length + 1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
len = pktout.length + 5; /* type and CRC */
|
len = pktout.length + 5; /* type and CRC */
|
||||||
@ -1241,13 +1236,15 @@ static int ssh2_pkt_construct(void)
|
|||||||
/*
|
/*
|
||||||
* Compress packet payload.
|
* Compress packet payload.
|
||||||
*/
|
*/
|
||||||
#ifdef DUMP_PACKETS
|
|
||||||
debug(("Pre-compression payload:\n"));
|
|
||||||
dmemdump(pktout.data + 5, pktout.length - 5);
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
unsigned char *newpayload;
|
unsigned char *newpayload;
|
||||||
int newlen;
|
int newlen;
|
||||||
|
#ifdef DUMP_PACKETS
|
||||||
|
if (cscomp && cscomp != &ssh_comp_none) {
|
||||||
|
debug(("Pre-compression payload:\n"));
|
||||||
|
dmemdump(pktout.data + 5, pktout.length - 5);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (cscomp && cscomp->compress(pktout.data + 5, pktout.length - 5,
|
if (cscomp && cscomp->compress(pktout.data + 5, pktout.length - 5,
|
||||||
&newpayload, &newlen)) {
|
&newpayload, &newlen)) {
|
||||||
pktout.length = 5;
|
pktout.length = 5;
|
||||||
|
Loading…
Reference in New Issue
Block a user