Removed a potential double-free caused by stashing the allocated headers in 'ah', which we no longer need to do.
I need to look into the memory issues more in depth.
Reverting for now to add additional header parsing..
Added libwebsockets_get_http_method.
Finally got alternate HTTP methods working.
Set wsi->u.hdr.ah to 0 to avoid potential double-free caused by commenting this memset!
Check for wsi->u.hdr.ah before doing the method check (probably unnecessary. Something else must be freeing it somewhere).
Make sure we don't overrun the body buffer.
There's some awful muckery here trying to prevent segfaults in a desperate manner.
In the future, a proper patch has to be constructed (or the near present, if this
doesn't work).