Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(858)

Unified Diff: net/quic/core/quic_connection.cc

Issue 2591143003: Add QuicStrCat. (Closed)
Patch Set: correct quic_client_bin.cc Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/core/quic_connection.cc
diff --git a/net/quic/core/quic_connection.cc b/net/quic/core/quic_connection.cc
index 78220209e104c4cad952b89ec2a637575b4045ad..86fcd9e90f5589d8b811bfe8fd3a24595ac203b3 100644
--- a/net/quic/core/quic_connection.cc
+++ b/net/quic/core/quic_connection.cc
@@ -536,10 +536,10 @@ void QuicConnection::OnVersionNegotiationPacket(
if (!SelectMutualVersion(packet.versions)) {
CloseConnection(
QUIC_INVALID_VERSION,
- "No common version found. Supported versions: {" +
- QuicVersionVectorToString(framer_.supported_versions()) +
- "}, peer supported versions: {" +
- QuicVersionVectorToString(packet.versions) + "}",
+ QuicStrCat("No common version found. Supported versions: {",
+ QuicVersionVectorToString(framer_.supported_versions()),
+ "}, peer supported versions: {",
+ QuicVersionVectorToString(packet.versions), "}"),
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
return;
}
@@ -1373,9 +1373,8 @@ bool QuicConnection::ProcessValidatedPacket(const QuicPacketHeader& header) {
// Packets should have the version flag till version negotiation is
// done.
string error_details =
- StringPrintf("%s Packet %" PRIu64
- " without version flag before version negotiated.",
- ENDPOINT, header.packet_number);
+ QuicStrCat(ENDPOINT, "Packet ", header.packet_number,
+ " without version flag before version negotiated.");
DLOG(WARNING) << error_details;
CloseConnection(QUIC_INVALID_VERSION, error_details,
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
@@ -1694,9 +1693,8 @@ void QuicConnection::OnWriteError(int error_code) {
}
write_error_occured_ = true;
- const string error_details = "Write failed with error: " +
- base::IntToString(error_code) + " (" +
- ErrorToString(error_code) + ")";
+ const string error_details = QuicStrCat(
+ "Write failed with error: ", error_code, " (", strerror(error_code), ")");
DVLOG(1) << ENDPOINT << error_details;
// We can't send an error as the socket is presumably borked.
switch (error_code) {

Powered by Google App Engine
This is Rietveld 408576698