Modernize SIP string handling#1645
Conversation
98d5b86 to
4d3b642
Compare
|
This PR did introduce a few new bugs in the SIP logic. One would have broken any SIP request that used the Overall the improvements do generally modernise the code but the size of PRs like this is unmanageable. The concerns need to be done separately, i.e. if it's jsut to update string formatting that should be one PR. Any functional changes should be done in a different PR. It tkaes mroe work to review PRs of this size than it does to write them. |
Update SIP and user-agent code to use clearer interpolation, span/string helpers, and explicit string comparison semantics. Add Polyfill support required by the new string APIs and remove the duplicate KeyValuePair Deconstruct extension.
Reformat and clarify XML documentation comments for readability. Refactor SIPExtensionHeaders.ParseSIPExtensions to use a switch statement and HashSet for improved clarity and efficiency when parsing known and unknown SIP extensions. Apply minor code style improvements throughout.
Updated three ToString() methods in SIPSorcery.SIP (SIPHeader.cs) to use the override keyword, ensuring proper method overriding and improved polymorphic behavior.
|
The issue was the I had already run into 2 of these that were covered by tests. And now I found there are other 6. Why? |
Just the way I did it at the time, it was ~20 years ago! It doesn't matter so much as to the "why" as to the fact that the current behaviour works. Adding breaking "optimisations" would be a BIG problem for library users. |
Update SIP and user-agent code to use clearer interpolation, span/string helpers, and explicit string comparison semantics. Add Polyfill support required by the new string APIs and remove the duplicate KeyValuePair Deconstruct extension.
Split of #1639