summaryrefslogtreecommitdiff
path: root/urlgrabber
diff options
context:
space:
mode:
authorZdenek Pavlas <zpavlas@redhat.com>2013-10-21 16:52:53 +0200
committerZdenek Pavlas <zpavlas@redhat.com>2013-10-21 16:53:21 +0200
commit93ad446fc6533304e33b231cd5786572773440b9 (patch)
tree6415afc62111e3306fb6ce09b74ce9bdb2632f01 /urlgrabber
parent70d092e558f3d57b04eaf7c654a734bdf90e07fc (diff)
downloadurlgrabber-93ad446fc6533304e33b231cd5786572773440b9.tar.gz
single-conn mode: Kill the cached idle connection. BZ 853432
The multi-downloader manages connections as necessary, caching at most one downloader per host. But there's one more connection, used by the legacy downloader. In case keepalive=1 (default), it's still connected, possibly to the same connection-limited host. Kill it.
Diffstat (limited to 'urlgrabber')
-rw-r--r--urlgrabber/grabber.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index b004f4d..d06cdae 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -2221,6 +2221,9 @@ def parallel_wait(meter=None):
# Turn on the max_connections=1 override. BZ 853432
if DEBUG: DEBUG.info('max_connections(%s) %s => 1', key, limit)
single.add(key)
+ # When using multi-downloader the parent's _curl_cache
+ # object is idle. Kill it, as it might use keepalive=1.
+ reset_curl_obj()
retry = opts.retry or 0
if opts.failure_callback: