mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-28 16:59:35 -05:00
In receive mode, only tell the GUI that a new request is coming in if it contains files
This commit is contained in:
parent
a1f8f0bd2b
commit
04e4385667
@ -275,11 +275,8 @@ class ReceiveModeRequest(Request):
|
|||||||
strings._("receive_mode_upload_starting").format(self.web.common.human_readable_filesize(self.content_length))
|
strings._("receive_mode_upload_starting").format(self.web.common.human_readable_filesize(self.content_length))
|
||||||
))
|
))
|
||||||
|
|
||||||
# Tell the GUI
|
# Don't tell the GUI that a request has started until we start receiving files
|
||||||
self.web.add_request(self.web.REQUEST_STARTED, self.path, {
|
self.told_gui_about_request = False
|
||||||
'id': self.upload_id,
|
|
||||||
'content_length': self.content_length
|
|
||||||
})
|
|
||||||
|
|
||||||
self.web.receive_mode.uploads_in_progress.append(self.upload_id)
|
self.web.receive_mode.uploads_in_progress.append(self.upload_id)
|
||||||
|
|
||||||
@ -291,6 +288,14 @@ class ReceiveModeRequest(Request):
|
|||||||
writable stream.
|
writable stream.
|
||||||
"""
|
"""
|
||||||
if self.upload_request:
|
if self.upload_request:
|
||||||
|
if not self.told_gui_about_request:
|
||||||
|
# Tell the GUI about the request
|
||||||
|
self.web.add_request(self.web.REQUEST_STARTED, self.path, {
|
||||||
|
'id': self.upload_id,
|
||||||
|
'content_length': self.content_length
|
||||||
|
})
|
||||||
|
self.told_gui_about_request = True
|
||||||
|
|
||||||
self.progress[filename] = {
|
self.progress[filename] = {
|
||||||
'uploaded_bytes': 0,
|
'uploaded_bytes': 0,
|
||||||
'complete': False
|
'complete': False
|
||||||
|
Loading…
Reference in New Issue
Block a user