fix ios ci test callsdpnormalization
This commit is contained in:
1 parent
85c06165e8
commit
10e18eecb6
2 files changed
+52
-38
No files matched your search
@@ -1631,18 +1631,19 @@ enum CallSDPOrdering {
|
||||
}
|
||||
|
||||
enum CallSDPNormalization {
|
||||
/// Martin 3.2.4 expects CRLF between lines and unconditionally drops the
|
||||
/// final two characters of its input. Give it one, and only one, trailing
|
||||
/// CRLF so the last character of an SSRC/MSID value is never discarded.
|
||||
static func martinParseInput(_ webRTCSDP: String) -> String {
|
||||
var normalized =
|
||||
let lfNormalized =
|
||||
webRTCSDP
|
||||
.replacingOccurrences(of: "\r\n", with: "\n")
|
||||
.replacingOccurrences(of: "\r", with: "\n")
|
||||
while normalized.hasSuffix("\n") {
|
||||
normalized.removeLast()
|
||||
|
||||
var lines = lfNormalized.components(separatedBy: "\n")
|
||||
|
||||
while lines.last?.isEmpty == true {
|
||||
lines.removeLast()
|
||||
}
|
||||
return normalized.replacingOccurrences(of: "\n", with: "\r\n") + "\r\n"
|
||||
|
||||
return lines.joined(separator: "\r\n") + "\r\n"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user