Can't send 0-length arrays over RTCDataChannel
Categories
(Core :: WebRTC: Networking, defect, P2)
Tracking
()
People
(Reporter: jesup, Unassigned)
References
()
Details
We can't send 0-length arrays/strings over DataChannels, and this is a known-fail for the WPT tests:
RTCDataChannel-send: "should be able to send an empty string and receive an empty string"
We fail in netwerk/sctp/src/netinet/sctp_output.c:13905 where it returns EINVAL if we pass a 0-length buffer to usrsctp_sendv().
Comment 1•2 years ago
•
|
||
Using https://jsfiddle.net/jib1/fsba41mn/48/show in Chrome and MOZ_LOG_FILE=/c/tmp/jib.log MOZ_LOG=DataChannel:5 mach run
, I established a connection and first sent "HelloWorld"
from Chrome to Firefox:
[Child 31152: Socket Thread]: D/DataChannel In receive_cb, ulp_info=1
[Child 31152: Socket Thread]: D/DataChannel In ReceiveCallback
[Child 31152: Socket Thread]: D/DataChannel DataChannel: Received string message of length 10 on channel 0
[Child 31152: Socket Thread]: D/DataChannel HandleDataMessage: sending ON_DATA_STRING for 1126f12e0
[Child 31152: Main Thread]: V/DataChannel DoOnMessageAvailable
[Child 31152: Main Thread]: D/DataChannel 1126cc340(1126f12e0): DoOnMessageAvailable - Dispatching
...followed by ""
:
[Child 31152: Socket Thread]: D/DataChannel In receive_cb, ulp_info=1
[Child 31152: Socket Thread]: D/DataChannel In ReceiveCallback
[Child 31152: Socket Thread]: E/DataChannel Unhandled message of length 1 PPID 56 on stream 0 received (complete).
In the latter case, no onmessage
is fired on JS in Firefox, while in Chrome<->Chrome it is.
Comment 2•2 years ago
|
||
So Chrome is using a PPID of 56 instead of 51 to send empty string. Safari does the same.
Updated•2 years ago
|
Description
•