mirror of
https://github.com/rclone/rclone.git
synced 2025-01-29 21:04:23 +02:00
6d0063d685
Before this change we checked the transfer was out of range only before the Read call. This means that we returned all the data to the reader before declaring an error. This means that some backends wrote the file even though an error was returned. This fix checks the transfer after the Read as well, and chops the excess characters off the read data if we are over the limit so that we don't ever deliver all the data. This fixes the tests introduced as part of 6f1766dd9e74fffb and #2672 on backends other than local.