Bugfixes part 3 #209

Open
andrey wants to merge 36 commits from bugfixes3 into master
Showing only changes of commit c3491cbf6f - Show all commits
@@ -128,12 +128,14 @@ void PISingleApplication::run() {
int st_[2] = {sacnt, sacnt};
shm->write(st_, 8);
// piCoutObj << "write" << sacnt;
int ri[3] = {0, 0, 0};
const int hdr_sz = sizeof(int) * 3;
shm->read(ri, hdr_sz);
PIByteArray all(shm->size());
shm->read(all.data(), all.size());
int ri[3] = {0, 0, 0};
memcpy(ri, all.data(), hdr_sz);
if (ri[2] != 0 && ri[0] == ri[1]) {
readed.resize(shm->size() - hdr_sz);
shm->read(readed.data(), readed.size(), hdr_sz);
readed.resize(all.size() - hdr_sz);
memcpy(readed.data(), all.data() + hdr_sz, readed.size());
PIByteArray msg;
readed >> msg;
if (msg.isNotEmpty()) {