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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2048 stream->IncrementRawReceivedBytes(header_len); | 2048 stream->IncrementRawReceivedBytes(header_len); |
2049 } | 2049 } |
2050 | 2050 |
2051 void SpdySession::OnStreamFrameData(SpdyStreamId stream_id, | 2051 void SpdySession::OnStreamFrameData(SpdyStreamId stream_id, |
2052 const char* data, | 2052 const char* data, |
2053 size_t len, | 2053 size_t len, |
2054 bool fin) { | 2054 bool fin) { |
2055 CHECK(in_io_loop_); | 2055 CHECK(in_io_loop_); |
2056 | 2056 |
2057 if (data == NULL && len != 0) { | 2057 if (data == NULL && len != 0) { |
2058 // This is notification of consumed data padding. | 2058 if (flow_control_state_ != FLOW_CONTROL_STREAM_AND_SESSION) |
2059 // TODO(jgraettinger): Properly flow padding into WINDOW_UPDATE frames. | 2059 return; |
2060 // See crbug.com/353012. | 2060 |
| 2061 // Decrease window size because padding bytes are received. |
| 2062 // Increase window size because padding bytes are consumed (by discarding). |
| 2063 // Net result: |session_unacked_recv_window_bytes_| increases by |len|, |
| 2064 // |session_recv_window_size_| does not change. |
| 2065 DecreaseRecvWindowSize(static_cast<int32>(len)); |
| 2066 IncreaseRecvWindowSize(static_cast<int32>(len)); |
| 2067 |
| 2068 ActiveStreamMap::iterator it = active_streams_.find(stream_id); |
| 2069 if (it == active_streams_.end()) |
| 2070 return; |
| 2071 it->second.stream->OnPaddingConsumed(len); |
2061 return; | 2072 return; |
2062 } | 2073 } |
2063 | 2074 |
2064 DCHECK_LT(len, 1u << 24); | 2075 DCHECK_LT(len, 1u << 24); |
2065 if (net_log().IsLogging()) { | 2076 if (net_log().IsLogging()) { |
2066 net_log().AddEvent( | 2077 net_log().AddEvent( |
2067 NetLog::TYPE_SPDY_SESSION_RECV_DATA, | 2078 NetLog::TYPE_SPDY_SESSION_RECV_DATA, |
2068 base::Bind(&NetLogSpdyDataCallback, stream_id, len, fin)); | 2079 base::Bind(&NetLogSpdyDataCallback, stream_id, len, fin)); |
2069 } | 2080 } |
2070 | 2081 |
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3285 if (!queue->empty()) { | 3296 if (!queue->empty()) { |
3286 SpdyStreamId stream_id = queue->front(); | 3297 SpdyStreamId stream_id = queue->front(); |
3287 queue->pop_front(); | 3298 queue->pop_front(); |
3288 return stream_id; | 3299 return stream_id; |
3289 } | 3300 } |
3290 } | 3301 } |
3291 return 0; | 3302 return 0; |
3292 } | 3303 } |
3293 | 3304 |
3294 } // namespace net | 3305 } // namespace net |
OLD | NEW |