| 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/flip_server/spdy_interface.h" | 5 #include "net/tools/flip_server/spdy_interface.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "net/spdy/spdy_framer.h" | 10 #include "net/spdy/spdy_framer.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 const SpdyFrame* frame; | 34 const SpdyFrame* frame; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 SpdySM::SpdySM(SMConnection* connection, | 37 SpdySM::SpdySM(SMConnection* connection, |
| 38 SMInterface* sm_http_interface, | 38 SMInterface* sm_http_interface, |
| 39 EpollServer* epoll_server, | 39 EpollServer* epoll_server, |
| 40 MemoryCache* memory_cache, | 40 MemoryCache* memory_cache, |
| 41 FlipAcceptor* acceptor) | 41 FlipAcceptor* acceptor) |
| 42 : buffered_spdy_framer_(new BufferedSpdyFramer(2)), | 42 : buffered_spdy_framer_(new BufferedSpdyFramer(2, true)), |
| 43 valid_spdy_session_(false), | 43 valid_spdy_session_(false), |
| 44 connection_(connection), | 44 connection_(connection), |
| 45 client_output_list_(connection->output_list()), | 45 client_output_list_(connection->output_list()), |
| 46 client_output_ordering_(connection), | 46 client_output_ordering_(connection), |
| 47 next_outgoing_stream_id_(2), | 47 next_outgoing_stream_id_(2), |
| 48 epoll_server_(epoll_server), | 48 epoll_server_(epoll_server), |
| 49 acceptor_(acceptor), | 49 acceptor_(acceptor), |
| 50 memory_cache_(memory_cache), | 50 memory_cache_(memory_cache), |
| 51 close_on_error_(false) { | 51 close_on_error_(false) { |
| 52 buffered_spdy_framer_->set_visitor(this); | 52 buffered_spdy_framer_->set_visitor(this); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 284 |
| 285 void SpdySM::ResetForNewInterface(int32 server_idx) { | 285 void SpdySM::ResetForNewInterface(int32 server_idx) { |
| 286 VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: Reset for new interface: " | 286 VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: Reset for new interface: " |
| 287 << "server_idx: " << server_idx; | 287 << "server_idx: " << server_idx; |
| 288 unused_server_interface_list.push_back(server_idx); | 288 unused_server_interface_list.push_back(server_idx); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void SpdySM::ResetForNewConnection() { | 291 void SpdySM::ResetForNewConnection() { |
| 292 // seq_num is not cleared, intentionally. | 292 // seq_num is not cleared, intentionally. |
| 293 delete buffered_spdy_framer_; | 293 delete buffered_spdy_framer_; |
| 294 buffered_spdy_framer_ = new BufferedSpdyFramer(2); | 294 buffered_spdy_framer_ = new BufferedSpdyFramer(2, true); |
| 295 buffered_spdy_framer_->set_visitor(this); | 295 buffered_spdy_framer_->set_visitor(this); |
| 296 valid_spdy_session_ = false; | 296 valid_spdy_session_ = false; |
| 297 client_output_ordering_.Reset(); | 297 client_output_ordering_.Reset(); |
| 298 next_outgoing_stream_id_ = 2; | 298 next_outgoing_stream_id_ = 2; |
| 299 } | 299 } |
| 300 | 300 |
| 301 // Send a settings frame | 301 // Send a settings frame |
| 302 int SpdySM::PostAcceptHook() { | 302 int SpdySM::PostAcceptHook() { |
| 303 SettingsMap settings; | 303 SettingsMap settings; |
| 304 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | 304 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 mci->file_data->body.data() + mci->body_bytes_consumed, | 554 mci->file_data->body.data() + mci->body_bytes_consumed, |
| 555 num_to_write, 0, should_compress); | 555 num_to_write, 0, should_compress); |
| 556 VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: GetOutput SendDataFrame[" | 556 VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: GetOutput SendDataFrame[" |
| 557 << mci->stream_id << "]: " << num_to_write; | 557 << mci->stream_id << "]: " << num_to_write; |
| 558 mci->body_bytes_consumed += num_to_write; | 558 mci->body_bytes_consumed += num_to_write; |
| 559 mci->bytes_sent += num_to_write; | 559 mci->bytes_sent += num_to_write; |
| 560 } | 560 } |
| 561 } | 561 } |
| 562 | 562 |
| 563 } // namespace net | 563 } // namespace net |
| OLD | NEW |