< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] websockets heap corruption


On 29/04/13 23:12, Scott Godin wrote:
It appears the corruption has to do with the tryAgain flag and things not being aligned correctly in the buffers.  I created a quick fix for this - but it seems the entire wsProcessData needs a good round of review and optimization - there seems to be a lot data copies in it - which is fine for testing but not great for large scale deployments.

With my fix I can now get a call to establish with JSSIP (tryit.jssip.net)!

I have committed this fix.


I'm sorry that you had to waste time on this (and accidentally reverting that patch), but that whole section of code is now updated, shifting the WebSocket inspection code into a separate class.  It should avoid doing any copies as long as the WebSocket client sends the whole SIP message unfragmented in a single frame.  However, it still has to scan the whole body once for unmasking, as-per the WebSocket protocol.