ipkn / crow

Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)
BSD 3-Clause "New" or "Revised" License
7.48k stars 891 forks source link

Fix ws read failure when using 16bit payload #273

Closed roxma closed 6 years ago

roxma commented 6 years ago

The callback of boost::asio::async_read is scheduled outside of do_read(). Using local variable as buffer has undefined behavior.

This PR is possiblly related to issue #266 // cc @marekfoltyn

// Also should use ntohs instead of htons when reading from socket.

ipkn commented 6 years ago

Thank you for the PR. I will do some test for the large payload.