From 25d5bd12f8402cd250dd2df3a9812bfd072fbf76 Mon Sep 17 00:00:00 2001 From: Timothee Leclaire-Fournier Date: Fri, 8 Mar 2024 21:40:34 -0500 Subject: [PATCH] CurlHandler: Fix downloading any number of emails. --- CurlHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CurlHandler.cpp b/CurlHandler.cpp index d1a5b2a..9248ed5 100755 --- a/CurlHandler.cpp +++ b/CurlHandler.cpp @@ -5,7 +5,7 @@ CurlHandler::CurlHandler() } CurlHandler::~CurlHandler() { - for (auto& t : v) + for (auto &t: v) t.join(); } @@ -47,7 +47,7 @@ std::vector *CurlHandler::fetch() { decodedMessages.resize(messagesId.size()); count = 0; - for (auto i{messagesId.rbegin()}; i != messagesId.rbegin() + 5; i++) + for (auto i{messagesId.rbegin()}; i != messagesId.rbegin() + 10 && i != messagesId.rend(); i++) v.emplace_back(&CurlHandler::query, this, std::ref(*i), count++); return &decodedMessages;