client/rhel/rhnlib/rhn/connections.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 6c2a93bcb7efa9873aee956f0cf7355177d4cc59
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Aug 8 12:15:13 2011 +0200
688095 - set timeout for HTTP connections
This would work only with python 2.6.1 and beyond (i.e. no RHEL-5 and friends).
diff --git a/client/rhel/rhnlib/rhn/connections.py
b/client/rhel/rhnlib/rhn/connections.py
index 2f858f1..a33ce15 100644
--- a/client/rhel/rhnlib/rhn/connections.py
+++ b/client/rhel/rhnlib/rhn/connections.py
@@ -29,7 +29,11 @@ class HTTPConnection(httplib.HTTPConnection):
response_class = HTTPResponse
def __init__(self, host, port=None):
- httplib.HTTPConnection.__init__(self, host, port)
+ from platform import python_version
+ if python_version() >= '2.6.1':
+ httplib.HTTPConnection.__init__(self, host, port,
timeout=SSL.DEFAULT_TIMEOUT)
+ else:
+ httplib.HTTPConnection.__init__(self, host, port)
self._cb_rs = []
self._cb_ws = []
self._cb_ex = []
Show replies by date