In blocking mode sftp//write will wait (poll) infinitely, when connection to target server is lost.
To reproduce you need two computers:
- Transfer a large file from computer A to computer B using sftp//write.
- During the transfer unplug the network cable from computer B. -> computer A will infinitely poll
- After 20 minutes or so plug network cable of computer B -> computer A will still poll infinitely!
The infinite poll is cause by some codelines:
int ssh_channel_read(ssh_channel channel, void **dest, uint32_t count, int is_stderr) { return ssh_channel_read_timeout(channel, dest, count, is_stderr, -1); } if (timeout < 0) { timeout = SSH_TIMEOUT_DEFAULT; }
For more information and a patch please see my mailing list post:
http://www.libssh.org/archive/libssh/2016-02/0000006.html