Bug 858691: Cleanup of DataChannel OpenRequest Message r=jesup
authorMichael Tüxen <tuexen@fh-muenster.de>
Tue, 09 Apr 2013 00:55:16 -0400
changeset 128112 3f85757613d2bb1f72907ec7cef39aef084d1a1b
parent 128111 7f28e9df56c90e991e0cf46b5f235a88bbca698e
child 128113 230b1e362be456c7c164c77105f7fb9ab9b1740e
push id24520
push useremorley@mozilla.com
push dateTue, 09 Apr 2013 09:06:14 +0000
treeherdermozilla-central@d09a5a5666ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs858691
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 858691: Cleanup of DataChannel OpenRequest Message r=jesup
netwerk/sctp/datachannel/DataChannel.cpp
netwerk/sctp/datachannel/DataChannelProtocol.h
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -927,17 +927,17 @@ DataChannelConnection::SendOpenRequestMe
     moz_free(req);
     return (0);
   }
   if (unordered) {
     // Per the current types, all differ by 0x80 between ordered and unordered
     req->channel_type |= 0x80; // NOTE: be careful if new types are added in the future
   }
 
-  req->reliability_params = htons((uint16_t)prValue); /* XXX Why 16-bit */
+  req->reliability_param = htonl(prValue);
   req->priority = htons(0); /* XXX: add support */
   req->label_length = htons(label_len);
   req->protocol_length = htons(proto_len);
   memcpy(&req->label[0], PromiseFlatCString(label).get(), label_len);
   memcpy(&req->label[label_len], PromiseFlatCString(protocol).get(), proto_len);
 
   // sizeof(*req) already includes +1 byte for label, need nul for both strings
   int32_t result = SendControlMessage(req, (sizeof(*req)-1) + label_len + proto_len, stream);
@@ -1087,17 +1087,17 @@ DataChannelConnection::HandleOpenRequest
     case DATA_CHANNEL_PARTIAL_RELIABLE_TIMED:
     case DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED:
       prPolicy = SCTP_PR_SCTP_TTL;
       break;
     default:
       /* XXX error handling */
       return;
   }
-  prValue = ntohs(req->reliability_params);
+  prValue = ntohl(req->reliability_param);
   flags = (req->channel_type & 0x80) ? DATA_CHANNEL_FLAGS_OUT_OF_ORDER_ALLOWED : 0;
 
   if ((channel = FindChannelByStream(stream))) {
     if (!(channel->mFlags & DATA_CHANNEL_FLAGS_EXTERNAL_NEGOTIATED)) {
       LOG(("ERROR: HandleOpenRequestMessage: channel for stream %u is in state %d instead of CLOSED.",
            stream, channel->mState));
      /* XXX: some error handling */
     } else {
--- a/netwerk/sctp/datachannel/DataChannelProtocol.h
+++ b/netwerk/sctp/datachannel/DataChannelProtocol.h
@@ -37,18 +37,18 @@
 
 #define INVALID_STREAM (0xFFFF)
 // max is 0xFFFF: Streams 0 to 0xFFFE = 0xFFFF streams
 #define MAX_NUM_STREAMS (2048)
 
 struct rtcweb_datachannel_open_request {
   uint8_t  msg_type; // DATA_CHANNEL_OPEN
   uint8_t  channel_type;  
-  uint16_t reliability_params;
   int16_t  priority;
+  uint32_t reliability_param;
   uint16_t label_length;
   uint16_t protocol_length;
   char     label[1]; // (and protocol) keep VC++ happy...
 } SCTP_PACKED;
 
 /* msg_type values: */
 /* 0-2 were used in an early version of the protocol with 3-way handshakes */
 #define DATA_CHANNEL_OPEN_REQUEST             3