[MERGE][1.9] Fix SFTP.readv() regression
John Arbash Meinel
john at arbash-meinel.com
Thu Nov 6 17:33:35 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
So it turns out that my work on returning sftp requests as a stream
rather than all-at-once had a small bug.
To reproduce you have to:
1) Make list of requests where they are not in order
2) But they can be combined into a greater read
3) And one of the out-of-order chunks is at the end of the last combined
For example, requesting [(15, 5), (20, 5), (10, 5)], this would be
combined into [(10, 15)], and when seeking, we would see that (15, 5)
starts after the start of the last hunk.
The fix is to just check if bisect_left returns a pointer at the end. We
already handled the case (for when it is in the middle of the request),
I just forgot to check the edge.
Anyway, this patch should fix it (the test triggered it, the fix
This should go into 1.9-final, because it is a regression.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the bazaar