mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-05 04:37:50 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user