I noticed that my skip callback was always being invoked with a request of
0. This is a bit wasteful since skip callbacks commonly involve a syscall
like lseek().
Also, it seems good to error out when the skip callback is buggy, and claims
to skip more than requested.
Test Plan:
```
autoreconf -ivf && ./configure && make && make check
```
The same tests fail as before, with the same error messages. If interested,
both failure logs are here:
https://github.com/snarkmaster/libarchive/commit/
00c9751cde6cc888fb844b7a1fcc0f82dbaaedb1
These are on Ubuntu 14.04.
ask = skip_limit;
get = (self->archive->client.skipper)
(&self->archive->archive, self->data, ask);
- if (get == 0)
+ total += get;
+ if (get == 0 || get == request)
return (total);
+ if (get > request)
+ return ARCHIVE_FATAL;
request -= get;
- total += get;
}
} else if (self->archive->client.seeker != NULL
&& request > 64 * 1024) {