mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-28 08:49:30 -05:00
Try to fix logic handling last upload after timer expiry
This commit is contained in:
parent
e9148ddb49
commit
61d2e6cc5f
@ -243,7 +243,11 @@ class ReceiveModeRequest(Request):
|
|||||||
if self.path == '/upload':
|
if self.path == '/upload':
|
||||||
self.upload_request = True
|
self.upload_request = True
|
||||||
|
|
||||||
if self.upload_request and self.web.receive_mode.can_upload:
|
# Prevent new uploads if we've said so (timer expired)
|
||||||
|
if not self.web.receive_mode.can_upload:
|
||||||
|
self.upload_request = False
|
||||||
|
|
||||||
|
if self.upload_request:
|
||||||
# A dictionary that maps filenames to the bytes uploaded so far
|
# A dictionary that maps filenames to the bytes uploaded so far
|
||||||
self.progress = {}
|
self.progress = {}
|
||||||
|
|
||||||
@ -290,16 +294,11 @@ class ReceiveModeRequest(Request):
|
|||||||
"""
|
"""
|
||||||
super(ReceiveModeRequest, self).close()
|
super(ReceiveModeRequest, self).close()
|
||||||
if self.upload_request:
|
if self.upload_request:
|
||||||
try:
|
# Inform the GUI that the upload has finished
|
||||||
upload_id = self.upload_id
|
self.web.add_request(self.web.REQUEST_UPLOAD_FINISHED, self.path, {
|
||||||
# Inform the GUI that the upload has finished
|
'id': self.upload_id
|
||||||
self.web.add_request(self.web.REQUEST_UPLOAD_FINISHED, self.path, {
|
})
|
||||||
'id': upload_id
|
|
||||||
})
|
|
||||||
|
|
||||||
except AttributeError:
|
|
||||||
# We may not have got an upload_id (e.g uploads were rejected)
|
|
||||||
pass
|
|
||||||
|
|
||||||
def file_write_func(self, filename, length):
|
def file_write_func(self, filename, length):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user