summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_crypto_client_stream.cc
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-04 05:14:40 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-04 05:14:40 +0000
commitdd3fd0eaf977e817ce32c6d12b7edf43a08f8471 (patch)
treef6b74c333beb9f73d979471dc0f11f6c53cf9f3c /net/quic/quic_crypto_client_stream.cc
parent3049477e7bf3d8b043fa8910ecb54506859c559f (diff)
downloadchromium_src-dd3fd0eaf977e817ce32c6d12b7edf43a08f8471.zip
chromium_src-dd3fd0eaf977e817ce32c6d12b7edf43a08f8471.tar.gz
chromium_src-dd3fd0eaf977e817ce32c6d12b7edf43a08f8471.tar.bz2
Adding QuicClientSession and friends
Review URL: https://chromiumcodereview.appspot.com/11363021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165878 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/quic_crypto_client_stream.cc')
-rw-r--r--net/quic/quic_crypto_client_stream.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/net/quic/quic_crypto_client_stream.cc b/net/quic/quic_crypto_client_stream.cc
new file mode 100644
index 0000000..d0ace80
--- /dev/null
+++ b/net/quic/quic_crypto_client_stream.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/quic/quic_crypto_client_stream.h"
+
+#include "net/quic/quic_session.h"
+
+namespace net {
+
+QuicCryptoClientStream::QuicCryptoClientStream(QuicSession* session)
+ : QuicCryptoStream(session) {
+}
+
+
+void QuicCryptoClientStream::OnHandshakeMessage(
+ const CryptoHandshakeMessage& message) {
+ // Do not process handshake messages after the handshake is complete.
+ if (handshake_complete()) {
+ CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE);
+ return;
+ }
+
+ if (message.tag != kSHLO) {
+ CloseConnection(QUIC_INVALID_CRYPTO_MESSAGE_TYPE);
+ return;
+ }
+
+ // TODO(rch): correctly validate the message
+ set_handshake_complete(true);
+ return;
+}
+
+} // namespace net