From 406515085e4f55c48230584c1fa21a6128b2619e Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Fri, 27 Apr 2018 23:19:46 -0700 Subject: [PATCH] Fixed crash when starting recieve mode server --- onionshare/web.py | 1 + onionshare_gui/receive_mode/__init__.py | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/onionshare/web.py b/onionshare/web.py index d49450cd..04be5b66 100644 --- a/onionshare/web.py +++ b/onionshare/web.py @@ -453,6 +453,7 @@ class Web(object): """ Start the flask web server. """ + self.common.log('Web', 'start', 'port={}, stay_open={}, persistent_slug={}'.format(port, stay_open, persistent_slug)) self.generate_slug(persistent_slug) self.stay_open = stay_open diff --git a/onionshare_gui/receive_mode/__init__.py b/onionshare_gui/receive_mode/__init__.py index 76e8b30b..290eb029 100644 --- a/onionshare_gui/receive_mode/__init__.py +++ b/onionshare_gui/receive_mode/__init__.py @@ -34,6 +34,11 @@ class ReceiveMode(Mode): """ # Create the Web object self.web = Web(self.common, True, True) + + # Server status + self.server_status.set_mode('receive') + #self.server_status.server_stopped.connect(self.update_primary_action) + #self.server_status.server_canceled.connect(self.update_primary_action) # Tell server_status about web, then update self.server_status.web = self.web @@ -53,12 +58,21 @@ class ReceiveMode(Mode): """ pass + def start_server_custom(self): + """ + Starting the server. + """ + # Reset web counters + self.web.error404_count = 0 + + # Hide and reset the downloads if we have previously shared + #self.downloads.reset_downloads() + #self.reset_info_counters() + def start_server_step2_custom(self): """ Step 2 in starting the server. """ - # Set up web - # Continue self.starting_server_step3.emit() self.start_server_finished.emit()