Roll forward to cl/331709254

Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: I1f0b645549f75c08a7af4512265cef8eadc7e672
This commit is contained in:
Alexey Polyudov
2020-09-15 00:41:58 -07:00
parent 3cadfac2f4
commit 4e3f343b7a
4 changed files with 7 additions and 5 deletions
@@ -13,6 +13,7 @@
// limitations under the License.
#include "core/internal/p2p_cluster_pcp_handler.h"
#include "platform/api/hash_utils.h"
namespace location {
+4 -4
View File
@@ -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) {
+1
View File
@@ -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"
+1 -1
View File
@@ -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);
}