ESP8266MQTTClient
ESP8266MQTTClient copied to clipboard
Only read one websocket frame at a time
This PR reworks the websocket read logic to read exactly one websocket frame from the tcp buffer for each loop iteration. This is done by first peeking at the tcp buffer to read the header to read the payload size. The previous implementation just read the whole buffer, decoded the first websocket frame and discarded the remaining buffer. This leads to problems when there are multiple websocket frames already in the buffer.