| 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/tools/quic/quic_client_session.h" | 5 #include "net/tools/quic/quic_client_session.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/quic/crypto/crypto_protocol.h" | 8 #include "net/quic/crypto/crypto_protocol.h" |
| 9 #include "net/tools/quic/quic_reliable_client_stream.h" | 9 #include "net/tools/quic/quic_reliable_client_stream.h" |
| 10 #include "net/tools/quic/quic_spdy_client_stream.h" | 10 #include "net/tools/quic/quic_spdy_client_stream.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 QuicCryptoClientConfig* crypto_config) | 21 QuicCryptoClientConfig* crypto_config) |
| 22 : QuicSession(connection, config, false), | 22 : QuicSession(connection, config, false), |
| 23 crypto_stream_(server_hostname, this, crypto_config) { | 23 crypto_stream_(server_hostname, this, crypto_config) { |
| 24 } | 24 } |
| 25 | 25 |
| 26 QuicClientSession::~QuicClientSession() { | 26 QuicClientSession::~QuicClientSession() { |
| 27 } | 27 } |
| 28 | 28 |
| 29 QuicReliableClientStream* QuicClientSession::CreateOutgoingReliableStream() { | 29 QuicReliableClientStream* QuicClientSession::CreateOutgoingReliableStream() { |
| 30 if (!crypto_stream_.encryption_established()) { | 30 if (!crypto_stream_.encryption_established()) { |
| 31 DLOG(INFO) << "Encryption not active so no outgoing stream created."; | 31 DVLOG(0) << "Encryption not active so no outgoing stream created."; |
| 32 return NULL; | 32 return NULL; |
| 33 } | 33 } |
| 34 if (GetNumOpenStreams() >= get_max_open_streams()) { | 34 if (GetNumOpenStreams() >= get_max_open_streams()) { |
| 35 DLOG(INFO) << "Failed to create a new outgoing stream. " | 35 DVLOG(0) << "Failed to create a new outgoing stream. " |
| 36 << "Already " << GetNumOpenStreams() << " open."; | 36 << "Already " << GetNumOpenStreams() << " open."; |
| 37 return NULL; | 37 return NULL; |
| 38 } | 38 } |
| 39 if (goaway_received()) { | 39 if (goaway_received()) { |
| 40 DLOG(INFO) << "Failed to create a new outgoing stream. " | 40 DVLOG(0) << "Failed to create a new outgoing stream. " |
| 41 << "Already received goaway."; | 41 << "Already received goaway."; |
| 42 return NULL; | 42 return NULL; |
| 43 } | 43 } |
| 44 QuicReliableClientStream* stream | 44 QuicReliableClientStream* stream |
| 45 = new QuicSpdyClientStream(GetNextStreamId(), this); | 45 = new QuicSpdyClientStream(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 bool QuicClientSession::CryptoConnect() { | 54 bool QuicClientSession::CryptoConnect() { |
| 55 return crypto_stream_.CryptoConnect(); | 55 return crypto_stream_.CryptoConnect(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 int QuicClientSession::GetNumSentClientHellos() const { | 58 int QuicClientSession::GetNumSentClientHellos() const { |
| 59 return crypto_stream_.num_sent_client_hellos(); | 59 return crypto_stream_.num_sent_client_hellos(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream( | 62 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream( |
| 63 QuicStreamId id) { | 63 QuicStreamId id) { |
| 64 DLOG(ERROR) << "Server push not supported"; | 64 DLOG(ERROR) << "Server push not supported"; |
| 65 return NULL; | 65 return NULL; |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace tools | 68 } // namespace tools |
| 69 } // namespace net | 69 } // namespace net |
| OLD | NEW |