[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-----
Hash: SHA1

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
chunk.

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
resolves it.)

This should go into 1.9-final, because it is a regression.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkTKm4ACgkQJdeBCYSNAAPSbwCaAzfMgmXlHeThzFiL2D4zNDNI
AHYAn2jsWLfgNmxlRv+jSfD4P7WHNM75
=tiVn
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sftp_bug_293746.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20081106/73962b6c/attachment-0001.diff 


More information about the bazaar mailing list