. fixed indents
This commit is contained in:
+7
-7
@@ -162,7 +162,7 @@ class _RealWebSocket : public easywsclient::WebSocket
|
||||
|
||||
std::vector<uint8_t> rxbuf;
|
||||
std::vector<uint8_t> txbuf;
|
||||
std::vector<uint8_t> receivedData;
|
||||
std::vector<uint8_t> receivedData;
|
||||
|
||||
socket_t sockfd;
|
||||
readyStateValues readyState;
|
||||
@@ -294,15 +294,15 @@ class _RealWebSocket : public easywsclient::WebSocket
|
||||
// We got a whole message, now do something with it:
|
||||
if (false) { }
|
||||
else if (ws.opcode == wsheader_type::TEXT_FRAME
|
||||
|| ws.opcode == wsheader_type::CONTINUATION
|
||||
|| ws.opcode == wsheader_type::CONTINUATION
|
||||
) {
|
||||
if (ws.mask) { for (size_t i = 0; i != ws.N; ++i) { rxbuf[i+ws.header_size] ^= ws.masking_key[i&0x3]; } }
|
||||
receivedData.insert(receivedData.end(), rxbuf.begin()+ws.header_size, rxbuf.begin()+ws.header_size+(size_t)ws.N);// just feed
|
||||
if (ws.fin) {
|
||||
std::string data(receivedData.begin(), receivedData.end());
|
||||
callable((const std::string) data);
|
||||
receivedData.erase(receivedData.begin(), receivedData.end());
|
||||
std::vector<uint8_t> ().swap(receivedData);// free memory
|
||||
if (ws.fin) {
|
||||
std::string data(receivedData.begin(), receivedData.end());
|
||||
callable((const std::string) data);
|
||||
receivedData.erase(receivedData.begin(), receivedData.end());
|
||||
std::vector<uint8_t> ().swap(receivedData);// free memory
|
||||
}
|
||||
}
|
||||
else if (ws.opcode == wsheader_type::PING) {
|
||||
|
||||
Reference in New Issue
Block a user