picloud fix segfault on close

This commit is contained in:
2021-04-07 15:52:53 +03:00
parent 1fd9851068
commit fd2e0b2eed
6 changed files with 36 additions and 20 deletions

View File

@@ -71,13 +71,14 @@ void PICloud::TCP::sendDisconnected(uint client_id) {
}
void PICloud::TCP::sendData(const PIByteArray & data) {
int PICloud::TCP::sendData(const PIByteArray & data) {
header.type = PICloud::TCP::Data;
PIByteArray ba;
ba << header;
ba.append(data);
// piCout << "sendData" << ba.toHex();
streampacker->send(ba);
return data.size_s();
}