From 702dcb6bc38cf5c61cf286a16f875e87a329bf3d Mon Sep 17 00:00:00 2001 From: Taylor Brandstetter Date: Mon, 3 Aug 2020 16:05:12 -0700 Subject: [PATCH] Reducing threshold for usrsctp "buffer low" callback. A usrsctp regression is causing this callback to not be invoked, but reducing the threshold (from 128KB to 64KB) seems to mitigate the issue. Can set it back once the root cause is fixed, though this isn't expected to have any performance implications. Bug: webrtc:11824 Change-Id: I2f6a3183d298abf4d1ad3bbd3697b1879eb4d696 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180841 Reviewed-by: Harald Alvestrand Commit-Queue: Taylor Cr-Commit-Position: refs/heads/master@{#31851} --- media/sctp/sctp_transport.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/sctp/sctp_transport.cc b/media/sctp/sctp_transport.cc index 8996288b83..9fe8717875 100644 --- a/media/sctp/sctp_transport.cc +++ b/media/sctp/sctp_transport.cc @@ -781,7 +781,10 @@ bool SctpTransport::OpenSctpSocket() { // If kSctpSendBufferSize isn't reflective of reality, we log an error, but we // still have to do something reasonable here. Look up what the buffer's real // size is and set our threshold to something reasonable. - static const int kSendThreshold = usrsctp_sysctl_get_sctp_sendspace() / 2; + // TODO(bugs.webrtc.org/11824): That was previously set to 50%, not 25%, but + // it was reduced to a recent usrsctp regression. Can return to 50% when the + // root cause is fixed. + static const int kSendThreshold = usrsctp_sysctl_get_sctp_sendspace() / 4; sock_ = usrsctp_socket( AF_CONN, SOCK_STREAM, IPPROTO_SCTP, &UsrSctpWrapper::OnSctpInboundPacket,