Prior to revision 0190a9994e ("Rewrote the throttling implementation to
be more effecient"), the DelayIfRequired method would increment the
offset variable to advance through the buffer. When we modified the
implementation in revision 0190a9994e, we may have forgotten to modify
the offset accordingly.
Adjust buffer offset by amount read so far in the internal Read loop,
so newly read data goes after old data instead of going on top of it.
This fixes issue #3787 read buffer corruptions when throttle is used.
Still needs a work over in terms of error handling, progress reporting, warning output, refactoring etc.
Also misses the volume reuse/reclaim algorithms.
But it passes the unit tests now, with and without a local database.
git-svn-id: https://duplicati.googlecode.com/svn/sandboxes/Kenneth/ForestHash@1526 59da171f-624f-0410-aa54-27559c288bec