From 248992b27b0a6f3e056c779085c37da7e5ee2081 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 19 Nov 2016 14:28:58 -0500 Subject: [PATCH 1/3] temporarty fix crash --- Destination.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Destination.cpp b/Destination.cpp index 9cf49336..f2833479 100644 --- a/Destination.cpp +++ b/Destination.cpp @@ -540,7 +540,9 @@ namespace client else // duplicate { LogPrint (eLogInfo, "Destination: Request of LeaseSet ", dest.ToBase64 (), " is pending already"); - ret.first->second->requestComplete.push_back (requestComplete); + // TODO: implement it properly + //ret.first->second->requestComplete.push_back (requestComplete); + requestComplete (nullptr); } } else From 565f844b7fc307ee95946c369d4aa6b0f3b9ac44 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 19 Nov 2016 17:24:38 -0500 Subject: [PATCH 2/3] correct termination of pending leaseset --- Destination.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Destination.cpp b/Destination.cpp index f2833479..7b2e896d 100644 --- a/Destination.cpp +++ b/Destination.cpp @@ -527,13 +527,15 @@ namespace client { auto request = std::make_shared (m_Service); request->requestComplete.push_back (requestComplete); + auto ts = i2p::util::GetSecondsSinceEpoch (); auto ret = m_LeaseSetRequests.insert (std::pair >(dest,request)); if (ret.second) // inserted { + request->requestTime = ts; if (!SendLeaseSetRequest (dest, floodfill, request)) { // request failed - m_LeaseSetRequests.erase (dest); + m_LeaseSetRequests.erase (ret.first); requestComplete (nullptr); } } @@ -542,6 +544,8 @@ namespace client LogPrint (eLogInfo, "Destination: Request of LeaseSet ", dest.ToBase64 (), " is pending already"); // TODO: implement it properly //ret.first->second->requestComplete.push_back (requestComplete); + if (ts > ret.first->second->requestTime + MAX_LEASESET_REQUEST_TIMEOUT) + m_LeaseSetRequests.erase (ret.first); requestComplete (nullptr); } } @@ -565,7 +569,6 @@ namespace client if (request->replyTunnel && request->outboundTunnel) { request->excluded.insert (nextFloodfill->GetIdentHash ()); - request->requestTime = i2p::util::GetSecondsSinceEpoch (); request->requestTimeoutTimer.cancel (); uint8_t replyKey[32], replyTag[32]; From 65d721285b3e87d5dee660fcf6caa5fe4c94758b Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 20 Nov 2016 08:33:33 -0500 Subject: [PATCH 3/3] fixed build error for some compilers --- Garlic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Garlic.cpp b/Garlic.cpp index 290b9b79..94ca82eb 100644 --- a/Garlic.cpp +++ b/Garlic.cpp @@ -274,7 +274,7 @@ namespace garlic if (newTags) // new tags created { newTags->msgID = msgID; - m_UnconfirmedTagsMsgs.emplace (msgID, std::unique_ptr(newTags)); + m_UnconfirmedTagsMsgs.insert (std::make_pair(msgID, std::unique_ptr(newTags))); newTags = nullptr; // got acquired } m_Owner->DeliveryStatusSent (shared_from_this (), msgID);