[Zope-Checkins] CVS: Zope2 - Image.py:1.128.6.3
Martijn Pieters
mj@digicool.com
Wed, 18 Apr 2001 20:01:45 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/OFS
In directory korak:/tmp/cvs-serv19754
Modified Files:
Tag: mj-http_range_support-branch
Image.py
Log Message:
Simplification; have range sets optimized for cases where there is only 1
set as well.
--- Updated File Image.py in package Zope2 --
--- Image.py 2001/04/18 23:57:45 1.128.6.2
+++ Image.py 2001/04/19 00:01:45 1.128.6.3
@@ -392,18 +392,11 @@
return ''
# Can we optimize?
- if len(ranges) > 1:
- ranges = optimizeRanges(ranges, self.size)
+ ranges = optimizeRanges(ranges, self.size)
if len(ranges) == 1:
# Easy case, set extra header and return partial set.
start, end = ranges[0]
- if start < 0:
- start = self.size + start
- end = end or self.size
- if end > self.size:
- end = self.size
-
size = end - start
RESPONSE.setHeader('Last-Modified',