Bug 1051685: increase SCTP window size from 128K to 1M. r=lgrahl

Differential Revision: https://phabricator.services.mozilla.com/D8906

--HG--
rename : dom/media/tests/mochitest/test_dataChannel_basicDataOnly.html => dom/media/tests/mochitest/test_dataChannel_dataOnlyBufferedAmountLow.html
extra : moz-landing-system : lando
This commit is contained in:
Nils Ohlmeier [:drno] 2018-10-16 21:12:34 +00:00
parent 3ebda39fd0
commit 0576d8d43c
4 changed files with 41 additions and 2 deletions

View File

@ -190,7 +190,7 @@ var commandsCheckDataChannel = [
var commandsCheckLargeXfer = [
function SEND_BIG_BUFFER(test) {
var size = 512*1024; // SCTP internal buffer is 256K, so we'll have ~256K queued
var size = 2*1024*1024; // SCTP internal buffer is now 1MB, so use 2MB to ensure the buffer gets full
var buffer = new ArrayBuffer(size);
// note: type received is always blob for binary data
var options = {};
@ -207,6 +207,5 @@ function addInitialDataChannel(chain) {
chain.insertBefore('PC_LOCAL_CREATE_OFFER', commandsCreateDataChannel);
chain.insertBefore('PC_LOCAL_WAIT_FOR_MEDIA_FLOW', commandsWaitForDataChannel);
chain.removeAfter('PC_REMOTE_CHECK_ICE_CONNECTIONS');
chain.append(commandsCheckLargeXfer);
chain.append(commandsCheckDataChannel);
}

View File

@ -40,6 +40,8 @@ skip-if = toolkit == 'android' # Bug 1189784
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_dataChannel_bug1013809.html]
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_dataChannel_dataOnlyBufferedAmountLow.html]
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_dataChannel_noOffer.html]
[test_enumerateDevices.html]
[test_enumerateDevices_iframe.html]

View File

@ -0,0 +1,25 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({
bug: "1051685",
title: "Verify bufferedAmountLowThreshold works"
});
var test;
runNetworkTest(function (options) {
test = new PeerConnectionTest(options);
addInitialDataChannel(test.chain);
test.chain.insertAfter('PC_REMOTE_CHECK_ICE_CONNECTIONS', commandsCheckLargeXfer);
test.run();
});
</script>
</pre>
</body>
</html>

View File

@ -501,6 +501,19 @@ DataChannelConnection::Init(unsigned short aPort, uint16_t aNumStreams, bool aMa
return false;
}
int buf_size = 1024 * 1024;
if (usrsctp_setsockopt(mMasterSocket, SOL_SOCKET, SO_RCVBUF,
(const void *)&buf_size, sizeof(buf_size)) < 0) {
LOG(("Couldn't change receive buffer size on SCTP socket"));
goto error_cleanup;
}
if (usrsctp_setsockopt(mMasterSocket, SOL_SOCKET, SO_SNDBUF,
(const void *)&buf_size, sizeof(buf_size)) < 0) {
LOG(("Couldn't change send buffer size on SCTP socket"));
goto error_cleanup;
}
// Make non-blocking for bind/connect. SCTP over UDP defaults to non-blocking
// in associations for normal IO
if (usrsctp_set_non_blocking(mMasterSocket, 1) < 0) {