Bug 976115: disable Nagle algorithm for DataChannels/sctp r=tuexen
authorRandell Jesup <rjesup@jesup.org>
Fri, 14 Mar 2014 05:10:11 -0400
changeset 190844 8eb7a2a65dfe4bd958279faa7d377726308b8ec9
parent 190843 aa60e2265dde77daea91c5a592d0c3926b372261
child 190845 0a5e13d2c0039ab24b9573e24816ddeed1927f4e
push idunknown
push userunknown
push dateunknown
reviewerstuexen
bugs976115
milestone30.0a1
Bug 976115: disable Nagle algorithm for DataChannels/sctp r=tuexen
netwerk/sctp/datachannel/DataChannel.cpp
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -388,16 +388,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,