Client will now accept more than one connection from the same remote IP

This commit is contained in:
Jonathan Warren 2012-12-27 11:26:52 -05:00
parent 6877ca7cce
commit 086ac940c6

View File

@ -186,14 +186,17 @@ class singleListener(QThread):
while config.get('bitmessagesettings', 'socksproxytype')[0:5] == 'SOCKS':
a,(HOST,PORT) = sock.accept()
while HOST in connectedHostsList:
#Users are finding that if they run more than one node in the same network (thus with the same public IP), they can not connect with the second node. This is because this section of code won't accept the connection from the same IP. This problem will go away when the Bitmessage network grows behond being tiny but in the mean time, I'll comment out this code section.
"""while HOST in connectedHostsList:
print 'incoming connection is from a host in connectedHostsList (we are already connected to it). Ignoring it.'
a,(HOST,PORT) = sock.accept()
a,(HOST,PORT) = sock.accept()"""
rd = receiveDataThread()
print self, 'connected to', HOST,'during INCOMING request.'
sd = sendDataThread()
@ -274,7 +277,6 @@ class receiveDataThread(QThread):
del connectedHostsList[self.HOST]
except Exception, err:
#I think that the only way an exception could occur here is if we connect to ourselves because it would try to delete the same IP from connectedHostsList twice.
print 'Could not delete', self.HOST, 'from connectedHostsList.', err
def processData(self):
@ -534,6 +536,8 @@ class receiveDataThread(QThread):
sendersPubkey = rsa.PublicKey(convertStringToInt(nString),convertStringToInt(eString))
#print 'senders Pubkey', sendersPubkey
#You may notice that this signature doesn't cover any information that identifies the RECEIVER of the message. This makes it vulnerable to a malicious receiver Bob forwarding the message from Alice to Charlie, making it look like Alice sent the message to Charlie. This will be fixed in the next version.
print 'verify passed'
except Exception, err: