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

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: Created 8 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 unified diff | Download patch | Annotate | Revision Log
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 "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 ActivateStream(stream); 47 ActivateStream(stream);
48 return stream; 48 return stream;
49 } 49 }
50 50
51 QuicCryptoClientStream* QuicClientSession::GetCryptoStream() { 51 QuicCryptoClientStream* QuicClientSession::GetCryptoStream() {
52 return &crypto_stream_; 52 return &crypto_stream_;
53 }; 53 };
54 54
55 int QuicClientSession::CryptoConnect(const CompletionCallback& callback) { 55 int QuicClientSession::CryptoConnect(const CompletionCallback& callback) {
56 CryptoHandshakeMessage message; 56 if (!crypto_stream_.CryptoConnect()) {
57 message.tag = kCHLO; 57 return ERR_FAILED; // TODO(wtc): use a better error code.
58 crypto_stream_.SendHandshakeMessage(message); 58 }
wtc 2012/12/20 00:33:08 Do you think |callback| should be passed along to
Ryan Hamilton 2012/12/20 18:51:06 Can we avoid doing so? The internal code does not
59 59
60 if (IsCryptoHandshakeComplete()) { 60 if (IsCryptoHandshakeComplete()) {
61 return OK; 61 return OK;
62 } 62 }
63 63
64 callback_ = callback; 64 callback_ = callback;
65 return ERR_IO_PENDING; 65 return ERR_IO_PENDING;
66 } 66 }
67 67
68 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream( 68 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream(
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 connection()->ProcessUdpPacket(local_address, peer_address, packet); 130 connection()->ProcessUdpPacket(local_address, peer_address, packet);
131 if (!connection()->connected()) { 131 if (!connection()->connected()) {
132 stream_factory_->OnSessionClose(this); 132 stream_factory_->OnSessionClose(this);
133 return; 133 return;
134 } 134 }
135 StartReading(); 135 StartReading();
136 } 136 }
137 } 137 }
138 138
139 } // namespace net 139 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698