fix for GH #1416: use seekg() instead of multiple putback() operations, which may not work in all cases. Note that this requires the stream passed to Poco::Zip::Decompress to be seekable.

This commit is contained in:
Günter Obiltschnig
2016-09-29 11:25:03 +02:00
parent 4c7562c497
commit ed0284c7c6
6 changed files with 19 additions and 24 deletions

View File

@@ -17,6 +17,7 @@
#include "Poco/Zip/SkipCallback.h"
#include "Poco/Zip/ZipLocalFileHeader.h"
#include "Poco/Zip/ZipUtil.h"
#include "Poco/Exception.h"
namespace Poco {
@@ -39,6 +40,7 @@ bool SkipCallback::handleZipEntry(std::istream& zipStream, const ZipLocalFileHea
zipStream.seekg(hdr.getCompressedSize(), std::ios_base::cur);
else
ZipUtil::sync(zipStream);
if (!zipStream.good()) throw Poco::IOException("Failed to seek on input stream");
return true;
}