mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-02-23 08:29:58 -05:00
Improved request failure handling
This commit is contained in:
parent
062e31964a
commit
8d9f4956db
@ -756,7 +756,7 @@ class Browser:
|
|||||||
def __load(self):
|
def __load(self):
|
||||||
# If an established link exists, but it doesn't match the target
|
# If an established link exists, but it doesn't match the target
|
||||||
# destination, we close and clear it.
|
# destination, we close and clear it.
|
||||||
if self.link != None and self.link.destination.hash != self.destination_hash:
|
if self.link != None and (self.link.destination.hash != self.destination_hash or self.link.status != RNS.Link.ACTIVE):
|
||||||
self.link.teardown()
|
self.link.teardown()
|
||||||
self.link = None
|
self.link = None
|
||||||
|
|
||||||
@ -1005,6 +1005,11 @@ class Browser:
|
|||||||
self.response_transfer_size = None
|
self.response_transfer_size = None
|
||||||
|
|
||||||
self.update_display()
|
self.update_display()
|
||||||
|
if self.link != None:
|
||||||
|
try:
|
||||||
|
self.link.teardown()
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
self.status = Browser.REQUEST_FAILED
|
self.status = Browser.REQUEST_FAILED
|
||||||
self.response_progress = 0
|
self.response_progress = 0
|
||||||
@ -1012,6 +1017,11 @@ class Browser:
|
|||||||
self.response_transfer_size = None
|
self.response_transfer_size = None
|
||||||
|
|
||||||
self.update_display()
|
self.update_display()
|
||||||
|
if self.link != None:
|
||||||
|
try:
|
||||||
|
self.link.teardown()
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def request_timeout(self, request_receipt=None):
|
def request_timeout(self, request_receipt=None):
|
||||||
@ -1021,6 +1031,11 @@ class Browser:
|
|||||||
self.response_transfer_size = None
|
self.response_transfer_size = None
|
||||||
|
|
||||||
self.update_display()
|
self.update_display()
|
||||||
|
if self.link != None:
|
||||||
|
try:
|
||||||
|
self.link.teardown()
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def response_progressed(self, request_receipt):
|
def response_progressed(self, request_receipt):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user