mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-15 00:06:30 +02:00
not send data if still in HTTP header handling
This commit is contained in:
@ -63,6 +63,16 @@ void WebSockets::clientDisconnect(WSclient_t * client, uint16_t code, char * rea
|
||||
*/
|
||||
void WebSockets::sendFrame(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t length, bool mask, bool fin) {
|
||||
|
||||
if(!client->tcp.connected()) {
|
||||
DEBUG_WEBSOCKETS("[WS][%d][sendFrame] not Connected!?\n", client->num);
|
||||
return;
|
||||
}
|
||||
|
||||
if(client->status != WSC_CONNECTED) {
|
||||
DEBUG_WEBSOCKETS("[WS][%d][sendFrame] not in WSC_CONNECTED state!?\n", client->num);
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_WEBSOCKETS("[WS][%d][sendFrame] ------- send massage frame -------\n", client->num);
|
||||
DEBUG_WEBSOCKETS("[WS][%d][sendFrame] fin: %u opCode: %u mask: %u length: %u\n", client->num, fin, opcode, mask, length);
|
||||
|
||||
@ -70,11 +80,6 @@ void WebSockets::sendFrame(WSclient_t * client, WSopcode_t opcode, uint8_t * pay
|
||||
DEBUG_WEBSOCKETS("[WS][%d][sendFrame] text: %s\n", client->num, payload);
|
||||
}
|
||||
|
||||
if(!client->tcp.connected()) {
|
||||
DEBUG_WEBSOCKETS("[WS][%d][sendFrame] not Connected!?\n", client->num);
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t maskKey[4] = { 0 };
|
||||
uint8_t buffer[16] = { 0 };
|
||||
uint8_t i = 0;
|
||||
|
Reference in New Issue
Block a user