mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
Internal change
PiperOrigin-RevId: 367032687
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user