| Index: talk/app/webrtc/sctputils.cc
|
| diff --git a/talk/app/webrtc/sctputils.cc b/talk/app/webrtc/sctputils.cc
|
| index 21174c3e482581e422b72a0d2c54f73e2c7833c1..a28d8f034815c6bcd598623670066328659988d7 100644
|
| --- a/talk/app/webrtc/sctputils.cc
|
| +++ b/talk/app/webrtc/sctputils.cc
|
| @@ -48,6 +48,19 @@ enum DataChannelOpenMessageChannelType {
|
| DCOMCT_UNORDERED_PARTIAL_TIME = 0x82,
|
| };
|
|
|
| +bool IsOpenMessage(const rtc::Buffer& payload) {
|
| + // Format defined at
|
| + // http://tools.ietf.org/html/draft-jesup-rtcweb-data-protocol-04
|
| +
|
| + rtc::ByteBuffer buffer(payload);
|
| + uint8 message_type;
|
| + if (!buffer.ReadUInt8(&message_type)) {
|
| + LOG(LS_WARNING) << "Could not read OPEN message type.";
|
| + return false;
|
| + }
|
| + return message_type == DATA_CHANNEL_OPEN_MESSAGE_TYPE;
|
| +}
|
| +
|
| bool ParseDataChannelOpenMessage(const rtc::Buffer& payload,
|
| std::string* label,
|
| DataChannelInit* config) {
|
|
|