Opened 8 years ago

Last modified 8 years ago

#2220 defect new

[SIP] parsing bugs/limitations and patch

Reported by: antoine Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author: Launchpad Bug:

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)

sip-fixes.diff (26.4 KB) - added by antoine 8 years ago.
patch for sip parsing bugs

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by antoine

patch for sip parsing bugs

comment:1 Changed 8 years ago by glyph

  • 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:2 Changed 8 years ago by antoine

Ok, so I'll have to maintain a forked version in the meantime.

comment:3 Changed 4 years ago by <automation>

  • Owner washort deleted
Note: See TracTickets for help on using tickets.