Hi there, I'm seeing EOFException when file gets modified during sendFile 
command.
Here is the scenario.  Client receives the size of the file as 1000.  Then, 
before inputstream is read, file gets modified which the file size becomes 
greater that what it was specified and this causes read to fail.

debug2: exec request accepted on channel 0
Sink: C0644 1000 foo.txt

debug2: channel 0: read<=0 rfd 5 len 0
debug2: channel 0: read failed
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty

here is the code that writes the length.  
https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/common/scp/ScpHelper.java#L505
Could we use available() method of an InputStream and use that instead when 
writing C0644 1000 foo.txt?I've tried this workaround and seems to work for me.
Thanks

Reply via email to