Skip to content

Commit

Permalink
chore: fix test failures for connection-retry
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSun90 committed Oct 11, 2023
1 parent 460f1b4 commit 006116d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/token/infoerror-token-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function readToken(buf: Buffer | BufferList, offset: number, options: ParserOpti
let tokenLength;
({ offset, value: tokenLength } = readUInt16LE(buf, offset));

if (buf.length < offset + tokenLength) {
throw new NotEnoughDataError(offset + tokenLength);
if (buf.length + offset< tokenLength) {

Check failure on line 21 in src/token/infoerror-token-parser.ts

View workflow job for this annotation

GitHub Actions / Linting

Operator '<' must be spaced
throw new NotEnoughDataError(buf.length + offset);
}

let number;
Expand All @@ -33,7 +33,7 @@ function readToken(buf: Buffer | BufferList, offset: number, options: ParserOpti

let message;
({ offset, value: message } = readUsVarChar(buf, offset));

console.log(message);
let serverName;
({ offset, value: serverName } = readBVarChar(buf, offset));

Expand Down
4 changes: 2 additions & 2 deletions src/token/loginack-token-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function loginAckParser(buf: Buffer | BufferList, offset: number, _options: Pars
let tokenLength;
({ offset, value: tokenLength } = readUInt16LE(buf, offset));

if (buf.length < offset + tokenLength) {
throw new NotEnoughDataError(offset + tokenLength);
if (buf.length + offset< tokenLength) {

Check failure on line 19 in src/token/loginack-token-parser.ts

View workflow job for this annotation

GitHub Actions / Linting

Operator '<' must be spaced
throw new NotEnoughDataError(buf.length + offset);
}

let interfaceNumber;
Expand Down

0 comments on commit 006116d

Please sign in to comment.