warmcat/libwebsockets — pull request #142 by andrew-canaday (2014-07-07 22:13:48+00:00)
Title: libwebsockets_read: update 'len' after lws_handshake_server invocation

It's possible that after lws_handshake_server returns, there actually is *no data* left to read. However, lws_handshake_server doesn't update 'len' so goto http_postbody will proceed to read further into the buffer than we should go.

This patch fixes the issue by updating 'len' in *libwebsockets_read* after the invocation of lws_handshake_server.