🚑 Wait for local file header reading to be complete

This commit is contained in:
C-3PO 2018-07-05 23:00:10 +02:00
parent 07de050588
commit 0c8bc4d732
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 2 additions and 2 deletions

View file

@ -36,7 +36,7 @@ export default async function getManifest(product: Product): Promise<IManifest>
const stream = arrayBufferToStream(ssnFile, firstFile.offset); const stream = arrayBufferToStream(ssnFile, firstFile.offset);
//Extract manifest.xml file //Extract manifest.xml file
readLocalFileHeader(stream); await readLocalFileHeader(stream);
const patchmanifestStream = extractFileStream(firstFile, stream); const patchmanifestStream = extractFileStream(firstFile, stream);
//Convert ArrayBuffer to string //Convert ArrayBuffer to string

View file

@ -41,7 +41,7 @@ export default async function getSolidpkg(product: Product, from: number, to: nu
const stream = arrayBufferToStream(ssnFile, firstFile.offset); const stream = arrayBufferToStream(ssnFile, firstFile.offset);
//Extract metafile.solid file //Extract metafile.solid file
readLocalFileHeader(stream); await readLocalFileHeader(stream);
const solidFileStream = extractFileStream(firstFile, stream); const solidFileStream = extractFileStream(firstFile, stream);
const solidFileArrayBuffer = await streamToArrayBuffer(solidFileStream); const solidFileArrayBuffer = await streamToArrayBuffer(solidFileStream);
const solidContents = parseBencode(new DataView(solidFileArrayBuffer)) as ISolid; const solidContents = parseBencode(new DataView(solidFileArrayBuffer)) as ISolid;