mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 11:14:58 -06:00
16.03
This commit is contained in:
committed by
Kornel Lesiński
parent
1eddf527ca
commit
232ce79574
@@ -276,7 +276,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
|
||||
EXTERNAL_CODECS_VARS
|
||||
m_Items, updateItems, outStream,
|
||||
m_Archive.IsOpen() ? &m_Archive : NULL, _removeSfxBlock,
|
||||
&options, callback);
|
||||
options, callback);
|
||||
|
||||
COM_TRY_END2
|
||||
}
|
||||
|
||||
@@ -1454,7 +1454,10 @@ HRESULT CVols::ParseArcName(IArchiveOpenVolumeCallback *volCallback)
|
||||
if (result == S_FALSE || !ZipStream)
|
||||
{
|
||||
if (MissingName.IsEmpty())
|
||||
{
|
||||
MissingZip = true;
|
||||
MissingName = volName;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -1988,6 +1991,12 @@ HRESULT CInArchive::ReadHeaders2(CObjectVector<CItemEx> &items)
|
||||
|
||||
if (!IsMultiVol)
|
||||
{
|
||||
if (EcdVolIndex == 0 && Vols.MissingZip && Vols.StartIsExe)
|
||||
{
|
||||
Vols.MissingName.Empty();
|
||||
Vols.MissingZip = false;
|
||||
}
|
||||
|
||||
UseDisk_in_SingleVol = true;
|
||||
|
||||
if (localsWereRead)
|
||||
|
||||
@@ -139,6 +139,7 @@ public:
|
||||
bool StartIsZ; // is .zip or .zNN
|
||||
bool StartIsZip; // is .zip
|
||||
bool IsUpperCase;
|
||||
bool MissingZip;
|
||||
Int32 StartVolIndex; // = (NN - 1), if StartStream is .zNN
|
||||
|
||||
Int32 StartParsingVol; // if we need local parsing, we must use that stream
|
||||
@@ -173,6 +174,7 @@ public:
|
||||
BaseName.Empty();
|
||||
MissingName.Empty();
|
||||
|
||||
MissingZip = false;
|
||||
ecd_wasRead = false;
|
||||
|
||||
Streams.Clear();
|
||||
|
||||
@@ -584,7 +584,7 @@ static HRESULT Update2(
|
||||
CInArchive *inArchive,
|
||||
const CObjectVector<CItemEx> &inputItems,
|
||||
CObjectVector<CUpdateItem> &updateItems,
|
||||
const CCompressionMethodMode *options,
|
||||
const CCompressionMethodMode &options,
|
||||
const CByteBuffer *comment,
|
||||
IArchiveUpdateCallback *updateCallback)
|
||||
{
|
||||
@@ -629,17 +629,15 @@ static HRESULT Update2(
|
||||
|
||||
UInt64 totalComplexity = complexity;
|
||||
|
||||
CAddCommon compressor(*options);
|
||||
CAddCommon compressor(options);
|
||||
|
||||
complexity = 0;
|
||||
|
||||
CCompressionMethodMode options2;
|
||||
if (options != 0)
|
||||
options2 = *options;
|
||||
CCompressionMethodMode options2 = options;
|
||||
|
||||
#ifndef _7ZIP_ST
|
||||
|
||||
UInt32 numThreads = options->NumThreads;
|
||||
UInt32 numThreads = options.NumThreads;
|
||||
const UInt32 kNumMaxThreads = 64;
|
||||
if (numThreads > kNumMaxThreads)
|
||||
numThreads = kNumMaxThreads;
|
||||
@@ -652,12 +650,12 @@ static HRESULT Update2(
|
||||
const size_t kMemPerThread = (1 << 25);
|
||||
const size_t kBlockSize = 1 << 16;
|
||||
|
||||
bool mtMode = ((options != 0) && (numThreads > 1));
|
||||
bool mtMode = (numThreads > 1);
|
||||
|
||||
if (numFilesToCompress <= 1)
|
||||
mtMode = false;
|
||||
|
||||
Byte method = options->MethodSequence.Front();
|
||||
Byte method = options.MethodSequence.Front();
|
||||
|
||||
if (!mtMode)
|
||||
{
|
||||
@@ -670,7 +668,7 @@ static HRESULT Update2(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (method == NFileHeader::NCompressionMethod::kStored && !options->PasswordIsDefined)
|
||||
if (method == NFileHeader::NCompressionMethod::kStored && !options.PasswordIsDefined)
|
||||
numThreads = 1;
|
||||
if (method == NFileHeader::NCompressionMethod::kBZip2)
|
||||
{
|
||||
@@ -855,16 +853,16 @@ static HRESULT Update2(
|
||||
|
||||
if (isDir)
|
||||
{
|
||||
WriteDirHeader(archive, options, ui, item);
|
||||
WriteDirHeader(archive, &options, ui, item);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lastRealStreamItemIndex < (int)itemIndex)
|
||||
{
|
||||
lastRealStreamItemIndex = itemIndex;
|
||||
SetFileHeader(archive, *options, ui, item);
|
||||
SetFileHeader(archive, options, ui, item);
|
||||
// file Size can be 64-bit !!!
|
||||
archive.PrepareWriteCompressedData(item.Name.Len(), ui.Size, options->IsRealAesMode());
|
||||
archive.PrepareWriteCompressedData(item.Name.Len(), ui.Size, options.IsRealAesMode());
|
||||
}
|
||||
|
||||
CMemBlocks2 &memRef = refs.Refs[itemIndex];
|
||||
@@ -874,12 +872,12 @@ static HRESULT Update2(
|
||||
CMyComPtr<IOutStream> outStream;
|
||||
archive.CreateStreamForCompressing(&outStream);
|
||||
memRef.WriteToStream(memManager.GetBlockSize(), outStream);
|
||||
SetFileHeader(archive, *options, ui, item);
|
||||
SetFileHeader(archive, options, ui, item);
|
||||
// the BUG was fixed in 9.26:
|
||||
// SetItemInfoFromCompressingResult must be after SetFileHeader
|
||||
// to write correct Size.
|
||||
SetItemInfoFromCompressingResult(memRef.CompressingResult,
|
||||
options->IsRealAesMode(), options->AesKeyMode, item);
|
||||
options.IsRealAesMode(), options.AesKeyMode, item);
|
||||
archive.WriteLocalHeader_And_SeekToNextFile(item);
|
||||
// RINOK(updateCallback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK));
|
||||
memRef.FreeOpt(&memManager);
|
||||
@@ -920,9 +918,9 @@ static HRESULT Update2(
|
||||
{
|
||||
RINOK(threadInfo.OutStreamSpec->WriteToRealStream());
|
||||
threadInfo.OutStreamSpec->ReleaseOutStream();
|
||||
SetFileHeader(archive, *options, ui, item);
|
||||
SetFileHeader(archive, options, ui, item);
|
||||
SetItemInfoFromCompressingResult(threadInfo.CompressingResult,
|
||||
options->IsRealAesMode(), options->AesKeyMode, item);
|
||||
options.IsRealAesMode(), options.AesKeyMode, item);
|
||||
archive.WriteLocalHeader_And_SeekToNextFile(item);
|
||||
}
|
||||
else
|
||||
@@ -1173,7 +1171,7 @@ HRESULT Update(
|
||||
CObjectVector<CUpdateItem> &updateItems,
|
||||
ISequentialOutStream *seqOutStream,
|
||||
CInArchive *inArchive, bool removeSfx,
|
||||
CCompressionMethodMode *compressionMethodMode,
|
||||
const CCompressionMethodMode &compressionMethodMode,
|
||||
IArchiveUpdateCallback *updateCallback)
|
||||
{
|
||||
if (inArchive)
|
||||
|
||||
@@ -51,7 +51,7 @@ HRESULT Update(
|
||||
CObjectVector<CUpdateItem> &updateItems,
|
||||
ISequentialOutStream *seqOutStream,
|
||||
CInArchive *inArchive, bool removeSfx,
|
||||
CCompressionMethodMode *compressionMethodMode,
|
||||
const CCompressionMethodMode &compressionMethodMode,
|
||||
IArchiveUpdateCallback *updateCallback);
|
||||
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user