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

Side by Side Diff: net/tools/quic/quic_client_bin.cc

Issue 2363393004: Remove usage of BalsaHeaders from QuicClient. Also move QuicDataToResend from QuicClient to QuicCli… (Closed)
Patch Set: Fix win Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_client_base.cc ('k') | net/tools/quic/quic_simple_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // A binary wrapper for QuicClient. 5 // A binary wrapper for QuicClient.
6 // Connects to a host using QUIC, sends a request to the provided URL, and 6 // Connects to a host using QUIC, sends a request to the provided URL, and
7 // displays the response. 7 // displays the response.
8 // 8 //
9 // Some usage examples: 9 // Some usage examples:
10 // 10 //
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 CHECK_EQ(2u, kv.size()); 306 CHECK_EQ(2u, kv.size());
307 string key; 307 string key;
308 base::TrimWhitespaceASCII(kv[0], base::TRIM_ALL, &key); 308 base::TrimWhitespaceASCII(kv[0], base::TRIM_ALL, &key);
309 string value; 309 string value;
310 base::TrimWhitespaceASCII(kv[1], base::TRIM_ALL, &value); 310 base::TrimWhitespaceASCII(kv[1], base::TRIM_ALL, &value);
311 headers.AppendHeader(key, value); 311 headers.AppendHeader(key, value);
312 } 312 }
313 313
314 // Make sure to store the response, for later output. 314 // Make sure to store the response, for later output.
315 client.set_store_response(true); 315 client.set_store_response(true);
316
317 // Send the request. 316 // Send the request.
318 net::SpdyHeaderBlock header_block = 317 net::SpdyHeaderBlock header_block =
319 net::SpdyBalsaUtils::RequestHeadersToSpdyHeaders(headers); 318 net::SpdyBalsaUtils::RequestHeadersToSpdyHeaders(headers);
320 client.SendRequestAndWaitForResponse(headers, body, /*fin=*/true); 319 client.SendRequestAndWaitForResponse(header_block, body, /*fin=*/true);
321 320
322 // Print request and response details. 321 // Print request and response details.
323 if (!FLAGS_quiet) { 322 if (!FLAGS_quiet) {
324 cout << "Request:" << endl; 323 cout << "Request:" << endl;
325 cout << "headers:" << header_block.DebugString(); 324 cout << "headers:" << header_block.DebugString();
326 if (!FLAGS_body_hex.empty()) { 325 if (!FLAGS_body_hex.empty()) {
327 // Print the user provided hex, rather than binary body. 326 // Print the user provided hex, rather than binary body.
328 cout << "body:\n" 327 cout << "body:\n"
329 << net::QuicUtils::HexDump(net::QuicUtils::HexDecode(FLAGS_body_hex)) 328 << net::QuicUtils::HexDump(net::QuicUtils::HexDecode(FLAGS_body_hex))
330 << endl; 329 << endl;
(...skipping 23 matching lines...) Expand all
354 return 0; 353 return 0;
355 } else { 354 } else {
356 cout << "Request failed (redirect " << response_code << ")." << endl; 355 cout << "Request failed (redirect " << response_code << ")." << endl;
357 return 1; 356 return 1;
358 } 357 }
359 } else { 358 } else {
360 cerr << "Request failed (" << response_code << ")." << endl; 359 cerr << "Request failed (" << response_code << ")." << endl;
361 return 1; 360 return 1;
362 } 361 }
363 } 362 }
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client_base.cc ('k') | net/tools/quic/quic_simple_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698