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

Unified Diff: net/tools/quic/test_tools/quic_test_client.cc

Issue 192583004: QUIC - use QuicSessionKey tuple (host, port, is_https) instead of server_hostname (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with TOT Created 6 years, 9 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
Index: net/tools/quic/test_tools/quic_test_client.cc
diff --git a/net/tools/quic/test_tools/quic_test_client.cc b/net/tools/quic/test_tools/quic_test_client.cc
index 8cfeefb5f5b2028c983396c857f6e1aa3517d6af..00061b5e287e869cc7ec5a95fd393cae52e91831 100644
--- a/net/tools/quic/test_tools/quic_test_client.cc
+++ b/net/tools/quic/test_tools/quic_test_client.cc
@@ -10,6 +10,7 @@
#include "net/cert/cert_verify_result.h"
#include "net/cert/x509_certificate.h"
#include "net/quic/crypto/proof_verifier.h"
+#include "net/quic/quic_session_key.h"
#include "net/quic/test_tools/quic_connection_peer.h"
#include "net/tools/balsa/balsa_headers.h"
#include "net/tools/quic/quic_epoll_connection_helper.h"
@@ -99,17 +100,17 @@ BalsaHeaders* MungeHeaders(const BalsaHeaders* const_headers,
class MockableQuicClient : public QuicClient {
public:
MockableQuicClient(IPEndPoint server_address,
- const string& server_hostname,
+ const QuicSessionKey& server_key,
const QuicVersionVector& supported_versions)
- : QuicClient(server_address, server_hostname, supported_versions, false),
+ : QuicClient(server_address, server_key, supported_versions, false),
override_connection_id_(0),
test_writer_(NULL) {}
MockableQuicClient(IPEndPoint server_address,
- const string& server_hostname,
+ const QuicSessionKey& server_key,
const QuicConfig& config,
const QuicVersionVector& supported_versions)
- : QuicClient(server_address, server_hostname, config, supported_versions),
+ : QuicClient(server_address, server_key, config, supported_versions),
override_connection_id_(0),
test_writer_(NULL) {}
@@ -145,34 +146,36 @@ class MockableQuicClient : public QuicClient {
QuicPacketWriterWrapper* test_writer_;
};
-QuicTestClient::QuicTestClient(IPEndPoint address, const string& hostname,
+QuicTestClient::QuicTestClient(IPEndPoint address,
+ const QuicSessionKey& server_key,
const QuicVersionVector& supported_versions)
- : client_(new MockableQuicClient(address, hostname, supported_versions)) {
- Initialize(address, hostname, true);
+ : client_(new MockableQuicClient(address, server_key, supported_versions)) {
+ Initialize(address, server_key, true);
}
QuicTestClient::QuicTestClient(IPEndPoint address,
- const string& hostname,
+ const QuicSessionKey& server_key,
bool secure,
const QuicVersionVector& supported_versions)
- : client_(new MockableQuicClient(address, hostname, supported_versions)) {
- Initialize(address, hostname, secure);
+ : client_(new MockableQuicClient(address, server_key, supported_versions)) {
+ Initialize(address, server_key, secure);
}
QuicTestClient::QuicTestClient(IPEndPoint address,
- const string& hostname,
+ const QuicSessionKey& server_key,
bool secure,
const QuicConfig& config,
const QuicVersionVector& supported_versions)
- : client_(new MockableQuicClient(
- address, hostname, config, supported_versions)) {
- Initialize(address, hostname, secure);
+ : client_(new MockableQuicClient(address, server_key, config,
+ supported_versions)) {
+ Initialize(address, server_key, secure);
}
void QuicTestClient::Initialize(IPEndPoint address,
- const string& hostname,
+ const QuicSessionKey& server_key,
bool secure) {
server_address_ = address;
+ server_key_ = server_key;
priority_ = 3;
connect_attempted_ = false;
secure_ = secure;
@@ -211,7 +214,9 @@ ssize_t QuicTestClient::SendMessage(const HTTPMessage& message) {
if (!connected()) {
GURL url(message.headers()->request_uri().as_string());
if (!url.host().empty()) {
- client_->set_server_hostname(url.host());
+ client_->set_server_key(
+ QuicSessionKey(url.host(), url.EffectiveIntPort(),
+ url.SchemeIs("https") ? true : false));
}
}
@@ -292,7 +297,7 @@ QuicTagValueMap QuicTestClient::GetServerConfig() const {
net::QuicCryptoClientConfig* config =
QuicClientPeer::GetCryptoConfig(client_.get());
net::QuicCryptoClientConfig::CachedState* state =
- config->LookupOrCreate(client_->server_hostname());
+ config->LookupOrCreate(client_->server_key());
const net::CryptoHandshakeMessage* handshake_msg = state->GetServerConfig();
if (handshake_msg != NULL) {
return handshake_msg->tag_value_map();
« net/quic/quic_session_key.h ('K') | « net/tools/quic/test_tools/quic_test_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698