From 82db79ca397aeecf9a9ed2707ca5d9b12dec1e1b Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Sat, 24 Aug 2013 20:23:49 -0400 Subject: [PATCH] removed option from previous commit which allowed user-settable maximum network message size pending further discussion --- src/class_receiveDataThread.py | 13 +------------ src/helper_startup.py | 4 ---- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/class_receiveDataThread.py b/src/class_receiveDataThread.py index f014aedd..19df1bdc 100644 --- a/src/class_receiveDataThread.py +++ b/src/class_receiveDataThread.py @@ -45,17 +45,6 @@ class receiveDataThread(threading.Thread): self.peer = shared.Peer(HOST, port) self.streamNumber = streamNumber self.payloadLength = 0 # This is the protocol payload length thus it doesn't include the 24 byte message header - self.maxMessageLength = 180000000 # maximum length of a message in bytes, default 180MB - - # get the maximum message length from the settings - try: - maxMsgLen = shared.config.getint( - 'bitmessagesettings', 'maxmessagelength') - if maxMsgLen > 32768: # minimum of 32K - self.maxMessageLength = maxMsgLen - except Exception: - pass - self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave = {} self.selfInitiatedConnections = selfInitiatedConnections shared.connectedHostsList[ @@ -149,7 +138,7 @@ class receiveDataThread(threading.Thread): shared.knownNodesLock.acquire() shared.knownNodes[self.streamNumber][self.peer] = int(time.time()) shared.knownNodesLock.release() - if self.payloadLength <= self.maxMessageLength: # If the size of the message is greater than the maximum, ignore it. + if self.payloadLength <= 180000000: # If the size of the message is greater than 180MB, ignore it. (I get memory errors when processing messages much larger than this though it is concievable that this value will have to be lowered if some systems are less tolarant of large messages.) remoteCommand = self.data[4:16] with shared.printLock: print 'remoteCommand', repr(remoteCommand.replace('\x00', '')), ' from', self.peer diff --git a/src/helper_startup.py b/src/helper_startup.py index 8b4c2111..256dbcaa 100644 --- a/src/helper_startup.py +++ b/src/helper_startup.py @@ -69,11 +69,7 @@ def loadConfig(): shared.config.set( 'bitmessagesettings', 'maxacceptablepayloadlengthextrabytes', '0') shared.config.set('bitmessagesettings', 'dontconnect', 'true') -<<<<<<< HEAD ensureNamecoinOptions() -======= - shared.config.set('bitmessagesettings', 'maxMessageLength', '180000000') ->>>>>>> 3ff76875aa5d8b8dbadef48e28cc7e919b9042b3 if storeConfigFilesInSameDirectoryAsProgramByDefault: # Just use the same directory as the program and forget about