chmorgan / libesphttpd

Libesphttpd - web server for ESP8266 / ESP32
Mozilla Public License 2.0
128 stars 45 forks source link

Fix occasionally corrupted frameheader #94

Closed NikLeberg closed 3 years ago

NikLeberg commented 4 years ago

Lock sendBuff whenever the server sends something to the client so frames don't get written to the wrong position in the buffer. Caution: Functions cgiWebsocketSend() & cgiWebsocketClose() now possibly block. Fixes issue #84

phatpaul commented 4 years ago

It looks OK. I will get around to testing it some and merge it. Thanks!

jkent commented 3 years ago

For esp32 this should be fine. Mutexes are recursive. The posix implementation doesn't use recursive mutexes, however.