Link: fix resource cancellation

Resource.cancel() -> Link.cancel_{incoming/outgoing}_resource()
changes the iterated list and every second resource is skipped.

Fix: iterate over copies of the two lists
This commit is contained in:
JRG 2026-08-14 22:24:53 +03:00 • committed by Mark Qvist
parent 6c1182c2c2
commit 72ba27d63c

View file

@ -683,8 +683,8 @@ class Link:
except Exception as e: pass
def link_closed(self):
for resource in self.incoming_resources: resource.cancel()
for resource in self.outgoing_resources: resource.cancel()
for resource in self.incoming_resources.copy(): resource.cancel()
for resource in self.outgoing_resources.copy(): resource.cancel()
if self._channel: self._channel._shutdown()
self.prv = None