From b223edc357b939193c3df5fb433e7db0cde2ae12 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 13 Jan 2022 11:15:11 +0800 Subject: [PATCH] fix crash --- queue.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/queue.js b/queue.js index 66e38eb..8591c9f 100644 --- a/queue.js +++ b/queue.js @@ -74,7 +74,7 @@ class Binary extends Response { if (!line) { return; } this._lines.push(line); - if (line.startsWith("ACK")) { // no art! + if (line.startsWith("ACK") || line.startsWith("OK")) { // no art! this._done(this._lines); return; } @@ -84,7 +84,11 @@ class Binary extends Response { } if (!this._binary) { - let line = this._getLine(); + let line = ""; + while (1) { + line = this._getLine(); + if (line.startsWith("binary")) { break; } + } if (!line) { return; } this._lines.push(line); this._binary = Number(line.split(": ").pop());