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

Unified Diff: net/tools/quic/quic_simple_client_bin.cc

Issue 2121293003: Adds a QuicUtil::HexDump method that provides better debug output of binary data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@126089643
Patch Set: Use uppercase hex characters Created 4 years, 5 months 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
« no previous file with comments | « net/tools/quic/quic_client_bin.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_simple_client_bin.cc
diff --git a/net/tools/quic/quic_simple_client_bin.cc b/net/tools/quic/quic_simple_client_bin.cc
index 7cbb6dbdb8bad5b4a6591a43b19500a49b32763d..75dca3927167b42f38786fadfe3d1c27ada006b4 100644
--- a/net/tools/quic/quic_simple_client_bin.cc
+++ b/net/tools/quic/quic_simple_client_bin.cc
@@ -326,9 +326,8 @@ int main(int argc, char* argv[]) {
cout << "headers:" << header_block.DebugString();
if (!FLAGS_body_hex.empty()) {
// Print the user provided hex, rather than binary body.
- cout << "body hex: " << FLAGS_body_hex << endl;
- cout << "body ascii: " << net::QuicUtils::BinaryToAscii(
- net::QuicUtils::HexDecode(FLAGS_body_hex))
+ cout << "body:\n"
+ << net::QuicUtils::HexDump(net::QuicUtils::HexDecode(FLAGS_body_hex))
<< endl;
} else {
cout << "body: " << body << endl;
@@ -339,10 +338,7 @@ int main(int argc, char* argv[]) {
string response_body = client.latest_response_body();
if (!FLAGS_body_hex.empty()) {
// Assume response is binary data.
- cout << "body hex: " << net::QuicUtils::HexEncode(response_body)
- << endl;
- cout << "body ascii: " << net::QuicUtils::BinaryToAscii(response_body)
- << endl;
+ cout << "body:\n" << net::QuicUtils::HexDump(response_body) << endl;
} else {
cout << "body: " << response_body << endl;
}
« no previous file with comments | « net/tools/quic/quic_client_bin.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698