From 8c2b1df7f7b51b4742eb31f8ed008a446e0fa060 Mon Sep 17 00:00:00 2001 From: Link Mauve Date: Mon, 8 Sep 2025 10:50:40 +0200 Subject: [PATCH] xmpp-parsers: Fix the type of jingle_rtp/ssrc to u32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit XEP-0167 has been updated to version 1.2.3, to change the type of the 'ssrc' attribute to u32 (from String). This is in accordance with RFC 3550 (RTP), which defines it as a randomly-chosen 32-bit unsigned integer. Additionally, the docstring was completely wrong. --- parsers/ChangeLog | 7 +++++++ parsers/doap.xml | 2 +- parsers/src/jingle.rs | 4 ++-- parsers/src/jingle_rtp.rs | 13 ++++++------- parsers/src/json_containers.rs | 2 +- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/parsers/ChangeLog b/parsers/ChangeLog index 08c45b6c..de15715f 100644 --- a/parsers/ChangeLog +++ b/parsers/ChangeLog @@ -1,3 +1,10 @@ +Version NEXT: +XXXX-YY-ZZ RELEASER + * Breaking + - The type of jingle_rtp::Description::ssrc has been changed from + Option to Option, in accordance with XEP-0167 version + 1.2.3 and RFC 3550. (!602) + Version 0.22.0: 2025-10-28 pep * Breaking diff --git a/parsers/doap.xml b/parsers/doap.xml index 1e140553..03f927c3 100644 --- a/parsers/doap.xml +++ b/parsers/doap.xml @@ -267,7 +267,7 @@ complete - 1.2.0 + 1.2.3 0.13.0 diff --git a/parsers/src/jingle.rs b/parsers/src/jingle.rs index 5256a51f..6f2dfce1 100644 --- a/parsers/src/jingle.rs +++ b/parsers/src/jingle.rs @@ -594,7 +594,7 @@ mod tests { assert_size!(Senders, 1); assert_size!(Disposition, 1); assert_size!(ContentId, 12); - assert_size!(Content, 156); + assert_size!(Content, 152); assert_size!(Reason, 12); assert_size!(ReasonElement, 24); assert_size!(SessionId, 12); @@ -609,7 +609,7 @@ mod tests { assert_size!(Senders, 1); assert_size!(Disposition, 1); assert_size!(ContentId, 24); - assert_size!(Content, 312); + assert_size!(Content, 296); assert_size!(Reason, 24); assert_size!(ReasonElement, 48); assert_size!(SessionId, 24); diff --git a/parsers/src/jingle_rtp.rs b/parsers/src/jingle_rtp.rs index 2a657044..d655f079 100644 --- a/parsers/src/jingle_rtp.rs +++ b/parsers/src/jingle_rtp.rs @@ -21,15 +21,14 @@ pub struct RtcpMux; #[derive(FromXml, AsXml, PartialEq, Debug, Clone)] #[xml(namespace = ns::JINGLE_RTP, name = "description")] pub struct Description { - /// Namespace of the encryption scheme used. + /// Specifies the media type, such as "audio" or "video", where the media type SHOULD be as + /// registered at IANA MIME Media Types Registry. #[xml(attribute)] pub media: String, - /// User-friendly name for the encryption scheme, should be `None` for OTR, - /// legacy OpenPGP and OX. - // XXX: is this a String or an u32?! Refer to RFC 3550. + /// 32-bit synchronization source for this media stream, as defined in RFC 3550. #[xml(attribute(default))] - pub ssrc: Option, + pub ssrc: Option, /// List of encodings that can be used for this RTP stream. #[xml(child(n = ..))] @@ -169,7 +168,7 @@ mod tests { #[cfg(target_pointer_width = "32")] #[test] fn test_size() { - assert_size!(Description, 76); + assert_size!(Description, 72); assert_size!(Channels, 1); assert_size!(PayloadType, 64); assert_size!(Parameter, 24); @@ -178,7 +177,7 @@ mod tests { #[cfg(target_pointer_width = "64")] #[test] fn test_size() { - assert_size!(Description, 152); + assert_size!(Description, 136); assert_size!(Channels, 1); assert_size!(PayloadType, 104); assert_size!(Parameter, 48); diff --git a/parsers/src/json_containers.rs b/parsers/src/json_containers.rs index 42803379..665e9d28 100644 --- a/parsers/src/json_containers.rs +++ b/parsers/src/json_containers.rs @@ -24,7 +24,7 @@ mod tests { #[cfg(target_pointer_width = "32")] #[test] fn test_size() { - assert_size!(JsonContainer, 16); + assert_size!(JsonContainer, 24); } #[cfg(target_pointer_width = "64")]