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?