summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd160bf)
raw | patch | inline | side by side (parent: bd160bf)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 13 Oct 2009 09:05:21 +0000 (09:05 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 13 Oct 2009 09:05:21 +0000 (09:05 +0000) |
don't call socket.setdefaulttimeout in case of SSL. This apparently
now never raises a WantReadError from SSL.
This also fixes a case where a WantReadError is raised and apparently
the bytes already read are dropped (seems the WantReadError is really
an error, not just an indication to retry).
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4377 57a73879-2fb5-44c3-a270-3262357dd7e2
now never raises a WantReadError from SSL.
This also fixes a case where a WantReadError is raised and apparently
the bytes already read are dropped (seems the WantReadError is really
an error, not just an indication to retry).
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4377 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/scripts/roundup_server.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 27cc746b5334c5d8fc3f2928f027f9761805fb7d..14cba11db3ff6403af2845dab1fa230fb310a44b 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
This file contains the changes to the Roundup system over time. The entries
are given with the most recent entry first.
+2009-XX-XX 1.4.XX (rXXXX)
+
+Fixes:
+- More SSL fixes. SSL wants the underlying socket non-blocking. So we
+ don't call socket.setdefaulttimeout in case of SSL. This apparently
+ never raises a WantReadError from SSL.
+ This also fixes a case where a WantReadError is raised and apparently
+ the bytes already read are dropped (seems the WantReadError is really
+ an error, not just an indication to retry).
+
2009-10-09 1.4.10 (r4374)
Fixes:
index 9427c8fc72383c9c752497e772d24d7c3f6d56be..2ebd56ea3c79e3bb26f8b3ea0df00d0bd573eb6a 100644 (file)
def readline(self, *args):
""" SSL.Connection can return WantRead """
- line = None
- while not line:
+ while True:
try:
- line = self.__fileobj.readline(*args)
+ return self.__fileobj.readline(*args)
except SSL.WantReadError:
sleep (.1)
- line = None
- return line
def read(self, *args):
""" SSL.Connection can return WantRead """
if self["SSL"]:
base_server = SecureHTTPServer
else:
+ # time out after a minute if we can
+ # This sets the socket to non-blocking. SSL needs a blocking
+ # socket, so we do this only for non-SSL connections.
+ if hasattr(socket, 'setdefaulttimeout'):
+ socket.setdefaulttimeout(60)
base_server = BaseHTTPServer.HTTPServer
# obtain request server class
def run(port=undefined, success_message=None):
''' Script entry point - handle args and figure out what to to.
'''
- # time out after a minute if we can
- if hasattr(socket, 'setdefaulttimeout'):
- socket.setdefaulttimeout(60)
-
config = ServerConfig()
# additional options
short_options = "hvS"