id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,branch,branch_author,launchpad_bug
2197,[SIP] wrong assertion in MessagesParser.dataDone,antoine,washort,"Hi,

At the end of the method twisted.protocols.sip:MessagesParser.dataDone(), the number of currently received bytes is compared to the declared content-length. The stated aim is to distinguish ""aborted"" packets/datagrams (received bytes < content length) from internal errors.
However, the comparison in line 533 does exactly the reverse, and raises a RuntimeError when an ""aborted"" packet is received.

To fix the bug, ""{{{self.length < self.bodyReceived}}}"" in that line must be changed to ""{{{self.length > self.bodyReceived}}}"".

To test for this behaviour, add the following method to MessageParsingTestCase in test_sip.py:
{{{
    def testIncomplete(self):
        # test for ""aborted"" request (body shorter than content-length)
        l = self.l
        self.feedMessage(request4[:-1])
        self.assertEquals(len(l), 2)
}}}

",defect,new,highest,,core,,,therve exarkun awclinford@…,,,
