sdp: temporarily raise mid limit to 32
to avoid breaking existing deployments. Also measure usage. BUG=webrtc:12517 Change-Id: Ic38f1b45e79e46da9ff6fe927b0c5351443ccd96 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239188 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com> Cr-Commit-Position: refs/heads/main@{#35445}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
0ce7f165fd
commit
063bb384f8
@ -1051,7 +1051,7 @@ TEST_P(PeerConnectionSignalingTest, MidAttributeMaxLength) {
|
||||
"1C:2C:74:01:8D:50:67:23\r\n"
|
||||
"a=setup:actpass\r\n"
|
||||
// Too long mid attribute.
|
||||
"a=mid:01234567890123456\r\n"
|
||||
"a=mid:0123456789012345678901234567890123\r\n"
|
||||
"a=sendrecv\r\n"
|
||||
"a=msid:stream track\r\n"
|
||||
"a=rtcp-mux\r\n"
|
||||
|
@ -124,7 +124,8 @@ const char kSimulcastDisabled[] = "WebRTC.PeerConnection.Simulcast.Disabled";
|
||||
static const int kRtcpCnameLength = 16;
|
||||
|
||||
// The maximum length of the MID attribute.
|
||||
static constexpr size_t kMidMaxSize = 16;
|
||||
// TODO(bugs.webrtc.org/12517) - reduce to 16 again.
|
||||
static constexpr size_t kMidMaxSize = 32;
|
||||
|
||||
const char kDefaultStreamId[] = "default";
|
||||
// NOTE: Duplicated in peer_connection.cc:
|
||||
@ -446,21 +447,25 @@ bool VerifyIceUfragPwdPresent(
|
||||
|
||||
RTCError ValidateMids(const cricket::SessionDescription& description) {
|
||||
std::set<std::string> mids;
|
||||
size_t max_length = 0;
|
||||
for (const cricket::ContentInfo& content : description.contents()) {
|
||||
if (content.name.empty()) {
|
||||
LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER,
|
||||
"A media section is missing a MID attribute.");
|
||||
}
|
||||
max_length = std::max(max_length, content.name.size());
|
||||
if (content.name.size() > kMidMaxSize) {
|
||||
LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER,
|
||||
"The MID attribute exceeds the maximum supported "
|
||||
"length of 16 characters.");
|
||||
"length of 32 characters.");
|
||||
}
|
||||
if (!mids.insert(content.name).second) {
|
||||
LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER,
|
||||
"Duplicate a=mid value '" + content.name + "'.");
|
||||
}
|
||||
}
|
||||
RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.PeerConnection.Mid.Size", max_length, 0,
|
||||
31, 32);
|
||||
return RTCError::OK();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user