Hi, With reference to the latest version of the portable OpenSSH, in file sftp-client.c, it looks to me there may be a bug in function sftp_upload. My understanding is that, when variable "len" is equal to 0, no more SSH_FXP_WRITE messages are sent out and you start draining the queue of pending responses. Variable "len" is set to 0 either when the upload is interrupted, or when the SSH_FXP_STATUS response message carries an error, which sets variable "status" to a value different from SSH_FX_OK. Can the variable "status" be overwritten by subsequent response messages to be again SSH_FX_OK? And, if this is the case, isn't it that the "read" is again called, variable "len" is set again to a non-zero value, and thus the function can return 0 even if an error message was received? Kind regards, Graziano Stefani. _______________________________________________ openssh-unix-dev mailing list openssh-unix-dev@xxxxxxxxxxx https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev