Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: talk/app/webrtc/sctputils.cc

Issue 1393563002: Moving MediaStreamSignaling logic into PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Cleaning up comments, fixing naming, etc. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698