Skip to content

sftp: refactor GetRequest to also be used by ::read

Harald Sitter requested to merge work/sftp-multirequest-read into master

::read actually misbehaved earlier, it'd block read N bytes without segmentation which means the kio client determined the read segment size and that in turn would exhaust sftp servers if the reads are larger than the (server-specific) maximum.

this now moves to readrequests which are most importantly not exhausting the request size but also improving speed for larger requests (should improve speed a tad for kio-fuse).

to support this use case GetRequest is now subclassed into a HardLimit request and a SoftLimit request. this is because the original getrequest could read beyond the originally determined size all the way to EOF. with ::read we only want to read exactly as many bytes as were requested though (I think). personally I'd always treat the size as hardlimit but maybe I'm being ignorant, I guess if the server doesn't report a size we need to read to EOF

this also improves some comments

Edited by Harald Sitter

Merge request reports