MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / RequestComplete

Method RequestComplete

libi2pd/NetDbRequests.cpp:184–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182 }
183
184 void NetDbRequests::RequestComplete (const IdentHash& ident, std::shared_ptr<RouterInfo> r)
185 {
186 boost::asio::post (GetIOService (), [this, ident, r]()
187 {
188 std::shared_ptr<RequestedDestination> request;
189 auto it = m_RequestedDestinations.find (ident);
190 if (it != m_RequestedDestinations.end ())
191 {
192 request = it->second;
193 if (request->IsExploratory ())
194 m_RequestedDestinations.erase (it);
195 // otherwise cache for a while
196 }
197 if (request)
198 {
199 if (r)
200 request->Success (r);
201 else
202 request->Fail ();
203 }
204 });
205 }
206
207 std::shared_ptr<RequestedDestination> NetDbRequests::FindRequest (const IdentHash& ident) const
208 {

Callers

nothing calls this directly

Calls 3

SuccessMethod · 0.80
FailMethod · 0.80
IsExploratoryMethod · 0.45

Tested by

no test coverage detected