Fix issue #804 #805

Merged
Atheros1 merged 3 commits from master into master 2015-07-15 17:58:16 +02:00
Showing only changes of commit 05182e7465 - Show all commits

View File

@ -82,12 +82,11 @@ class sendDataThread(threading.Thread):
uploadRateLimitBytes = 999999999 # float("inf") doesn't work uploadRateLimitBytes = 999999999 # float("inf") doesn't work
else: else:
uploadRateLimitBytes = shared.config.getint('bitmessagesettings', 'maxuploadrate') * 1000 uploadRateLimitBytes = shared.config.getint('bitmessagesettings', 'maxuploadrate') * 1000
numberOfBytesWeMaySend = uploadRateLimitBytes - shared.numberOfBytesSentLastSecond amountSent = self.sock.send(data[:1000])
self.sock.sendall(data[:numberOfBytesWeMaySend]) shared.numberOfBytesSent += amountSent # used for the 'network status' tab in the UI
shared.numberOfBytesSent += len(data[:numberOfBytesWeMaySend]) # used for the 'network status' tab in the UI shared.numberOfBytesSentLastSecond += amountSent
shared.numberOfBytesSentLastSecond += len(data[:numberOfBytesWeMaySend])
self.lastTimeISentData = int(time.time()) self.lastTimeISentData = int(time.time())
data = data[numberOfBytesWeMaySend:] data = data[amountSent:]
def run(self): def run(self):