Commit f17ad6ac authored by bescoto's avatar bescoto

Possibly fixed logic error in rf caching


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@452 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 39840026
......@@ -7,6 +7,9 @@ Fixed bug in --test-server when using --restrict security options
--list-changed-since and --list-at-time now work remotely.
Thanks to Morten Werner Olsen for bug report.
Fixed logic bug that could make restoring extremely slow and waste
memory. Thanks for Jacques Botha for report.
New in v0.12.4 (2003/09/13)
---------------------------
......
......@@ -298,11 +298,15 @@ class CachedRF:
while 1:
if not self.rf_list:
if not self.add_rfs(index): return None
rf = self.rf_list.pop(0)
if rf.index < index: continue
elif rf.index == index: return rf
self.rf_list.insert(0, rf)
if not self.add_rfs(index): return None
rf = self.rf_list[0]
if rf.index == index: return rf
elif rf.index > index:
# Try to add earlier indicies. But if first is
# already from same directory, or we can't find any
# from that directory, then we know it can't be added.
if (index[:-1] == rf.index[:-1] or not
self.add_rfs(index)): return None
else: del self.rf_list[0]
def get_fp(self, index):
"""Return the file object (for reading) of given index"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment