| 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 | { |
nothing calls this directly
no test coverage detected