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

Side by Side Diff: net/quic/quic_client_session.cc

Issue 11633030: Send the ClientHello handshake message. Fix a bug in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove an extraneous test:: before TestCryptoVisitor Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_client_session.h ('k') | net/quic/quic_client_session_test.cc » ('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 #include "net/quic/quic_client_session.h" 5 #include "net/quic/quic_client_session.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 new QuicReliableClientStream(GetNextStreamId(), this); 45 new QuicReliableClientStream(GetNextStreamId(), this);
46 ActivateStream(stream); 46 ActivateStream(stream);
47 return stream; 47 return stream;
48 } 48 }
49 49
50 QuicCryptoClientStream* QuicClientSession::GetCryptoStream() { 50 QuicCryptoClientStream* QuicClientSession::GetCryptoStream() {
51 return &crypto_stream_; 51 return &crypto_stream_;
52 }; 52 };
53 53
54 int QuicClientSession::CryptoConnect(const CompletionCallback& callback) { 54 int QuicClientSession::CryptoConnect(const CompletionCallback& callback) {
55 CryptoHandshakeMessage message; 55 if (!crypto_stream_.CryptoConnect()) {
56 message.tag = kCHLO; 56 // TODO(wtc): change crypto_stream_.CryptoConnect() to return a
57 crypto_stream_.SendHandshakeMessage(message); 57 // QuicErrorCode and map it to a net error code.
58 return ERR_CONNECTION_FAILED;
59 }
58 60
59 if (IsCryptoHandshakeComplete()) { 61 if (IsCryptoHandshakeComplete()) {
60 return OK; 62 return OK;
61 } 63 }
62 64
63 callback_ = callback; 65 callback_ = callback;
64 return ERR_IO_PENDING; 66 return ERR_IO_PENDING;
65 } 67 }
66 68
67 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream( 69 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream(
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 connection()->ProcessUdpPacket(local_address, peer_address, packet); 142 connection()->ProcessUdpPacket(local_address, peer_address, packet);
141 if (!connection()->connected()) { 143 if (!connection()->connected()) {
142 stream_factory_->OnSessionClose(this); 144 stream_factory_->OnSessionClose(this);
143 return; 145 return;
144 } 146 }
145 StartReading(); 147 StartReading();
146 } 148 }
147 } 149 }
148 150
149 } // namespace net 151 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_client_session.h ('k') | net/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698