mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-05-08 01:15:43 -04:00
Tied link teardown to resource cancellation
This commit is contained in:
parent
260f8bbaf1
commit
23ff873c63
3 changed files with 10 additions and 3 deletions
|
@ -65,7 +65,9 @@ class Link:
|
|||
|
||||
if link.owner.callbacks.link_established != None:
|
||||
link.owner.callbacks.link_established(link)
|
||||
|
||||
RNS.log("Incoming link request "+str(link)+" accepted", RNS.LOG_VERBOSE)
|
||||
return link
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Validating link request failed", RNS.LOG_VERBOSE)
|
||||
|
@ -232,6 +234,11 @@ class Link:
|
|||
pass
|
||||
|
||||
def link_closed(self):
|
||||
for resource in self.incoming_resources:
|
||||
resource.cancel()
|
||||
for resource in self.outgoing_resources:
|
||||
resource.cancel()
|
||||
|
||||
self.prv = None
|
||||
self.pub = None
|
||||
self.pub_bytes = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue