From 96669e0202df9104a4667894a0bf5120c24eb222 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Fri, 18 Aug 2023 18:39:19 +0200 Subject: [PATCH] small tweaks to get the progressbar going (sometimes o.o) --- src/sha1_ngcft1.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/sha1_ngcft1.cpp b/src/sha1_ngcft1.cpp index 63c45b2..aa364cd 100644 --- a/src/sha1_ngcft1.cpp +++ b/src/sha1_ngcft1.cpp @@ -135,6 +135,9 @@ void SHA1_NGCFT1::updateMessages(ContentHandle ce) { if (ce.all_of()) { msg.emplace_or_replace(ce.get()); } + if (ce.all_of()) { + msg.emplace_or_replace(ce.get()); + } if (ce.all_of()) { msg.emplace_or_replace(); } else { @@ -482,6 +485,8 @@ bool SHA1_NGCFT1::onEvent(const Message::Events::MessageUpdated& e) { // now, enque _queue_content_want_chunk.push_back(ce); + ce.remove(); + // should? e.e.remove(); @@ -822,12 +827,13 @@ bool SHA1_NGCFT1::onEvent(const Events::NGCFT1_recv_done& e) { cc.have_chunk.clear(); // not wasting memory std::cout << "SHA1_NGCFT1: got all chunks for \n" << info << "\n"; } + + // good chunk + // TODO: have wasted + metadata + ce.get_or_emplace().total += chunk_data.size(); } else { std::cout << "SHA1_NGCFT1 warning: got chunk duplicate\n"; } - - // good chunk - ce.get_or_emplace().total += chunk_data.size(); } else { // bad chunk // TODO: requeue?