fix: patch protomux to use the buffers arraybuffer byteLength
This commit is contained in:
parent
12cb3a3b5e
commit
dcad699ae1
|
@ -1,5 +1,5 @@
|
||||||
diff --git a/node_modules/protomux/index.js b/node_modules/protomux/index.js
|
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
|
--- a/node_modules/protomux/index.js
|
||||||
+++ b/node_modules/protomux/index.js
|
+++ b/node_modules/protomux/index.js
|
||||||
@@ -195,34 +195,34 @@ class Channel {
|
@@ -195,34 +195,34 @@ class Channel {
|
||||||
|
@ -9,7 +9,7 @@ index 07bf0ad..c8db59c 100644
|
||||||
- recv (state, session) {
|
- recv (state, session) {
|
||||||
+ async recv (state, session) {
|
+ async recv (state, session) {
|
||||||
session._track(m.onmessage(encoding.decode(state), session))
|
session._track(m.onmessage(encoding.decode(state), session))
|
||||||
},
|
},
|
||||||
- send (m, session = s) {
|
- send (m, session = s) {
|
||||||
+ async send (m, session = s) {
|
+ async send (m, session = s) {
|
||||||
if (session.closed === true) return false
|
if (session.closed === true) return false
|
||||||
|
@ -43,3 +43,12 @@ index 07bf0ad..c8db59c 100644
|
||||||
|
|
||||||
mux.drained = mux.stream.write(state.buffer)
|
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)
|
||||||
|
|
Loading…
Reference in New Issue