OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/flip/flip_session.h" | 5 #include "net/flip/flip_session.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 read_buffer_(new IOBuffer(kReadBufferSize)), | 151 read_buffer_(new IOBuffer(kReadBufferSize)), |
152 read_pending_(false), | 152 read_pending_(false), |
153 stream_hi_water_mark_(1), // Always start at 1 for the first stream id. | 153 stream_hi_water_mark_(1), // Always start at 1 for the first stream id. |
154 delayed_write_pending_(false), | 154 delayed_write_pending_(false), |
155 write_pending_(false) { | 155 write_pending_(false) { |
156 // TODO(mbelshe): consider randomization of the stream_hi_water_mark. | 156 // TODO(mbelshe): consider randomization of the stream_hi_water_mark. |
157 | 157 |
158 flip_framer_.set_visitor(this); | 158 flip_framer_.set_visitor(this); |
159 | 159 |
160 session_->ssl_config_service()->GetSSLConfig(&ssl_config_); | 160 session_->ssl_config_service()->GetSSLConfig(&ssl_config_); |
161 | |
162 // In the event that the server supports Next Protocol Negotiation, but | |
163 // doesn't support either of these protocols, we'll request the first | |
164 // protocol in the list. Because of that, HTTP is listed first because it's | |
165 // what we'll actually fallback to in the case that the server doesn't | |
166 // support SPDY. | |
167 ssl_config_.next_protos = "\007http1.1\004spdy"; | |
willchan no longer on Chromium
2009/11/25 19:48:13
I don't think this code makes sense here. We will
agl
2009/11/30 20:24:53
It doesn't make sense here, it's only a placeholde
| |
161 } | 168 } |
162 | 169 |
163 FlipSession::~FlipSession() { | 170 FlipSession::~FlipSession() { |
164 // Cleanup all the streams. | 171 // Cleanup all the streams. |
165 CloseAllStreams(net::ERR_ABORTED); | 172 CloseAllStreams(net::ERR_ABORTED); |
166 | 173 |
167 if (connection_.is_initialized()) { | 174 if (connection_.is_initialized()) { |
168 // With Flip we can't recycle sockets. | 175 // With Flip we can't recycle sockets. |
169 connection_.socket()->Disconnect(); | 176 connection_.socket()->Disconnect(); |
170 } | 177 } |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
853 LOG(ERROR) << "Flip stream closed: " << frame->status(); | 860 LOG(ERROR) << "Flip stream closed: " << frame->status(); |
854 // TODO(mbelshe): Map from Flip-protocol errors to something sensical. | 861 // TODO(mbelshe): Map from Flip-protocol errors to something sensical. |
855 // For now, it doesn't matter much - it is a protocol error. | 862 // For now, it doesn't matter much - it is a protocol error. |
856 stream->OnClose(ERR_FAILED); | 863 stream->OnClose(ERR_FAILED); |
857 } | 864 } |
858 | 865 |
859 DeactivateStream(stream_id); | 866 DeactivateStream(stream_id); |
860 } | 867 } |
861 | 868 |
862 } // namespace net | 869 } // namespace net |
OLD | NEW |