From dcad699ae1f5f14e3ffe3844607028a6cd53130e Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 24 Jul 2023 13:30:55 -0400 Subject: [PATCH] fix: patch protomux to use the buffers arraybuffer byteLength --- patches/protomux+3.5.0.patch | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/patches/protomux+3.5.0.patch b/patches/protomux+3.5.0.patch index 683b668..a42ad66 100644 --- a/patches/protomux+3.5.0.patch +++ b/patches/protomux+3.5.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/protomux/index.js b/node_modules/protomux/index.js -index 07bf0ad..c8db59c 100644 +index 07bf0ad..ef91c72 100644 --- a/node_modules/protomux/index.js +++ b/node_modules/protomux/index.js @@ -195,34 +195,34 @@ class Channel { @@ -9,7 +9,7 @@ index 07bf0ad..c8db59c 100644 - recv (state, session) { + async recv (state, session) { session._track(m.onmessage(encoding.decode(state), session)) - }, + }, - send (m, session = s) { + async send (m, session = s) { if (session.closed === true) return false @@ -43,3 +43,12 @@ index 07bf0ad..c8db59c 100644 mux.drained = mux.stream.write(state.buffer) +@@ -417,7 +417,7 @@ module.exports = class Protomux { + + _ondata (buffer) { + try { +- const state = { buffer, start: 0, end: buffer.byteLength } ++ const state = { buffer, start: 0, end: buffer.buffer.byteLength } + this._decode(c.uint.decode(state), state) + } catch (err) { + this._safeDestroy(err)