mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-18 20:47:54 +00:00
fix already-stopped
This commit is contained in:
parent
194011946c
commit
d70fa461da
@ -63,13 +63,14 @@ class SegmentFetcher(object):
|
||||
self._running = True
|
||||
|
||||
def stop(self):
|
||||
log.msg("SegmentFetcher(%r).stop" % self._node._si_prefix,
|
||||
level=log.NOISY, parent=self._lp, umid="LWyqpg")
|
||||
self._cancel_all_requests()
|
||||
self._running = False
|
||||
# help GC ??? XXX
|
||||
del self._shares, self._shares_from_server, self._active_share_map
|
||||
del self._share_observers
|
||||
if self._running:
|
||||
log.msg("SegmentFetcher(%r).stop" % self._node._si_prefix,
|
||||
level=log.NOISY, parent=self._lp, umid="LWyqpg")
|
||||
self._cancel_all_requests()
|
||||
self._running = False
|
||||
# help GC ???
|
||||
del self._shares, self._shares_from_server, self._active_share_map
|
||||
del self._share_observers
|
||||
|
||||
|
||||
# called by our parent _Node
|
||||
|
@ -533,10 +533,11 @@ class DownloadNode(object):
|
||||
self._segment_requests = [t for t in self._segment_requests
|
||||
if t[2] != cancel]
|
||||
segnums = [segnum for (segnum,d,c,seg_ev,lp) in self._segment_requests]
|
||||
|
||||
# self._active_segment might be None in rare circumstances, so make
|
||||
# sure we tolerate it
|
||||
if self._active_segment and self._active_segment.segnum not in segnums:
|
||||
seg, self._active_segment = self._active_segment, None##True # XXX None for real
|
||||
seg, self._active_segment = self._active_segment, None
|
||||
seg.stop()
|
||||
self._start_new_segment()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user