mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Replace NEARBY_LOGS with LOG for all coding under google3/third_party/nearby/
PiperOrigin-RevId: 786733783
This commit is contained in:
@@ -67,7 +67,7 @@ ServerSocket::ServerSocket(const Connection& connection,
|
||||
: BaseSocket(connection, std::move(socket_callback)) {}
|
||||
|
||||
ServerSocket::~ServerSocket() {
|
||||
NEARBY_LOGS(INFO) << "ServerSocket dtor";
|
||||
LOG(INFO) << "ServerSocket dtor";
|
||||
ShutDown();
|
||||
}
|
||||
|
||||
@@ -79,14 +79,14 @@ void ServerSocket::DisconnectQuietly() {
|
||||
void ServerSocket::OnReceiveControlPacket(Packet packet) {
|
||||
if (packet.GetControlCommandNumber() ==
|
||||
Packet::ControlPacketType::kControlError) {
|
||||
NEARBY_LOGS(WARNING) << "Received error control packet, disconnecting.";
|
||||
LOG(WARNING) << "Received error control packet, disconnecting.";
|
||||
DisconnectQuietly();
|
||||
return;
|
||||
}
|
||||
// Control packets besides errors are not supposed to be sent or received
|
||||
// after the initial handshake.
|
||||
if (state_ != State::kClientConnectionRequest) {
|
||||
NEARBY_LOGS(ERROR) << "Not in 'Connection Request' state, but "
|
||||
LOG(ERROR) << "Not in 'Connection Request' state, but "
|
||||
"incorrectly received control packet of type "
|
||||
<< Packet::ControlPacketTypeToString(
|
||||
packet.GetControlCommandNumber());
|
||||
@@ -96,7 +96,7 @@ void ServerSocket::OnReceiveControlPacket(Packet packet) {
|
||||
}
|
||||
if (packet.GetControlCommandNumber() !=
|
||||
Packet::ControlPacketType::kControlConnectionRequest) {
|
||||
NEARBY_LOGS(ERROR) << "Expected connection request control packet, "
|
||||
LOG(ERROR) << "Expected connection request control packet, "
|
||||
"received control packet of type "
|
||||
<< Packet::ControlPacketTypeToString(
|
||||
packet.GetControlCommandNumber());
|
||||
@@ -116,7 +116,7 @@ void ServerSocket::OnReceiveControlPacket(Packet packet) {
|
||||
ExtractMaxProtocolVersionFromConnRequest(packet_payload);
|
||||
if (min_protocol_version > kProtocolVersion ||
|
||||
max_protocol_version < kProtocolVersion) {
|
||||
NEARBY_LOGS(ERROR) << "Received unexpected min/max protocol versions: "
|
||||
LOG(ERROR) << "Received unexpected min/max protocol versions: "
|
||||
<< min_protocol_version << " and "
|
||||
<< max_protocol_version;
|
||||
DisconnectInternal(
|
||||
@@ -144,7 +144,7 @@ void ServerSocket::WriteConnectionConfirm() {
|
||||
absl::StatusOr<Packet> packet = Packet::CreateConnectionConfirmPacket(
|
||||
kProtocolVersion, max_packet_size_, "");
|
||||
if (!packet.ok()) {
|
||||
NEARBY_LOGS(ERROR) << "Failed to create connection confirm packet: "
|
||||
LOG(ERROR) << "Failed to create connection confirm packet: "
|
||||
<< packet.status();
|
||||
DisconnectInternal(packet.status());
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user