mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
Roll forward to cl/331709254
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I1f0b645549f75c08a7af4512265cef8eadc7e672
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
#include "core/internal/p2p_cluster_pcp_handler.h"
|
||||
|
||||
#include "platform/api/hash_utils.h"
|
||||
|
||||
namespace location {
|
||||
|
||||
@@ -488,9 +488,8 @@ void BwuManager::ProcessLastWriteToPriorChannelEvent(
|
||||
successfully_upgraded_endpoints_.emplace(endpoint_id);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
previous_endpoint_channel->Write(parser::ForBwuSafeToClose());
|
||||
} catch (IOException e) {
|
||||
|
||||
if (!previous_endpoint_channel->Write(parser::ForBwuSafeToClose()).Ok()) {
|
||||
previous_endpoint_channel->Close(DisconnectionReason::IO_ERROR);
|
||||
// Remove this prior EndpointChannel from previous_endpoint_channels to
|
||||
// avoid leaks.
|
||||
@@ -503,6 +502,7 @@ void BwuManager::ProcessLastWriteToPriorChannelEvent(
|
||||
endpoint_id.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
// The upgrade protocol's clean shutdown of the prior EndpointChannel will
|
||||
// conclude when we receive a corresponding
|
||||
// BANDWIDTH_UPGRADE_NEGOTIATION.SAFE_TO_CLOSE_PRIOR_CHANNEL OfflineFrame
|
||||
@@ -599,7 +599,7 @@ void BwuManager::ProcessUpgradeFailureEvent(
|
||||
Medium last = parser::UpgradePathInfoMediumToMedium(upgrade_info.medium());
|
||||
std::vector<Medium> all_possible_mediums =
|
||||
client->GetUpgradeMediums(endpoint_id).GetMediums(true);
|
||||
std::vector untried_mediums(all_possible_mediums);
|
||||
std::vector<Medium> untried_mediums(all_possible_mediums);
|
||||
for (Medium medium : all_possible_mediums) {
|
||||
untried_mediums.erase(untried_mediums.begin());
|
||||
if (medium == last) {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#define CORE_V2_INTERNAL_BWU_MANAGER_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "core_v2/internal/bwu_handler.h"
|
||||
#include "core_v2/internal/client_proxy.h"
|
||||
|
||||
@@ -67,7 +67,7 @@ std::string Utils::WrapUpgradeServiceId(const std::string& service_id) {
|
||||
|
||||
std::string Utils::UnwrapUpgradeServiceId(
|
||||
const std::string& upgrade_service_id) {
|
||||
auto pos = upgrade_service_id.find(kUpgradeServiceIdPostfix);
|
||||
auto pos = upgrade_service_id.find(std::string(kUpgradeServiceIdPostfix));
|
||||
if (pos != std::string::npos) {
|
||||
return std::string(upgrade_service_id, 0, pos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user