git-svn-id: svn://db.shs.com.ru/pip@471 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-04-26 13:55:05 +00:00
parent ed059005f9
commit 9c3a2cf8ca
15 changed files with 373 additions and 202 deletions

View File

@@ -448,11 +448,12 @@ bool PIPeer::sendInternal(const PIString & to, const PIByteArray & data) {
void PIPeer::dtReceived(const PIString & from, const PIByteArray & data) {
PIByteArray ba = data;
dataReceived(from, data);
dataReceivedEvent(from, data);
if (trust_peer.isEmpty() || trust_peer == from) {
read_buffer_mutex.lock();
if (read_buffer.size_s() < read_buffer_size) read_buffer.enqueue(data);
if (read_buffer.size_s() < read_buffer_size) read_buffer.enqueue(ba);
read_buffer_mutex.unlock();
}
}
@@ -860,10 +861,11 @@ bool PIPeer::openDevice() {
diag_d.reset();
diag_s.reset();
//piCoutObj << "open...";
PIMutexLocker ml(peers_mutex);
if (trust_peer.isEmpty())
return !peers.isEmpty();
return hasPeer(trust_peer);
return true;
// PIMutexLocker ml(peers_mutex);
// if (trust_peer.isEmpty())
// return !peers.isEmpty();
// return hasPeer(trust_peer);
}