From 60ebe217a43c79be10312baf72513b2460841489 Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Sun, 16 Jun 2019 12:58:55 +0300 Subject: [PATCH] Works except blocking calls will not work --- components/net/cpp/src/peer.cpp | 6 +++--- components/rgbd-sources/src/streamer.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/net/cpp/src/peer.cpp b/components/net/cpp/src/peer.cpp index f3f875ae8..aa5d6e958 100644 --- a/components/net/cpp/src/peer.cpp +++ b/components/net/cpp/src/peer.cpp @@ -429,7 +429,7 @@ void Peer::data() { } lk.unlock(); - //LOG(INFO) << "Received " << rc << " bytes"; + LOG(INFO) << "Received " << rc << " bytes"; } bool Peer::_data() { @@ -467,10 +467,10 @@ bool Peer::_data() { // CHECK Safe to unlock here? is_waiting_ = true; - lk.unlock(); + //lk.unlock(); disp_->dispatch(*this, obj); // Relock before next loop of while - lk.lock(); + //lk.lock(); is_waiting_ = false; if (scheme_ == ftl::URI::SCHEME_WS && recv_buf_.nonparsed_size() > 0) { diff --git a/components/rgbd-sources/src/streamer.cpp b/components/rgbd-sources/src/streamer.cpp index 49b5f3077..8273a6fbd 100644 --- a/components/rgbd-sources/src/streamer.cpp +++ b/components/rgbd-sources/src/streamer.cpp @@ -299,7 +299,7 @@ void Streamer::_schedule() { vector<int> pngparams = {cv::IMWRITE_PNG_COMPRESSION, 1}; // Default is 1 for fast, 9 = small but slow. cv::imencode(".png", d2, d_buf, pngparams); - LOG(INFO) << "Sending chunk " << chunk; + LOG(INFO) << "Sending chunk " << chunk << " : size = " << chunkRGB.cols << "," << chunkRGB.rows; UNIQUE_LOCK(src->mutex,lk); auto i = src->clients[0].begin(); @@ -312,6 +312,7 @@ void Streamer::_schedule() { } catch(...) { (*i).txcount = (*i).txmax; } + i++; } } -- GitLab