@@ -77,12 +77,11 @@ void WebSockets::clientDisconnect(WSclient_t * client, uint16_t code, char * rea
77
77
* @param opcode WSopcode_t
78
78
* @param payload uint8_t * ptr to the payload
79
79
* @param length size_t length of the payload
80
- * @param mask bool add dummy mask to the frame (needed for web browser)
81
80
* @param fin bool can be used to send data in more then one frame (set fin on the last frame)
82
81
* @param headerToPayload bool set true if the payload has reserved 14 Byte at the beginning to dynamically add the Header (payload neet to be in RAM!)
83
82
* @return true if ok
84
83
*/
85
- bool WebSockets::sendFrame (WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t length, bool mask, bool fin, bool headerToPayload) {
84
+ bool WebSockets::sendFrame (WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t length, bool fin, bool headerToPayload) {
86
85
87
86
if (client->tcp && !client->tcp ->connected ()) {
88
87
DEBUG_WEBSOCKETS (" [WS][%d][sendFrame] not Connected!?\n " , client->num );
@@ -95,7 +94,7 @@ bool WebSockets::sendFrame(WSclient_t * client, WSopcode_t opcode, uint8_t * pay
95
94
}
96
95
97
96
DEBUG_WEBSOCKETS (" [WS][%d][sendFrame] ------- send message frame -------\n " , client->num );
98
- DEBUG_WEBSOCKETS (" [WS][%d][sendFrame] fin: %u opCode: %u mask: %u length: %u headerToPayload: %u\n " , client->num , fin, opcode, mask , length, headerToPayload);
97
+ DEBUG_WEBSOCKETS (" [WS][%d][sendFrame] fin: %u opCode: %u mask: %u length: %u headerToPayload: %u\n " , client->num , fin, opcode, client-> cIsClient , length, headerToPayload);
99
98
100
99
if (opcode == WSop_text) {
101
100
DEBUG_WEBSOCKETS (" [WS][%d][sendFrame] text: %s\n " , client->num , (payload + (headerToPayload ? 14 : 0 )));
@@ -119,7 +118,7 @@ bool WebSockets::sendFrame(WSclient_t * client, WSopcode_t opcode, uint8_t * pay
119
118
headerSize = 10 ;
120
119
}
121
120
122
- if (mask ) {
121
+ if (client-> cIsClient ) {
123
122
headerSize += 4 ;
124
123
}
125
124
@@ -158,7 +157,7 @@ bool WebSockets::sendFrame(WSclient_t * client, WSopcode_t opcode, uint8_t * pay
158
157
159
158
// byte 1
160
159
*headerPtr = 0x00 ;
161
- if (mask ) {
160
+ if (client-> cIsClient ) {
162
161
*headerPtr |= bit (7 ); // /< set mask
163
162
}
164
163
@@ -194,7 +193,7 @@ bool WebSockets::sendFrame(WSclient_t * client, WSopcode_t opcode, uint8_t * pay
194
193
headerPtr++;
195
194
}
196
195
197
- if (mask ) {
196
+ if (client-> cIsClient ) {
198
197
if (useInternBuffer) {
199
198
// if we use a Intern Buffer we can modify the data
200
199
// by this fact its possible the do the masking
@@ -434,7 +433,7 @@ void WebSockets::handleWebsocketPayloadCb(WSclient_t * client, bool ok, uint8_t
434
433
break ;
435
434
case WSop_ping:
436
435
// send pong back
437
- sendFrame (client, WSop_pong, payload, header->payloadLen , true );
436
+ sendFrame (client, WSop_pong, payload, header->payloadLen );
438
437
break ;
439
438
case WSop_pong:
440
439
DEBUG_WEBSOCKETS (" [WS][%d][handleWebsocket] get pong (%s)\n " , client->num , payload ? (const char *)payload : " " );
0 commit comments