-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39b1db5
commit b3a2cc7
Showing
22 changed files
with
327 additions
and
1,049 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "chromium_dns_txt_lookup.h" | ||
|
||
#include "inter_request_state.h" | ||
|
||
using Self = ipfs::ChromiumDnsTxtLookup; | ||
|
||
void Self::SendDnsTextRequest(std::string host, | ||
DnsTextResultsCallback res, | ||
DnsTextCompleteCallback don) { | ||
if (dns_reqs_.find(host) != dns_reqs_.end()) { | ||
LOG(INFO) << "Requested resolution of DNSLink host " << host | ||
<< " multiple times."; | ||
} | ||
auto don_wrap = [don, this, host]() { | ||
don(); | ||
VLOG(2) << "Finished resolving " << host << " via DNSLink"; | ||
dns_reqs_.erase(host); | ||
}; | ||
auto* nc = state_->network_context(); | ||
dns_reqs_[host] = std::make_unique<DnsTxtRequest>(host, res, don_wrap, nc); | ||
} | ||
Self::ChromiumDnsTxtLookup(InterRequestState& st) : state_{&st} {} | ||
Self::~ChromiumDnsTxtLookup() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef IPFS_CHROMIUM_CHROMIUM_DNS_TXT_LOOKUP_H | ||
#define IPFS_CHROMIUM_CHROMIUM_DNS_TXT_LOOKUP_H | ||
|
||
#include "dns_txt_request.h" | ||
|
||
#include <ipfs_client/ctx/dns_txt_lookup.h> | ||
|
||
namespace ipfs { | ||
class InterRequestState; | ||
class ChromiumDnsTxtLookup : public ctx::DnsTxtLookup { | ||
raw_ptr<InterRequestState> state_; | ||
std::map<std::string, std::unique_ptr<DnsTxtRequest>> dns_reqs_; | ||
|
||
void SendDnsTextRequest(std::string, | ||
DnsTextResultsCallback, | ||
DnsTextCompleteCallback) override; | ||
|
||
public: | ||
ChromiumDnsTxtLookup(InterRequestState&); | ||
~ChromiumDnsTxtLookup() noexcept override; | ||
}; | ||
} // namespace ipfs | ||
|
||
#endif // IPFS_CHROMIUM_CHROMIUM_DNS_TXT_LOOKUP_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.