add MarkAddressOutbound to plainquic

pull/1658/head
Jeff Becker 3 years ago
parent cce15b13c8
commit 5909ad0386
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -130,6 +130,9 @@ namespace llarp
std::string name,
std::string service,
std::function<void(std::vector<dns::SRVData>)> resultHandler) = 0;
virtual void
MarkAddressOutbound(AddressVariant_t remote) = 0;
};
} // namespace llarp

@ -41,6 +41,8 @@ namespace llarp
void
SRVRecordsChanged() override;
void MarkAddressOutbound(AddressVariant_t) override{};
bool
SendToOrQueue(
service::ConvoTag tag, const llarp_buffer_t& payload, service::ProtocolType t) override;

@ -528,6 +528,7 @@ namespace llarp::quic
if (not continue_connecting(
pport, (bool)maybe_remote, "endpoint ONS lookup", remote_addr))
return;
service_endpoint_.MarkAddressOutbound(*maybe_remote);
service_endpoint_.EnsurePathTo(*maybe_remote, after_path, open_timeout);
});
return result;
@ -539,7 +540,10 @@ namespace llarp::quic
if (auto maybe_convo = service_endpoint_.GetBestConvoTagFor(remote))
after_path(maybe_convo);
else
{
service_endpoint_.MarkAddressOutbound(remote);
service_endpoint_.EnsurePathTo(remote, after_path, open_timeout);
}
return result;
}

@ -1366,9 +1366,10 @@ namespace llarp
}
void
Endpoint::MarkAddressOutbound(const Address& addr)
Endpoint::MarkAddressOutbound(AddressVariant_t addr)
{
m_state->m_OutboundSessions.insert(addr);
if (auto* ptr = std::get_if<Address>(&addr))
m_state->m_OutboundSessions.insert(*ptr);
}
bool

@ -286,8 +286,7 @@ namespace llarp
WantsOutboundSession(const Address&) const override;
/// this MUST be called if you want to call EnsurePathTo on the given address
void
MarkAddressOutbound(const Address&) override;
void MarkAddressOutbound(AddressVariant_t) override;
bool
ShouldBundleRC() const override

@ -77,10 +77,6 @@ namespace llarp
/// do we want a session outbound to addr
virtual bool
WantsOutboundSession(const Address& addr) const = 0;
virtual void
MarkAddressOutbound(const Address& addr) = 0;
virtual void
QueueRecvData(RecvDataEvent ev) = 0;
};

Loading…
Cancel
Save