[MERGE][#246180] Make sure we never read more than 64k at a time from a smart medium.
Andrew Bennetts
andrew at canonical.com
Mon Jul 21 10:07:56 BST 2008
Hi everyone,
I believe this patch fixes <https://bugs.launchpad.net/bzr/+bug/246180>, which
is a regression from 1.5 and thus marked Critical. I don't run Windows myself
though, so testing by Windows (and also OS X) users would be greatly
appreciated.
The core bug fix is to make sure that bzr doesn't ever try to read more than 64k
from a socket (or pipe) when doing smart protocol operations.
The patch achieves this by doing some refactoring: the patch deletes more lines
than it adds, even though it adds some comments and expands some docstrings. In
particular there's now a SmartMedium base class used by both the client- and
server-side code, and the 64k limit is enforced there. Previously multiple
locations in the code were responsible for this, which is what made the
recurrence of this bug possible. There's now also just one place that
implements the logic to read a line from a medium too.
So, the new code is simpler, clearer, shorter, and less buggy. Please review :)
Here's the diffstat for the curious:
smart/medium.py | 201 ++++++++++++++++++++++++---------------------
smart/protocol.py | 28 ------
transport/http/__init__.py | 1
3 files changed, 113 insertions(+), 117 deletions(-)
-Andrew.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hpss-v3-memory-error.patch
Type: text/x-diff
Size: 20460 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080721/69f322ab/attachment.bin
More information about the bazaar
mailing list