mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Check listening options as well when we want to enforce topology constraints
PiperOrigin-RevId: 543497497
This commit is contained in:
committed by
Copybara-Service
parent
7a25b33603
commit
7f1d6a4bba
@@ -711,6 +711,21 @@ bool ClientProxy::RemoteConnectionIsAccepted(std::string endpoint_id) const {
|
||||
endpoint_id, ClientProxy::Connection::kRemoteEndpointAccepted);
|
||||
}
|
||||
|
||||
bool ClientProxy::ShouldEnforceTopologyConstraints() const {
|
||||
bool result = false;
|
||||
if (IsAdvertising() &&
|
||||
(GetAdvertisingOptions().strategy.IsNone() ||
|
||||
GetAdvertisingOptions().enforce_topology_constraints)) {
|
||||
result |= true;
|
||||
}
|
||||
if (IsListeningForIncomingConnections() &&
|
||||
(GetListeningOptions().strategy.IsNone() ||
|
||||
GetListeningOptions().enforce_topology_constraints)) {
|
||||
result |= true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void ClientProxy::AddCancellationFlag(const std::string& endpoint_id) {
|
||||
// Don't insert the CancellationFlag to the map if feature flag is disabled.
|
||||
if (!FeatureFlags::GetInstance().GetFlags().enable_cancellation_flag) {
|
||||
|
||||
Reference in New Issue
Block a user