Bug 1432934: Added sanity check for recvonly attribute. r=bwc
authorJohannes Willbold <j.willbold@mozilla.com>
Mon, 04 Jun 2018 14:07:28 -0700
changeset 421981 a3a7ac1e38f6
parent 421980 6ea838e51bf7
child 421982 2762fef0119b
push id65057
push userdrno@ohlmeier.org
push dateFri, 08 Jun 2018 18:26:48 +0000
treeherderautoland@a3a7ac1e38f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1432934
milestone62.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 1432934: Added sanity check for recvonly attribute. r=bwc Added a sanity check, that checks for recvonly and whether simulcast defines send options MozReview-Commit-ID: Hi5U9ZZVKY8
media/webrtc/signaling/gtest/sdp_unittests.cpp
media/webrtc/signaling/src/sdp/rsdparsa/src/lib.rs
--- a/media/webrtc/signaling/gtest/sdp_unittests.cpp
+++ b/media/webrtc/signaling/gtest/sdp_unittests.cpp
@@ -3799,17 +3799,16 @@ TEST_P(NewSdpTest, ParseInvalidSimulcast
            "a=rtpmap:120 VP8/90000" CRLF
            "a=sendrecv" CRLF
            "a=simulcast: send pt=9" CRLF,
            false);
   ASSERT_NE("", GetParseErrors());
 }
 
 TEST_P(NewSdpTest, ParseInvalidSimulcastNotSending) {
-  SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432934
   ParseSdp("v=0" CRLF
            "o=- 4294967296 2 IN IP4 127.0.0.1" CRLF
            "s=SIP Call" CRLF
            "c=IN IP4 198.51.100.7" CRLF
            "b=CT:5000" CRLF
            "t=0 0" CRLF
            "m=video 56436 RTP/SAVPF 120" CRLF
            "a=rtpmap:120 VP8/90000" CRLF
--- a/media/webrtc/signaling/src/sdp/rsdparsa/src/lib.rs
+++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/lib.rs
@@ -611,16 +611,26 @@ fn sanity_check_sdp_session(session: &Sd
                 if x.receive.len() > 0 {
                     return Err(SdpParserError::Sequence {
                         message: "Simulcast can't define receive parameters for sendonly".to_string(),
                         line_number: 0,
                     });
                 }
             }
         }
+        if msection.get_attribute(SdpAttributeType::Recvonly).is_some() {
+            if let Some(&SdpAttribute::Simulcast(ref x)) = msection.get_attribute(SdpAttributeType::Simulcast) {
+                if x.send.len() > 0 {
+                    return Err(SdpParserError::Sequence {
+                        message: "Simulcast can't define send parameters for recvonly".to_string(),
+                        line_number: 0,
+                    });
+                }
+            }
+        }
     }
 
     Ok(())
 }
 
 #[cfg(test)]
 fn create_dummy_sdp_session() -> SdpSession {
     let origin = parse_origin("mozilla 506705521068071134 0 IN IP4 0.0.0.0");