preparation for switch from 32 bit time to 64 bit time in protocol

This commit is contained in:
Jonathan Warren 2013-04-17 14:42:03 -04:00
parent c50ab9ff9c
commit f75f0b20a8

View File

@ -1481,6 +1481,8 @@ class receiveDataThread(QThread):
if len(data) != lengthOfNumberOfAddresses + (38 * numberOfAddressesIncluded): if len(data) != lengthOfNumberOfAddresses + (38 * numberOfAddressesIncluded):
print 'addr message does not contain the correct amount of data. Ignoring.' print 'addr message does not contain the correct amount of data. Ignoring.'
return return
else:
print 'len of addr data is correct:', len(data)
needToWriteKnownNodesToDisk = False needToWriteKnownNodesToDisk = False
for i in range(0,numberOfAddressesIncluded): for i in range(0,numberOfAddressesIncluded):
@ -1516,7 +1518,7 @@ class receiveDataThread(QThread):
break #giving up on unpacking any more. We should still be connected however. break #giving up on unpacking any more. We should still be connected however.
try: try:
recaddrPort, = unpack('>H',data[36+lengthOfNumberOfAddresses+(38*i):42+lengthOfNumberOfAddresses+(38*i)]) recaddrPort, = unpack('>H',data[36+lengthOfNumberOfAddresses+(38*i):38+lengthOfNumberOfAddresses+(38*i)])
except Exception, err: except Exception, err:
printLock.acquire() printLock.acquire()
sys.stderr.write('ERROR TRYING TO UNPACK recaddr (recaddrPort). Message: %s\n' % str(err)) sys.stderr.write('ERROR TRYING TO UNPACK recaddr (recaddrPort). Message: %s\n' % str(err))