]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Comments...
authorTim Kientzle <kientzle@gmail.com>
Tue, 22 Nov 2011 05:32:59 +0000 (00:32 -0500)
committerTim Kientzle <kientzle@gmail.com>
Tue, 22 Nov 2011 05:32:59 +0000 (00:32 -0500)
SVN-Revision: 3828

libarchive/archive_read.c
libarchive/archive_read_open_filename.c

index 1fa407ee6412ad6e7f3963e3c5b9faa6b1ff8e4e..53c7e6480fee07f3f021e879d1230a6e054e1ba6 100644 (file)
@@ -1332,6 +1332,23 @@ __archive_read_filter_seek(struct archive_read_filter *filter, int64_t offset, i
                return (ARCHIVE_FAILED);
        r = filter->seek(filter, offset, whence);
        if (r >= 0) {
+               /*
+                * Ouch.  Clearing the buffer like this hurts, especially
+                * at bid time.  A lot of our efficiency at bid time comes
+                * from having bidders reuse the data we've already read.
+                *
+                * TODO: If the seek request is in data we already
+                * have, then don't call the seek callback.
+                *
+                * TODO: Zip seeks to end-of-file at bid time.  If
+                * other formats also start doing this, we may need to
+                * find a way for clients to fudge the seek offset to
+                * a block boundary.
+                *
+                * Hmmm... If whence was SEEK_END, we know the file
+                * size is (r - offset).  Can we use that to simplify
+                * the TODO items above?
+                */
                filter->avail = filter->client_avail = 0;
                filter->next = filter->buffer;
                filter->position = r;
index 5ea27c9b68d8ffb9fc5ae1e70b72919ac8552f5e..bf52697249965dd24e8d17d7b9bddb75e32a68ce 100644 (file)
@@ -443,6 +443,9 @@ file_skip(struct archive *a, void *client_data, int64_t request)
        return (0);
 }
 
+/*
+ * TODO: Store the offset and use it in the read callback.
+ */
 static int64_t
 file_seek(struct archive *a, void *client_data, int64_t request, int whence)
 {