From f284119bf1f14f406e347fe5411deb45b551adea Mon Sep 17 00:00:00 2001 From: C-3PO Date: Thu, 5 Jul 2018 23:48:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Add=20some=20debugging=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/streams/readLocalFileHeader.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ssn/streams/readLocalFileHeader.ts b/src/ssn/streams/readLocalFileHeader.ts index b47530b..91c52f8 100644 --- a/src/ssn/streams/readLocalFileHeader.ts +++ b/src/ssn/streams/readLocalFileHeader.ts @@ -19,12 +19,15 @@ function waitReadableLength(inputStream: stream.Readable, minLength: number): Pr export default async function readLocalFileHeader(inputStream: stream.Readable): Promise { let localFileHeader: Buffer = inputStream.read(30); if (localFileHeader === null) { + console.log('Need to wait'); //need to wait until data is ready for reading await waitReadableLength(inputStream, 30); + console.log('Ready'); localFileHeader = inputStream.read(30); } //Local file header signature + console.log(localFileHeader); const magic = localFileHeader.readUInt32LE(0); if (magic !== 0x04034B50) { throw new Error(`Local file header had wrong magic; expected 0x04034B50 but got 0x${magic.toString(16).padStart(8, '0')}.`);