[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Could not write as much data as expected


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

References:
Could not write as much data as expectedYanis Kurganov <yanis.kurganov@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org