From 41368a274796ba2506905bc7ac4f654f3d376579 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Wed, 7 Aug 2019 18:14:13 -0500 Subject: [PATCH] fix broken connection pool --- onionr/communicator/peeraction.py | 4 ++-- onionr/static-data/www/chat/js/main.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/onionr/communicator/peeraction.py b/onionr/communicator/peeraction.py index 42af1e0f..d6e3fb4a 100644 --- a/onionr/communicator/peeraction.py +++ b/onionr/communicator/peeraction.py @@ -25,7 +25,7 @@ from . import onlinepeers def peer_action(comm_inst, peer, action, returnHeaders=False, max_resp_size=5242880): '''Perform a get request to a peer''' penalty_score = -10 - if not peer: + if len(peer) == 0: return False url = 'http://%s/%s' % (peer, action) @@ -40,7 +40,7 @@ def peer_action(comm_inst, peer, action, returnHeaders=False, max_resp_size=5242 ret_data = False penalty_score = -100 # if request failed, (error), mark peer offline - if not ret_data: + if ret_data == False: # For some reason "if not" breaks this. Prob has to do with empty string. try: comm_inst.getPeerProfileInstance(peer).addScore(penalty_score) onlinepeers.remove_online_peer(comm_inst, peer) diff --git a/onionr/static-data/www/chat/js/main.js b/onionr/static-data/www/chat/js/main.js index 9d370301..c5027ca0 100755 --- a/onionr/static-data/www/chat/js/main.js +++ b/onionr/static-data/www/chat/js/main.js @@ -2,7 +2,6 @@ friendList = {} convoListElement = document.getElementsByClassName('conversationList')[0] function createConvoList(){ - console.log(friendList) for (friend in friendList){ var convoEntry = document.createElement('li')