diff --git a/python-urlgrabber.spec b/python-urlgrabber.spec index 37e4263..b500bb7 100644 --- a/python-urlgrabber.spec +++ b/python-urlgrabber.spec @@ -3,10 +3,11 @@ Summary: A high-level cross-protocol url-grabber Name: python-urlgrabber Version: 2.9.9 -Release: 3 +Release: 4 Source0: urlgrabber-%{version}.tar.gz Patch0: urlgrabber-read-error.patch Patch1: urlgrabber-ssl-byterange-keepalive.patch +Patch2: urlgrabber-keepalive.patch License: LGPL Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot @@ -25,6 +26,7 @@ authentication, proxies and more. %setup -n urlgrabber-%{version} %patch0 -p0 %patch1 -p0 +%patch2 -p0 %build python setup.py build @@ -44,6 +46,9 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/urlgrabber %changelog +* Wed Dec 6 2006 Jeremy Katz - 2.9.9-4 +- fix keepalive (#218268) + * Sat Nov 11 2006 Florian La Roche - add version/release to "Provides: urlgrabber" diff --git a/urlgrabber-keepalive.patch b/urlgrabber-keepalive.patch new file mode 100644 index 0000000..c051a01 --- /dev/null +++ b/urlgrabber-keepalive.patch @@ -0,0 +1,24 @@ +--- urlgrabber/grabber.py 22 Sep 2006 00:58:05 -0000 1.48 ++++ urlgrabber/grabber.py 5 Dec 2006 23:48:51 -0000 +@@ -1198,13 +1198,21 @@ + """dump the file to self.filename.""" + if self.append: new_fo = open(self.filename, 'ab') + else: new_fo = open(self.filename, 'wb') ++ try: ++ # if we have a known range, only try to read that much. ++ (low, high) = self.opts.range ++ amount = high - low ++ except TypeError, ValueError: ++ amount = None + bs = 1024*8 + size = 0 + ++ if amount is not None: bs = min(bs, amount - size) + block = self.read(bs) + size = size + len(block) + while block: + new_fo.write(block) ++ if amount is not None: bs = min(bs, amount - size) + block = self.read(bs) + size = size + len(block) +