Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Created Issue: Partial Reads from Stream assume end? [1516]

$
0
0
Hi, thanks for all your work on this library.

We are using an implementation of a ProducerConsumerStream from here as our means of feeding data into the ftp transfer. This is essentially a buffered stream that stalls the feeder, whilst the reader catches up - otherwise the stream could fill quickly and hog memory on our server whilst a poor ftp connection stalls the reader.

This presents a problem in that the SftpClient implementation assumes that a partial stream is the final block - whereas in our case this could occur at any point in the lifetime of the transfer as the buffered stream could be smaller than the buffer it is being read into. Worse still, should the feeder only populate half of the buffer on the first read, the client will complete the transfer.

I've tried to understand the code in the InternalUploadFile but I'm struglling to find the exit point. What will also happen is the resize of the buffer for the assumed last block - means that even if it did continue it's iterations the buffer is reduced to the smaller size. If the partial read is only 1 byte, then the buffer is reduced to 1 byte each read!!! Arggh!

Can you provide me with guidance on how the InternalUploadFile exit point is reached from the partial read...? Thanks

Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>