From 0ab0e6757a460e1704478d8a2785048443ad39d6 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 50971f66..43db5ae1 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)