[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Could not write as much data as expected
[Thread Prev] | [Thread Next]
- Subject: Re: Could not write as much data as expected
- From: Yanis Kurganov <yanis.kurganov@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Thu, 11 Apr 2019 11:54:15 +0300
- To: libssh@xxxxxxxxxx
OK, I'm both asked and answered that question =)
Yes, this patch is valid.
Please, apply it to 0.8 and 0.7 branches (0.7 still in use because of SSH-1).
Here is a anippet with some debug code:
packetlen=buffer_get_rest_len(buffer);
SSH_LOG(SSH_LOG_PACKET, "packetlen: %d", packetlen); // !!! added
len = sftp_packet_write(file->sftp, SSH_FXP_WRITE, buffer);
packetlen=buffer_get_rest_len(buffer);
// !!! added
SSH_LOG(SSH_LOG_PACKET, "packetlen: %d", packetlen); // !!! added
SSH_LOG(SSH_LOG_PACKET, "len: %d", len); // !!! added
ssh_buffer_free(buffer);
if (len < 0) {
return -1;
} else if (len != packetlen) {
SSH_LOG(SSH_LOG_PACKET,"Could not write as much data as expected");
}
Output:
sftp_write: packetlen: 37
packet_send2: packet: wrote [len=60,padding=8,comp=51,payload=51]
channel_write_common: channel_write wrote 42 bytes
sftp_write: packetlen: 42
sftp_write: len: 42
37 + uint8_t (type) + uint32_t (size) = 42
| Could not write as much data as expected | Yanis Kurganov <yanis.kurganov@xxxxxxxxx> |