gfe-relnote: (n/a) Add some DLOGs in quic_connection.cc when a packet is detected to be a connectivity probing. Test only, not protected.
PiperOrigin-RevId: 293884390
Change-Id: I61b2c6e35bf23c75dbe997cad337501dce0c28af
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc
index a8a269c..c4c862b 100644
--- a/quic/core/quic_connection.cc
+++ b/quic/core/quic_connection.cc
@@ -1417,12 +1417,6 @@
<< IsCurrentPacketConnectivityProbing();
if (IsCurrentPacketConnectivityProbing()) {
- QUIC_DVLOG(1) << ENDPOINT << "Received a connectivity probing packet for "
- << GetServerConnectionIdAsRecipient(last_header_,
- perspective_)
- << " from ip:port: " << last_packet_source_address_.ToString()
- << " to ip:port: "
- << last_packet_destination_address_.ToString();
visitor_->OnPacketReceived(last_packet_destination_address_,
last_packet_source_address_,
/*is_connectivity_probe=*/true);
@@ -3711,10 +3705,23 @@
if (perspective_ == Perspective::IS_SERVER) {
is_current_packet_connectivity_probing_ =
current_effective_peer_migration_type_ != NO_CHANGE;
+ QUIC_DLOG_IF(INFO, is_current_packet_connectivity_probing_)
+ << ENDPOINT
+ << "Detected connectivity probing packet. "
+ "current_effective_peer_migration_type_:"
+ << current_effective_peer_migration_type_;
} else {
is_current_packet_connectivity_probing_ =
(last_packet_source_address_ != peer_address_) ||
(last_packet_destination_address_ != self_address_);
+ QUIC_DLOG_IF(INFO, is_current_packet_connectivity_probing_)
+ << ENDPOINT
+ << "Detected connectivity probing packet. "
+ "last_packet_source_address_:"
+ << last_packet_source_address_ << ", peer_address_:" << peer_address_
+ << ", last_packet_destination_address_:"
+ << last_packet_destination_address_
+ << ", self_address_:" << self_address_;
}
return;
}
diff --git a/quic/core/quic_types.cc b/quic/core/quic_types.cc
index c0bdf1e..0fa7cfb 100644
--- a/quic/core/quic_types.cc
+++ b/quic/core/quic_types.cc
@@ -632,9 +632,30 @@
break;
}
}
+
std::ostream& operator<<(std::ostream& os, const QuicConnectionCloseType type) {
os << QuicConnectionCloseTypeString(type);
return os;
}
+std::string AddressChangeTypeToString(AddressChangeType type) {
+ using IntType = typename std::underlying_type<AddressChangeType>::type;
+ switch (type) {
+ RETURN_STRING_LITERAL(NO_CHANGE);
+ RETURN_STRING_LITERAL(PORT_CHANGE);
+ RETURN_STRING_LITERAL(IPV4_SUBNET_CHANGE);
+ RETURN_STRING_LITERAL(IPV4_TO_IPV4_CHANGE);
+ RETURN_STRING_LITERAL(IPV4_TO_IPV6_CHANGE);
+ RETURN_STRING_LITERAL(IPV6_TO_IPV4_CHANGE);
+ RETURN_STRING_LITERAL(IPV6_TO_IPV6_CHANGE);
+ default:
+ return quiche::QuicheStrCat("Unknown(", static_cast<IntType>(type), ")");
+ }
+}
+
+std::ostream& operator<<(std::ostream& os, AddressChangeType type) {
+ os << AddressChangeTypeToString(type);
+ return os;
+}
+
} // namespace quic
diff --git a/quic/core/quic_types.h b/quic/core/quic_types.h
index e027b7b..2c2c2d0 100644
--- a/quic/core/quic_types.h
+++ b/quic/core/quic_types.h
@@ -460,6 +460,12 @@
IPV6_TO_IPV6_CHANGE,
};
+QUIC_EXPORT_PRIVATE std::string AddressChangeTypeToString(
+ AddressChangeType type);
+
+QUIC_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
+ AddressChangeType type);
+
enum StreamSendingState {
// Sender has more data to send on this stream.
NO_FIN,