mirror of
https://github.com/QuasarApp/Heart.git
synced 2025-04-26 17:54:38 +00:00
fix tests
This commit is contained in:
parent
54ea89d6a6
commit
0d17b56a7c
3
.gitignore
vendored
3
.gitignore
vendored
@ -60,3 +60,6 @@ HeartTests/cmake_install.cmake
|
||||
cmake_install.cmake
|
||||
docs/
|
||||
Heart/heart_global.h
|
||||
|
||||
# git
|
||||
*.orig
|
||||
|
@ -502,7 +502,7 @@ bool AbstractNode::registerSocket(QAbstractSocket *socket, const HostAddress* cl
|
||||
_connectionsMutex.unlock();
|
||||
|
||||
connect(info, &AbstractNodeInfo::sigReadyRead,
|
||||
this, &AbstractNode::avelableBytes);
|
||||
this, &AbstractNode::avelableBytes, Qt::DirectConnection);
|
||||
|
||||
// using direct connection because socket clear all data of ip and port after disconnected.
|
||||
connect(info, &AbstractNodeInfo::statusChaned,
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
}
|
||||
|
||||
const BigPackage* getData() const {
|
||||
QMutexLocker locker(&_mData);
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -66,12 +67,15 @@ protected:
|
||||
|
||||
if (pkg->cmd() == BigPackage::command()) {
|
||||
|
||||
_mData.lock();
|
||||
data->copy<BigPackage>(*pkg);
|
||||
_mData.unlock();
|
||||
sendData(data, sender);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
mutable QMutex _mData;
|
||||
BigPackage *data = nullptr;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user