summaryrefslogtreecommitdiff
path: root/lib/Handle.cc
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-07-02 17:32:54 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-07-02 17:32:54 +0200
commit0cb535bf32e17c31892a5f6fa61b43c30652562d (patch)
tree41a83132c7582bf7a050a8f51d45adaa2fa1c765 /lib/Handle.cc
parenta94c144f180edbb018c907ff1b9348880afd605a (diff)
Revert "Working around a few zlib issues."
This reverts commit 7e0849253145833bc923d249238483da1a115169.
Diffstat (limited to 'lib/Handle.cc')
-rw-r--r--lib/Handle.cc21
1 files changed, 1 insertions, 20 deletions
diff --git a/lib/Handle.cc b/lib/Handle.cc
index 39bc981..7fd8947 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -463,9 +463,6 @@ ssize_t Handle::uread(void * buf, size_t count) {
#ifdef DEBUG
printm(M_BARE, String(_("Performing gzread of ")) + count + _(" byte(s) for handle ") + h + "\n");
#endif
- ssize_t msize = GetSize();
- if ((msize >= 0) && ((count + itell) >= msize))
- count = msize - itell;
int err = gzread(zfile, buf, count);
if (err == -1) {
throw GeneralException(String("Error reading zstream: ") + gzerror(zfile, &err));
@@ -506,23 +503,7 @@ bool Handle::CanSeek() const {
off_t Handle::seek(off_t offset, int whence) throw(GeneralException) {
if (z) {
- ssize_t msize = GetSize();
- if (msize >= 0) {
- switch (whence) {
- case SEEK_CUR:
- offset += itell;
- break;
- case SEEK_END:
- offset += msize;
- break;
- }
- return itell = gzseek(zfile, offset, SEEK_SET);
- } else {
- if (whence == SEEK_END) {
- throw IOGeneral("zlib can't seek from the end on a stream.");
- }
- return itell = gzseek(zfile, offset, whence);
- }
+ return itell = gzseek(zfile, offset, whence);
} else {
throw IOGeneral(_("Handle ") + GetName() + _(" can't seek"));
}