Merge branch 'master' into release to roll forward up to cl/354394201.

This commit is contained in:
hai007
2021-01-28 14:30:49 -08:00
7 changed files with 195 additions and 105 deletions
+7 -2
View File
@@ -233,6 +233,8 @@ EncryptionRunner::ResultListener BasePcpHandler::GetResultListener() {
.on_failure_cb =
[this](const std::string& endpoint_id, EndpointChannel* channel) {
RunOnPcpHandlerThread([this, endpoint_id, channel]() {
NEARBY_LOG(ERROR, "Encryption failed for %s on medium %d",
endpoint_id.c_str(), channel->GetMedium());
OnEncryptionFailureRunnable(endpoint_id, channel);
});
},
@@ -563,12 +565,15 @@ void BasePcpHandler::ProcessPreConnectionInitiationFailure(
channel->Close();
}
pending_connections_.erase(endpoint_id);
if (result != nullptr) {
NEARBY_LOG(INFO, "Connection failed; aborting future");
result->Set(status);
}
// result is hold inside a swapper, and saved in PendingConnectionInfo.
// PendingConnectionInfo destructor will clear the memory of SettableFuture
// shared_ptr for result.
pending_connections_.erase(endpoint_id);
}
void BasePcpHandler::ProcessPreConnectionResultFailure(