Spritetm / libesphttpd

NOTE: THIS CODE IS UNMAINTAINED. Please take a look at https://github.com/chmorgan/libesphttpd instead.
125 stars 109 forks source link

Multi-part Websockets broken - here's a fix #36

Open MightyPork opened 7 years ago

MightyPork commented 7 years ago

It sends OpCode other than 0 ("CONT") in the continuation frames, which does not work (browser throws an error). This happens if you use WEBSOCK_FLAG_CONT to send multiple chained messages.

I fixed this in my fork by adding WEBSOCK_FLAG_MORE

Now: WEBSOCK_FLAG_MORE = no FIN, WEBSOCK_FLAG_CONT = opcode 0. Works perfectly!

https://github.com/MightyPork/libesphttpd/commit/1a699948bb07d789f827d831f3994fc1b2d962de

Not sure if you want a PR or not, I already have a bunch of other improvements there. But this is the first bug I found.