From 6bf8bb1db64f2982118ed7759cd8e139bb42541a Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Mon, 5 Aug 2019 11:30:19 -0500 Subject: [PATCH] progress removing onionr.py --- onionr/apiservers/private/__init__.py | 1 - onionr/httpapi/fdsafehandler.py | 14 ++++++++------ onionr/httpapi/miscclientapi/endpoints.py | 2 +- onionr/onionrblocks/insert.py | 1 - 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/onionr/apiservers/private/__init__.py b/onionr/apiservers/private/__init__.py index df32ae88..adeda677 100644 --- a/onionr/apiservers/private/__init__.py +++ b/onionr/apiservers/private/__init__.py @@ -41,7 +41,6 @@ class PrivateAPI: This also saves the used host (random localhost IP address) to the data folder in host.txt ''' self.config = config - self.serializer = serializeddata.SerializedData() self.startTime = epoch.get_epoch() app = flask.Flask(__name__) bindPort = int(config.get('client.client.port', 59496)) diff --git a/onionr/httpapi/fdsafehandler.py b/onionr/httpapi/fdsafehandler.py index c599efec..1f50bf32 100644 --- a/onionr/httpapi/fdsafehandler.py +++ b/onionr/httpapi/fdsafehandler.py @@ -7,15 +7,17 @@ class FDSafeHandler(WSGIHandler): self.timeout.start() try: WSGIHandler.handle(self) - except Exception as e: - self.handle_error(e) - finally: - self.timeout.close() - + except gevent.Timeout as ex: + if ex is self.timeout: + pass + else: + raise + ''' def handle_error(self, two, three, four): if two is self.timeout: self.result = [b"Timeout"] self.start_response("200 OK", []) self.process_result() else: - WSGIHandler.handle_error(self) \ No newline at end of file + WSGIHandler.handle_error(self) + ''' \ No newline at end of file diff --git a/onionr/httpapi/miscclientapi/endpoints.py b/onionr/httpapi/miscclientapi/endpoints.py index 64feadea..bab41413 100644 --- a/onionr/httpapi/miscclientapi/endpoints.py +++ b/onionr/httpapi/miscclientapi/endpoints.py @@ -116,4 +116,4 @@ class PrivateEndpoints: @private_endpoints_bp.route('/gettorsocks') def get_tor_socks(): - return Response(client_api._too_many.get(NetController).socksPort) \ No newline at end of file + return Response(str(client_api._too_many.get(NetController).socksPort)) \ No newline at end of file diff --git a/onionr/onionrblocks/insert.py b/onionr/onionrblocks/insert.py index 175055fa..fbaadcc7 100644 --- a/onionr/onionrblocks/insert.py +++ b/onionr/onionrblocks/insert.py @@ -144,5 +144,4 @@ def insert_block(data, header='txt', sign=False, encryptType='', symKey='', asym events.event('insertdeniable', {'content': plaintext, 'meta': plaintextMeta, 'hash': retData, 'peer': bytesconverter.bytes_to_str(asymPeer)}, threaded = True) else: events.event('insertblock', {'content': plaintext, 'meta': plaintextMeta, 'hash': retData, 'peer': bytesconverter.bytes_to_str(asymPeer)}, threaded = True) - return retData \ No newline at end of file