File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,11 @@ class _RealWebSocket : public easywsclient::WebSocket
297
297
std::string data (rxbuf.begin ()+ws.header_size , rxbuf.begin ()+ws.header_size +(size_t )ws.N );
298
298
callable ((const std::string) data);
299
299
}
300
- else if (ws.opcode == wsheader_type::PING) { }
300
+ else if (ws.opcode == wsheader_type::PING) {
301
+ if (ws.mask ) { for (size_t i = 0 ; i != ws.N ; ++i) { rxbuf[i+ws.header_size ] ^= ws.masking_key [i&0x3 ]; } }
302
+ std::string data (rxbuf.begin ()+ws.header_size , rxbuf.begin ()+ws.header_size +(size_t )ws.N );
303
+ sendData (wsheader_type::PONG, data);
304
+ }
301
305
else if (ws.opcode == wsheader_type::PONG) { }
302
306
else if (ws.opcode == wsheader_type::CLOSE) { close (); }
303
307
else { fprintf (stderr, " ERROR: Got unexpected WebSocket message.\n " ); close (); }
You can’t perform that action at this time.
0 commit comments