Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocket: don't clone buffer #3240

Merged
merged 4 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/web/websocket/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class WebSocket extends EventTarget {
// not throw an exception must increase the bufferedAmount attribute
// by the length of data’s buffer in bytes.

const ab = new FastBuffer(data, data.byteOffset, data.byteLength)
const ab = new FastBuffer(data.buffer, data.byteOffset, data.byteLength)

const frame = new WebsocketFrameSend(ab)
const buffer = frame.createFrame(opcodes.BINARY)
Expand Down
36 changes: 0 additions & 36 deletions test/wpt/status/websockets.status.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,6 @@
}
}
},
"Send-binary-arraybufferview-float32.any.js": {
"note": "TODO(@KhafraDev): investigate failure",
"fail": [
"Send binary data on a WebSocket - ArrayBufferView - Float32Array - Connection should be closed"
]
},
"Send-binary-arraybufferview-float64.any.js": {
"note": "TODO(@KhafraDev): investigate failure",
"fail": [
"Send binary data on a WebSocket - ArrayBufferView - Float64Array - Connection should be closed"
]
},
"Send-binary-arraybufferview-int16-offset.any.js": {
"note": "TODO(@KhafraDev): investigate failure",
"fail": [
"Send binary data on a WebSocket - ArrayBufferView - Int16Array with offset - Connection should be closed"
]
},
"Send-binary-arraybufferview-int32.any.js": {
"note": "TODO(@KhafraDev): investigate failure",
"fail": [
"Send binary data on a WebSocket - ArrayBufferView - Int32Array - Connection should be closed"
]
},
"Send-binary-arraybufferview-uint16-offset-length.any.js": {
"note": "TODO(@KhafraDev): investigate failure",
"fail": [
"Send binary data on a WebSocket - ArrayBufferView - Uint16Array with offset and length - Connection should be closed"
]
},
"Send-binary-arraybufferview-uint32-offset.any.js": {
"note": "TODO(@KhafraDev): investigate failure",
"fail": [
"Send binary data on a WebSocket - ArrayBufferView - Uint32Array with offset - Connection should be closed"
]
},
"Create-on-worker-shutdown.any.js": {
"skip": true,
"//": "Node.js workers are different from web workers & don't work with blob: urls"
Expand Down
Loading