. fixed indents

This commit is contained in:
Ken
2014-09-12 17:26:57 +08:00
parent 2fbf81aaee
commit 7bb7ed5600
+7 -7
View File
@@ -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) {