Opened 16 years ago
Last modified 16 years ago
#2220 defect new
[SIP] parsing bugs/limitations and patch
Reported by: | Antoine Pitrou | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | core | Keywords: | |
Cc: | Branch: | ||
Author: |
Description
This is a new ticket to solve a set of parsing-related bugs/limitations in the SIP protocol implementation.
The bugs are :
- #2194
- #2197
- #2198
- parseViaHeader() throws an exception when it encounters a parameter it doesn't know about; the proper way to handle this is to ignore unknown params rather than refusing to construct the Via object
The attached patch against the trunk fixes all 4 bugs, and it adds 4 test cases (one for each bug). The function parseViaHeader() also becomes an alias for the class method Via.fromString(), which means we can now subclass the Via class, and use the parsing method as-is (by calling MyViaSubclass.fromString()).
I first tried the approach suggested by JP, which is to backport stuff from divmod Sine, but:
- it is too uncertain and too much work (no documentation, behaviour may be slightly different)
- the aforementioned bugs, apart from multiline header parsing, do exist in the Sine implementation as well
- we don't know whether and in which direction divmod Sine will evolve anyway, so there is no clear benefit in trying to follow it
Attachments (1)
Change History (4)
Changed 16 years ago by
Attachment: | sip-fixes.diff added |
---|
comment:1 Changed 16 years ago by
Owner: | changed from Glyph to washort |
---|
The version of sip.py in Twisted is effectively just an old version backported from sine. It probably shouldn't have been included in the first place. Patches which cause it to diverge and make it harder to do the correct thing, i.e. to backport from sine once that stabilizes, are not likely to be integrated, sorry.
Reassigning to someone actually responsible for SIP in case he feels otherwise :).
comment:3 Changed 11 years ago by
Owner: | washort deleted |
---|
patch for sip parsing bugs