From 42f9f2bf3ef43a3dbf4b918f2dbd768025fb8a1d Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Mon, 30 Sep 2013 17:23:02 +0200 Subject: [PATCH] Set socket timeout to 0 by default. As long as the timeout is >= 0, Python's _ssl module will still use non-blocking I/O but not poll() but select(). poll(&fd, 1, TIMEOUT) seems to block _at least_ TIMEOUT time regardless of any errors. Currently, with SUSE's internal IPv6 layout, this meant a hang of a second per binary to fetch during "osc build". --- osc/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osc/core.py b/osc/core.py index 133d4c70..27c80e7e 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2901,7 +2901,7 @@ def makeurl(baseurl, l, query=[]): return urlunsplit((scheme, netloc, '/'.join(l), query, '')) -def http_request(method, url, headers={}, data=None, file=None, timeout=100): +def http_request(method, url, headers={}, data=None, file=None, timeout=0): """wrapper around urllib2.urlopen for error handling, and to support additional (PUT, DELETE) methods""" def create_memoryview(obj):