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

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

Issue 1395523002: Added parsing of either space or colon for sctp-port. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added requested TODO. 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
« no previous file with comments | « no previous file | talk/app/webrtc/webrtcsdp_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/webrtcsdp.cc
diff --git a/talk/app/webrtc/webrtcsdp.cc b/talk/app/webrtc/webrtcsdp.cc
index 28d4e9e8b156dcf9b71f935df7a0ae2952a9db2d..99f8a79ac9016d949c3dd732ebaef4ef4520b679 100644
--- a/talk/app/webrtc/webrtcsdp.cc
+++ b/talk/app/webrtc/webrtcsdp.cc
@@ -1125,16 +1125,17 @@ bool ParseSctpPort(const std::string& line,
// draft-ietf-mmusic-sctp-sdp-07
// a=sctp-port
std::vector<std::string> fields;
- rtc::split(line.substr(kLinePrefixLength),
- kSdpDelimiterSpace, &fields);
const size_t expected_min_fields = 2;
+ rtc::split(line.substr(kLinePrefixLength), kSdpDelimiterColon, &fields);
+ if (fields.size() < expected_min_fields) {
+ fields.resize(0);
+ rtc::split(line.substr(kLinePrefixLength), kSdpDelimiterSpace, &fields);
+ }
if (fields.size() < expected_min_fields) {
return ParseFailedExpectMinFieldNum(line, expected_min_fields, error);
}
if (!rtc::FromString(fields[1], sctp_port)) {
- return ParseFailed(line,
- "Invalid sctp port value.",
- error);
+ return ParseFailed(line, "Invalid sctp port value.", error);
}
return true;
}
@@ -1348,6 +1349,8 @@ void BuildMediaDescription(const ContentInfo* content_info,
void BuildSctpContentAttributes(std::string* message, int sctp_port) {
// draft-ietf-mmusic-sctp-sdp-04
// a=sctpmap:sctpmap-number protocol [streams]
+ // TODO(lally): switch this over to mmusic-sctp-sdp-12 (or later), with
+ // 'a=sctp-port:'
std::ostringstream os;
InitAttrLine(kAttributeSctpmap, &os);
os << kSdpDelimiterColon << sctp_port << kSdpDelimiterSpace
« no previous file with comments | « no previous file | talk/app/webrtc/webrtcsdp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698