summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c871fe1)
raw | patch | inline | side by side (parent: c871fe1)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 8 Oct 2009 12:18:47 +0000 (12:18 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 8 Oct 2009 12:18:47 +0000 (12:18 +0000) |
http://thread.gmane.org/gmane.comp.bug-tracking.roundup.user/9700
This also fixes a race condition where the forked roundup process would
consume 99% CPU resources after the client opens the SSL connection but
doesn't send anything, e.g.,
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 443))
ssl_sock = socket.ssl(s)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4362 57a73879-2fb5-44c3-a270-3262357dd7e2
This also fixes a race condition where the forked roundup process would
consume 99% CPU resources after the client opens the SSL connection but
doesn't send anything, e.g.,
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 443))
ssl_sock = socket.ssl(s)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4362 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/scripts/roundup_server.py | patch | blob | history |
index 2eaa5ece03c7ebe328e9e8a36ca349588d18970f..9427c8fc72383c9c752497e772d24d7c3f6d56be 100644 (file)
except ImportError:
SSL = None
+from time import sleep
+
# python version check
from roundup import configuration, version_check
from roundup import __version__ as roundup_version
try:
line = self.__fileobj.readline(*args)
except SSL.WantReadError:
+ sleep (.1)
line = None
return line
+ def read(self, *args):
+ """ SSL.Connection can return WantRead """
+ while True:
+ try:
+ return self.__fileobj.read(*args)
+ except SSL.WantReadError:
+ sleep (.1)
+
def __getattr__(self, attrib):
return getattr(self.__fileobj, attrib)