1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 09:16:14 +01:00

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".
This commit is contained in:
Sascha Peilicke 2013-09-30 17:23:02 +02:00
parent 7f1d7f6258
commit 42f9f2bf3e

View File

@ -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):