From c98ca590a8fcbe65a7ce668529d2fdcea5654de6 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Mon, 20 Jan 2014 15:25:02 -0500 Subject: [PATCH 1/3] Fix #566 --- src/bitmessagemain.py | 9 ++++++--- src/helper_startup.py | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 4b210443..e4a073d9 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -15,7 +15,8 @@ import singleton import os from SimpleXMLRPCServer import SimpleXMLRPCServer -from api import MySimpleXMLRPCRequestHandler +from api import MySimpleXMLRPCRequestHandler +from helper_startup import isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections import shared from helper_sql import sqlQuery @@ -59,10 +60,12 @@ def connectToStream(streamNumber): for row in queryData: shared.inventorySets[streamNumber].add(row[0]) - if sys.platform[0:3] == 'win': + + if isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections(): + # Some XP and Vista systems can only have 10 outgoing connections at a time. maximumNumberOfHalfOpenConnections = 9 else: - maximumNumberOfHalfOpenConnections = 32 + maximumNumberOfHalfOpenConnections = 64 for i in range(maximumNumberOfHalfOpenConnections): a = outgoingSynSender() a.setup(streamNumber, selfInitiatedConnections) diff --git a/src/helper_startup.py b/src/helper_startup.py index 0e35e594..0bae9496 100644 --- a/src/helper_startup.py +++ b/src/helper_startup.py @@ -5,6 +5,8 @@ import os import locale import random import string +import platform +from distutils.version import StrictVersion from namecoin import ensureNamecoinOptions @@ -119,3 +121,13 @@ def loadConfig(): os.umask(0o077) with open(shared.appdata + 'keys.dat', 'wb') as configfile: shared.config.write(configfile) + +def isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections(): + try: + VER_THIS=StrictVersion(platform.version()) + if sys.platform[0:3]=="win": + return StrictVersion("5.1.2600")VER_THIS + return False + except Exception as err: + print 'An Exception occurred within isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections:', err + return False \ No newline at end of file From 7983a147545b254b4c8442609394dd0d9f9105aa Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Mon, 20 Jan 2014 23:04:41 -0500 Subject: [PATCH 2/3] Increment version number to 0.4.2 --- Makefile | 2 +- arch.sh | 4 ++-- archpackage/PKGBUILD | 2 +- debian.sh | 4 ++-- ebuild.sh | 4 ++-- generate.sh | 2 +- puppy.sh | 4 ++-- rpm.sh | 4 ++-- rpmpackage/pybitmessage.spec | 2 +- slack.sh | 4 ++-- src/build_osx.py | 2 +- src/shared.py | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index c234dc29..457bd128 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ APP=pybitmessage -VERSION=0.4.1 +VERSION=0.4.2 RELEASE=1 ARCH_TYPE=`uname -m` PREFIX?=/usr/local diff --git a/arch.sh b/arch.sh index 386974e7..e025ddcf 100755 --- a/arch.sh +++ b/arch.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.1 -VERSION=0.4.1 +PREV_VERSION=0.4.2 +VERSION=0.4.2 RELEASE=1 ARCH_TYPE=any CURRDIR=`pwd` diff --git a/archpackage/PKGBUILD b/archpackage/PKGBUILD index 76657030..33eed270 100644 --- a/archpackage/PKGBUILD +++ b/archpackage/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Bob Mottram (4096 bits) pkgname=pybitmessage -pkgver=0.4.1 +pkgver=0.4.2 pkgrel=1 pkgdesc="Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide "non-content" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." arch=('any') diff --git a/debian.sh b/debian.sh index c279d07e..d80d9db9 100755 --- a/debian.sh +++ b/debian.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.1 -VERSION=0.4.1 +PREV_VERSION=0.4.2 +VERSION=0.4.2 RELEASE=1 ARCH_TYPE=all DIR=${APP}-${VERSION} diff --git a/ebuild.sh b/ebuild.sh index c2beffb1..59295718 100755 --- a/ebuild.sh +++ b/ebuild.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.1 -VERSION=0.4.1 +PREV_VERSION=0.4.2 +VERSION=0.4.2 RELEASE=1 SOURCEDIR=. ARCH_TYPE=`uname -m` diff --git a/generate.sh b/generate.sh index 00aad16e..933c08e9 100755 --- a/generate.sh +++ b/generate.sh @@ -4,7 +4,7 @@ rm -f Makefile rpmpackage/*.spec -packagemonkey -n "PyBitmessage" --version "0.4.1" --dir "." -l "mit" \ +packagemonkey -n "PyBitmessage" --version "0.4.2" --dir "." -l "mit" \ -e "Bob Mottram (4096 bits) " \ --brief "Send encrypted messages" \ --desc "Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide \"non-content\" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." \ diff --git a/puppy.sh b/puppy.sh index 549c1200..6107ff4a 100755 --- a/puppy.sh +++ b/puppy.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.1 -VERSION=0.4.1 +PREV_VERSION=0.4.2 +VERSION=0.4.2 RELEASE=1 BUILDDIR=~/petbuild CURRDIR=`pwd` diff --git a/rpm.sh b/rpm.sh index 7595a500..074a4515 100755 --- a/rpm.sh +++ b/rpm.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.1 -VERSION=0.4.1 +PREV_VERSION=0.4.2 +VERSION=0.4.2 RELEASE=1 SOURCEDIR=. ARCH_TYPE=`uname -m` diff --git a/rpmpackage/pybitmessage.spec b/rpmpackage/pybitmessage.spec index 67332f63..a33fac72 100644 --- a/rpmpackage/pybitmessage.spec +++ b/rpmpackage/pybitmessage.spec @@ -1,5 +1,5 @@ Name: pybitmessage -Version: 0.4.1 +Version: 0.4.2 Release: 1%{?dist} Summary: Send encrypted messages License: MIT diff --git a/slack.sh b/slack.sh index 7a6013a3..9b6d70f7 100755 --- a/slack.sh +++ b/slack.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.1 -VERSION=0.4.1 +PREV_VERSION=0.4.2 +VERSION=0.4.2 RELEASE=1 ARCH_TYPE=`uname -m` BUILDDIR=~/slackbuild diff --git a/src/build_osx.py b/src/build_osx.py index 96d46250..f2bf8378 100644 --- a/src/build_osx.py +++ b/src/build_osx.py @@ -1,7 +1,7 @@ from setuptools import setup name = "Bitmessage" -version = "0.4.1" +version = "0.4.2" mainscript = ["bitmessagemain.py"] setup( diff --git a/src/shared.py b/src/shared.py index 011c89d9..e6642c70 100644 --- a/src/shared.py +++ b/src/shared.py @@ -1,4 +1,4 @@ -softwareVersion = '0.4.1' +softwareVersion = '0.4.2' verbose = 1 maximumAgeOfAnObjectThatIAmWillingToAccept = 216000 # Equals two days and 12 hours. lengthOfTimeToLeaveObjectsInInventory = 237600 # Equals two days and 18 hours. This should be longer than maximumAgeOfAnObjectThatIAmWillingToAccept so that we don't process messages twice. From 917e27c19b5a3425cf560ac45f5d238dc53ecb32 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Tue, 21 Jan 2014 01:17:36 -0500 Subject: [PATCH 3/3] minor change to new function isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections --- src/helper_startup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helper_startup.py b/src/helper_startup.py index 0bae9496..abc4958f 100644 --- a/src/helper_startup.py +++ b/src/helper_startup.py @@ -126,7 +126,7 @@ def isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections(): try: VER_THIS=StrictVersion(platform.version()) if sys.platform[0:3]=="win": - return StrictVersion("5.1.2600")VER_THIS + return StrictVersion("5.1.2600")<=VER_THIS and StrictVersion("6.0.6000")>=VER_THIS return False except Exception as err: print 'An Exception occurred within isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections:', err