[Reviewer Andy] Two size messages

Andy

Can you review my PJSIP changes for supporting maximal sized SIP messages without blowing our occupancy out of the water.  Basically it works by having two message sizes - a normal size and a maximum size, and it tries to do most things efficiently with the normal message size, and drops back to less efficient operation for larger messages.

The clunkiest bit of the equation is rendering messages for transmission, where I ended up going for a simple approach - try rendering to a small buffer and if that fails allocate a large buffer and try again.  I added one optimisation to this - if the body is larger than the small buffer size then we jump straight to the large buffer.

I've tested live with an updated script sending large MESSAGE bodies.  I've also got our sprout UTs running with the change (and with our fake transport components simulating the behaviour).

Mike
pj_pool_reset does almost nothing if the pool is already empty (maybe 5 lines of code in total).  It would be possible to surround the call with an "if (rdata->pkt_info.packet != tcp->rx_buf)" test, but it feels more watertight this way.