From 668d1d408765c47c356cbdceedb1f79c14e0a07e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 05:14:35 +0000 Subject: import python-urlgrabber-3.10-9.el7 --- diff --git a/SOURCES/BZ-1204825-add-curl-object-opt.patch b/SOURCES/BZ-1204825-add-curl-object-opt.patch new file mode 100644 index 0000000..17b1496 --- /dev/null +++ b/SOURCES/BZ-1204825-add-curl-object-opt.patch @@ -0,0 +1,55 @@ +commit 30b1a7ba876bc798199aba99c013983cba79d72a +Author: Michal Domonkos +Date: Wed Nov 23 12:54:05 2016 +0100 + + Add curl_obj option. BZ 1204825 + +diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py +index 074a82f..25d8d17 100644 +--- a/urlgrabber/grabber.py ++++ b/urlgrabber/grabber.py +@@ -69,6 +69,24 @@ GENERAL ARGUMENTS (kwargs) + is None progress_obj is used in compatibility mode: finished files + are shown but there's no in-progress display. + ++ curl_obj = None ++ ++ a pycurl.Curl instance to be used instead of the default module-level ++ instance. ++ ++ Note that you don't have to configure the passed instance in any way; ++ urlgrabber will do all the necessary work. ++ ++ This option exists primarily to allow using urlgrabber from multiple ++ threads in your application, in which case you would want to instantiate a ++ fresh Curl object for each thread, to avoid race conditions. See the curl ++ documentation on thread safety for more information: ++ https://curl.haxx.se/libcurl/c/threadsafe.html ++ ++ Note that connection reuse (keepalive=1) is limited to the Curl instance it ++ was enabled on so if you're using multiple instances in your application, ++ connections won't be shared among them. ++ + text = None + + specifies alternative text to be passed to the progress meter +@@ -971,6 +989,7 @@ class URLGrabberOptions: + """ + self.progress_obj = None + self.multi_progress_obj = None ++ self.curl_obj = None + self.throttle = 1.0 + self.bandwidth = 0 + self.retry = None +@@ -1622,7 +1641,10 @@ class PyCurlFileObject(object): + raise err + + def _do_open(self): +- self.curl_obj = _curl_cache ++ if hasattr(self.opts, 'curl_obj') and self.opts.curl_obj is not None: ++ self.curl_obj = self.opts.curl_obj ++ else: ++ self.curl_obj = _curl_cache + self.curl_obj.reset() # reset all old settings away, just in case + # setup any ranges + self._set_opts() diff --git a/SPECS/python-urlgrabber.spec b/SPECS/python-urlgrabber.spec index f0c4d73..1acf245 100644 --- a/SPECS/python-urlgrabber.spec +++ b/SPECS/python-urlgrabber.spec @@ -3,7 +3,7 @@ Summary: A high-level cross-protocol url-grabber Name: python-urlgrabber Version: 3.10 -Release: 8%{?dist} +Release: 9%{?dist} Source0: http://urlgrabber.baseurl.org/download/urlgrabber-%{version}.tar.gz Patch1: BZ-853432-single-conn-reset.patch Patch2: BZ-1017491-respond-to-ctrl-c.patch @@ -18,6 +18,9 @@ Patch20: BZ-1233329-timedhosts-parsing-error-handling.patch # rhel-7.3 Patch25: BZ-1342179-add-retry-no-cache-opt.patch +# rhel-7.6 +Patch30: BZ-1204825-add-curl-object-opt.patch + License: LGPLv2+ Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -47,6 +50,9 @@ authentication, proxies and more. # rhel-7.3 %patch25 -p1 +# rhel-7.6 +%patch30 -p1 + %build python setup.py build @@ -66,6 +72,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{_libexecdir}/urlgrabber-ext-down %changelog +* Fri May 25 2018 Michal Domonkos - 3.10-9 +- Add curl_obj option. +- Resolves: bug#1204825 + * Thu Jun 30 2016 Valentina Mukhamedzhanova - 3.10-8 - Add no_cache and retry_no_cache options. - Resolves: bug#1342179