OLD | NEW |
---|---|
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 Loading... | |
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 // TODO(wtc): map to a net error code. |
Ryan Hamilton
2012/12/22 22:31:32
Not sure about this comment. Isn't ERR_CONNECTION
| |
58 crypto_stream_.SendHandshakeMessage(message); | 58 return ERR_CONNECTION_FAILED; |
59 } | |
59 | 60 |
60 if (IsCryptoHandshakeComplete()) { | 61 if (IsCryptoHandshakeComplete()) { |
61 return OK; | 62 return OK; |
62 } | 63 } |
63 | 64 |
64 callback_ = callback; | 65 callback_ = callback; |
65 return ERR_IO_PENDING; | 66 return ERR_IO_PENDING; |
66 } | 67 } |
67 | 68 |
68 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream( | 69 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream( |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 connection()->ProcessUdpPacket(local_address, peer_address, packet); | 131 connection()->ProcessUdpPacket(local_address, peer_address, packet); |
131 if (!connection()->connected()) { | 132 if (!connection()->connected()) { |
132 stream_factory_->OnSessionClose(this); | 133 stream_factory_->OnSessionClose(this); |
133 return; | 134 return; |
134 } | 135 } |
135 StartReading(); | 136 StartReading(); |
136 } | 137 } |
137 } | 138 } |
138 | 139 |
139 } // namespace net | 140 } // namespace net |
OLD | NEW |