mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-01 00:45:52 +00:00
Share: drop received data after each block finishes. Quick fix for the #1170 spans.py complexity bug.
This commit is contained in:
parent
b6c559e009
commit
c89a464510
@ -531,6 +531,9 @@ class Share:
|
||||
for o in observers:
|
||||
# goes to SegmentFetcher._block_request_activity
|
||||
o.notify(state=COMPLETE, block=block)
|
||||
# now clear our received data, to dodge the #1170 spans.py
|
||||
# complexity bug
|
||||
self._received = DataSpans()
|
||||
except (BadHashError, NotEnoughHashesError), e:
|
||||
# rats, we have a corrupt block. Notify our clients that they
|
||||
# need to look elsewhere, and advise the server. Unlike
|
||||
|
@ -52,7 +52,7 @@ class Test(common.ShareManglingMixin, common.ShouldFailMixin, unittest.TestCase)
|
||||
def _after_download(unused=None):
|
||||
after_download_reads = self._count_reads()
|
||||
#print before_download_reads, after_download_reads
|
||||
self.failIf(after_download_reads-before_download_reads > 27,
|
||||
self.failIf(after_download_reads-before_download_reads > 36,
|
||||
(after_download_reads, before_download_reads))
|
||||
d.addCallback(self._download_and_check_plaintext)
|
||||
d.addCallback(_after_download)
|
||||
@ -70,7 +70,7 @@ class Test(common.ShareManglingMixin, common.ShouldFailMixin, unittest.TestCase)
|
||||
def _after_download(unused=None):
|
||||
after_download_reads = self._count_reads()
|
||||
#print before_download_reads, after_download_reads
|
||||
self.failIf(after_download_reads-before_download_reads > 27, (after_download_reads, before_download_reads))
|
||||
self.failIf(after_download_reads-before_download_reads > 37, (after_download_reads, before_download_reads))
|
||||
d.addCallback(self._download_and_check_plaintext)
|
||||
d.addCallback(_after_download)
|
||||
return d
|
||||
|
Loading…
x
Reference in New Issue
Block a user