mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 02:01:31 +00:00
immutable repairer: add an assertion that a certain value in this tricky function is always what I think it is
This commit is contained in:
parent
2d45d192d1
commit
bdb992467c
@ -2,7 +2,7 @@ from zope.interface import implements
|
||||
from twisted.internet import defer
|
||||
from allmydata import storage
|
||||
from allmydata.util import log, observer
|
||||
from allmydata.util.assertutil import precondition
|
||||
from allmydata.util.assertutil import precondition, _assert
|
||||
from allmydata.uri import CHKFileVerifierURI
|
||||
from allmydata.interfaces import IEncryptedUploadable, IDownloadTarget
|
||||
from twisted.internet.interfaces import IConsumer
|
||||
@ -152,6 +152,8 @@ class DownUpConnector(log.PrefixingLogMixin):
|
||||
extra = ressize - nrl
|
||||
self.bufs.appendleft(nextbuf[:-extra])
|
||||
res[-1] = nextbuf[:-extra]
|
||||
assert _assert(sum(len(x) for x in res) <= nrl, [len(x) for x in res], nrl)
|
||||
assert _assert(sum(len(x) for x in res) == nrl or self._closed_to_pusher, [len(x) for x in res], nrl)
|
||||
self.bufsiz -= nrl
|
||||
if self.bufsiz < self.buflim and self.producer:
|
||||
self.producer.resumeProducing()
|
||||
|
Loading…
x
Reference in New Issue
Block a user