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

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

Issue 1538373002: n/a (quic toy client) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« 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 0217fa5d5562926de2f13c8a9964b1cfd85c5db8..908da90c297cd235fe25fd925cda303778c2c9ce 100644
--- a/net/tools/quic/quic_simple_client_bin.cc
+++ b/net/tools/quic/quic_simple_client_bin.cc
@@ -47,6 +47,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
+#include "base/strings/stringprintf.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/base/privacy_mode.h"
@@ -337,7 +338,12 @@ int main(int argc, char *argv[]) {
if (!FLAGS_quiet) {
cout << "Request:" << endl;
cout << "headers:" << header_block.DebugString();
- cout << "body: " << body << endl;
+ string body_to_print = body;
+ if (!FLAGS_body_hex.empty()) {
+ // Print the user provided hex, rather than binary body.
+ body_to_print = base::StringPrintf("(hex) 0x%s", FLAGS_body_hex.c_str());
+ }
+ cout << "body: " << body_to_print << endl;
cout << endl;
cout << "Response:" << endl;
cout << "headers: " << client.latest_response_headers() << 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