🎨 Add debug output to trace zlib error
This commit is contained in:
parent
beb2d351da
commit
590dc39f84
3 changed files with 3 additions and 2 deletions
|
@ -10,7 +10,7 @@ interface ISolidFileInfo {
|
|||
files: ISolidFile[];
|
||||
/** Length of one piece in bytes, e.g. 65536 for 64 KiB, and 4194304 for 4 MiB. */
|
||||
'piece length': 65536 | 4194304;
|
||||
/** Concatenated hashes of all pieces. */
|
||||
/** Concatenated SHA1 hashes of all pieces, where each hash is 20 bytes long. */
|
||||
pieces: string;
|
||||
/** Whether the torrent is private, always 0. */
|
||||
private: 0 | 1;
|
||||
|
|
|
@ -31,6 +31,7 @@ export default async function extractFile(file: ISsnFileEntry, dvArray: DataView
|
|||
|
||||
//Uncompress file
|
||||
const uncompressedBuffer: Buffer = await new Promise((resolve, reject) => {
|
||||
console.log(new Uint8Array(dvFinal.buffer));
|
||||
zlib.inflateRaw(dvFinal, (error, result) => {
|
||||
if (error !== null) {
|
||||
return reject(error);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import ISolid from '../interfaces/ISolidFile';
|
||||
|
||||
/** Verifies metafile.solid for correctness. */
|
||||
/** Verifies metafile.solid for correctness. See specification at <http://www.bittorrent.org/beps/bep_0003.html>. */
|
||||
export default function verifySolidpkg(file: ISolid, { product, from, to }: {product: string, from: number, to: number}) {
|
||||
if (typeof file['creation date'] !== 'number') {
|
||||
throw new Error(`Expected creation date to be a number but it was "${file['creation date']}".`);
|
||||
|
|
Loading…
Reference in a new issue