Internal change

PiperOrigin-RevId: 367032687
This commit is contained in:
hai007
2021-04-06 10:21:51 -07:00
committed by Copybara-Service
parent 4028181c2a
commit 77ceeb0fdc
4 changed files with 11 additions and 0 deletions
@@ -139,6 +139,9 @@ ExceptionOr<ByteArray> BaseEndpointChannel::Read() {
auto parsed = parser::FromBytes(ByteArray(input));
if (parsed.ok() &&
parser::GetFrameType(parsed.result()) == V1Frame::KEEP_ALIVE) {
NEARBY_LOGS(INFO)
<< __func__
<< ": Read unencrypted KEEP_ALIVE on encrypted channel.";
result = ByteArray(input);
}
}
@@ -247,6 +250,8 @@ void BaseEndpointChannel::CloseIo() {
void BaseEndpointChannel::Close(
proto::connections::DisconnectionReason reason) {
NEARBY_LOGS(INFO) << __func__
<< ": Closing endpoint channel, reason: " << reason;
Close();
}
+3
View File
@@ -721,6 +721,9 @@ void WebRtc::ProcessDataChannelBufferAmountChanged(
void WebRtc::ProcessDataChannelClosed(const PeerId& remote_peer_id) {
MutexLock lock(&mutex_);
NEARBY_LOG(INFO,
"Data channel has closed, removing connection flow for peer %s.",
remote_peer_id.GetId().c_str());
const auto& entry = sockets_.find(remote_peer_id.GetId());
if (entry == sockets_.end()) {
return;
@@ -366,6 +366,8 @@ void ConnectionFlow::OnConnectionChange(
// is closing right now - PeerConnection::Close() triggered
// PeerConnectionObserver::OnConnectionChange(kClosed).
// We must not call PeerConnection::Close() again on that code path
NEARBY_LOG(INFO, "Closing due to peer connection state change: %d",
new_state);
Close(new_state != PeerConnectionState::kClosed);
}
}
@@ -37,6 +37,7 @@ Exception WebRtcSocket::OutputStreamImpl::Write(const ByteArray& data) {
}
if (!socket_->SendMessage(data)) {
NEARBY_LOG(INFO, "Unable to write data to socket.");
return {Exception::kIo};
}
return {Exception::kSuccess};