From 225789d01f7b1c91cce48068f892313c3d3dab7f Mon Sep 17 00:00:00 2001 From: mailchuck Date: Tue, 22 Mar 2016 14:47:18 +0100 Subject: [PATCH] Restrict pending parallel requests on proxy This saves some network resources if using Tor, for example. --- src/bitmessagemain.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 854b4591..2df03a54 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -59,6 +59,12 @@ def connectToStream(streamNumber): maximumNumberOfHalfOpenConnections = 9 else: maximumNumberOfHalfOpenConnections = 64 + try: + # don't overload Tor + if shared.config.get('bitmessagesettings', 'socksproxytype') != 'none': + maximumNumberOfHalfOpenConnections = 4 + except: + pass for i in range(maximumNumberOfHalfOpenConnections): a = outgoingSynSender() a.setup(streamNumber, selfInitiatedConnections)