mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
parent
2bd71b4ea4
commit
08fe7fd200
@ -22,7 +22,6 @@
|
||||
#include "Poco/Zip/ZipCommon.h"
|
||||
#include "Poco/Zip/ZipUtil.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Zip {
|
||||
|
||||
|
@ -83,6 +83,12 @@ void Compress::addEntry(std::istream& in, const Poco::DateTime& lastModifiedAt,
|
||||
|
||||
std::streamoff localHeaderOffset = _offset;
|
||||
ZipLocalFileHeader hdr(fileName, lastModifiedAt, cm, cl, _forceZip64);
|
||||
std::streampos pos = in.tellg();
|
||||
in.seekg(0, in.end);
|
||||
std::streampos length = in.tellg();
|
||||
in.seekg(pos);
|
||||
if (length >= ZipCommon::ZIP64_MAGIC)
|
||||
hdr.setZip64Data();
|
||||
hdr.setStartPos(localHeaderOffset);
|
||||
|
||||
ZipOutputStream zipOut(_out, hdr, _seekableOut);
|
||||
|
@ -243,7 +243,8 @@ void ZipLocalFileHeader::init(const Poco::Path& fName, ZipCommon::CompressionMet
|
||||
}
|
||||
else
|
||||
setCompressionMethod(ZipCommon::CM_STORE);
|
||||
if (_forceZip64)
|
||||
|
||||
if (needsZip64())
|
||||
setZip64Data();
|
||||
|
||||
_rawHeader[GENERAL_PURPOSE_POS+1] |= 0x08; // Set "language encoding flag" to indicate that filenames and paths are in UTF-8.
|
||||
|
Loading…
Reference in New Issue
Block a user