Bug 976115: disable Nagle algorithm for DataChannels/sctp r=tuexen a=bkerensa
authorRandell Jesup <rjesup@jesup.org>
Fri, 14 Mar 2014 05:10:11 -0400
changeset 177581 9c91a16318ce5ebb0d4b97f36cd72dc0747af6a0
parent 177580 49932ebec275bd1015dfff874a94f20a70f83408
child 177582 7356e75b4691c1969ab4633a9f6176c2895db62d
push id5421
push userrjesup@wgate.com
push dateSat, 15 Mar 2014 11:49:13 +0000
treeherdermozilla-aurora@9c91a16318ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstuexen, bkerensa
bugs976115
milestone29.0a2
Bug 976115: disable Nagle algorithm for DataChannels/sctp r=tuexen a=bkerensa
netwerk/sctp/datachannel/DataChannel.cpp
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -397,16 +397,20 @@ DataChannelConnection::Init(unsigned sho
   // We may want to leave enabled for supporting 'cloning' of SDP offers, which
   // implies re-use of the same pseudo-port number, or forcing a renegotiation.
   {
     uint32_t on = 1;
     if (usrsctp_setsockopt(mMasterSocket, IPPROTO_SCTP, SCTP_REUSE_PORT,
                            (const void *)&on, (socklen_t)sizeof(on)) < 0) {
       LOG(("Couldn't set SCTP_REUSE_PORT on SCTP socket"));
     }
+    if (usrsctp_setsockopt(mMasterSocket, IPPROTO_SCTP, SCTP_NODELAY,
+                           (const void *)&on, (socklen_t)sizeof(on)) < 0) {
+      LOG(("Couldn't set SCTP_NODELAY on SCTP socket"));
+    }
   }
 
   if (!aUsingDtls) {
     memset(&encaps, 0, sizeof(encaps));
     encaps.sue_address.ss_family = AF_INET;
     encaps.sue_port = htons(aPort);
     if (usrsctp_setsockopt(mMasterSocket, IPPROTO_SCTP, SCTP_REMOTE_UDP_ENCAPS_PORT,
                            (const void*)&encaps,