[Zodb-checkins] CVS: StandaloneZODB/ZODB - FileStorage.py:1.66
Jeremy Hylton
jeremy@zope.com
Tue, 2 Oct 2001 15:50:17 -0400
Update of /cvs-repository/StandaloneZODB/ZODB
In directory cvs.zope.org:/tmp/cvs-serv17221
Modified Files:
FileStorage.py
Log Message:
Fix bug in description of FileStorage layout.
Simplify santiy checking of length fields in transaction metadata.
Replace the following test:
[1] if ul > tl or dl > tl or el > tl or tl < (23+ul+dl+el):
with this one:
[2] if tl < (23+ul+dl+el):
If any of the first three comparisons in [1] is true, then the final
test must also be true. It's unlikely that any of the tests will be
true, so just do the final one.
=== StandaloneZODB/ZODB/FileStorage.py 1.65 => 1.66 ===
#
# - description
+#
+# - extension attributes
#
# * A sequence of data records
#
@@ -400,7 +402,7 @@
if stl != rstl: return 0 # inconsistent lengths
if status == 'u': continue # undone trans, search back
if status not in ' p': return 0
- if ul > tl or dl > tl or el > tl or tl < (23+ul+dl+el): return 0
+ if tl < (23+ul+dl+el): return 0
tend=pos+tl
opos=pos+(23+ul+dl+el)
if opos==tend: continue # empty trans
@@ -1808,7 +1810,7 @@
if status not in ' up':
warn('%s has invalid status, %s, at %s', name, status, pos)
- if ul > tl or dl > tl or el > tl or tl < (23+ul+dl+el):
+ if tl < (23+ul+dl+el):
# We're in trouble. Find out if this is bad data in the
# middle of the file, or just a turd that Win 9x dropped
# at the end when the system crashed.
@@ -2025,7 +2027,7 @@
if status not in ' up':
warn('%s has invalid status, %s, at %s', name, status, pos)
- if ul > tl or dl > tl or el > tl or tl < (23+ul+dl+el):
+ if tl < (23+ul+dl+el):
# We're in trouble. Find out if this is bad data in
# the middle of the file, or just a turd that Win 9x
# dropped at the end when the system crashed. Skip to