Ticket #2 (closed defect: fixed)
When downloading a large file (>0x7fffffff) from server, connection is aborted
| Reported by: | ben | Owned by: | chris |
|---|---|---|---|
| Priority: | critical | Milestone: | 0.11 |
| Component: | box libraries | Version: | 0.10 |
| Keywords: | windows unix large file BackupStore BadBackupStoreFile 4/11 | Cc: | dave@… |
Description (last modified by ben) (diff)
PartialReadStream? is used to grab a portion of the incoming data. However, it uses signed ints where it shouldn't, and it all goes horribly wrong.
To fix:
test/common/testcommon.cpp ... write stream class which gives > 0x7fffffff bytes of zeros. Then create a PartialReadStream? from it, asking for > 0x7fffffff, and check to see if the results are as expected. With the current code, this should fail.
lib/common/PartialReadStream.*
Change
int mBytesLeft;
to
pos_type mBytesLeft;
then all vars which are related (eg BytesToRead? in constructor) to pos_type too. (Don't change the args to Read otherwise it won't implement the IOStream interface.)
