| 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_connection.h" | 5 #include "net/quic/quic_connection.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 // processing stream frames, since the processing may result in a response | 955 // processing stream frames, since the processing may result in a response |
| 956 // packet with a bundled ack. | 956 // packet with a bundled ack. |
| 957 if (last_packet_revived_) { | 957 if (last_packet_revived_) { |
| 958 received_packet_manager_.RecordPacketRevived( | 958 received_packet_manager_.RecordPacketRevived( |
| 959 last_header_.packet_sequence_number); | 959 last_header_.packet_sequence_number); |
| 960 } else { | 960 } else { |
| 961 received_packet_manager_.RecordPacketReceived( | 961 received_packet_manager_.RecordPacketReceived( |
| 962 last_size_, last_header_, time_of_last_received_packet_); | 962 last_size_, last_header_, time_of_last_received_packet_); |
| 963 } | 963 } |
| 964 | 964 |
| 965 if (!last_stream_frames_.empty()) { | 965 for (const QuicStreamFrame& frame : last_stream_frames_) { |
| 966 visitor_->OnStreamFrames(last_stream_frames_); | 966 visitor_->OnStreamFrame(frame); |
| 967 stats_.stream_bytes_received += frame.data.size(); |
| 967 if (!connected_) { | 968 if (!connected_) { |
| 968 return; | 969 return; |
| 969 } | 970 } |
| 970 } | 971 } |
| 971 | 972 |
| 972 for (const QuicStreamFrame& stream_frame : last_stream_frames_) { | |
| 973 stats_.stream_bytes_received += stream_frame.data.size(); | |
| 974 } | |
| 975 // Process window updates, blocked, stream resets, acks, then congestion | 973 // Process window updates, blocked, stream resets, acks, then congestion |
| 976 // feedback. | 974 // feedback. |
| 977 if (!last_window_update_frames_.empty()) { | 975 for (const QuicWindowUpdateFrame& frame : last_window_update_frames_) { |
| 978 visitor_->OnWindowUpdateFrames(last_window_update_frames_); | 976 visitor_->OnWindowUpdateFrame(frame); |
| 979 if (!connected_) { | 977 if (!connected_) { |
| 980 return; | 978 return; |
| 981 } | 979 } |
| 982 } | 980 } |
| 983 if (!last_blocked_frames_.empty()) { | 981 for (const QuicBlockedFrame& frame : last_blocked_frames_) { |
| 984 visitor_->OnBlockedFrames(last_blocked_frames_); | 982 visitor_->OnBlockedFrame(frame); |
| 985 if (!connected_) { | 983 if (!connected_) { |
| 986 return; | 984 return; |
| 987 } | 985 } |
| 988 } | 986 } |
| 989 for (size_t i = 0; i < last_goaway_frames_.size(); ++i) { | 987 for (const QuicGoAwayFrame& frame : last_goaway_frames_) { |
| 990 visitor_->OnGoAway(last_goaway_frames_[i]); | 988 visitor_->OnGoAway(frame); |
| 991 if (!connected_) { | 989 if (!connected_) { |
| 992 return; | 990 return; |
| 993 } | 991 } |
| 994 } | 992 } |
| 995 for (size_t i = 0; i < last_rst_frames_.size(); ++i) { | 993 for (const QuicRstStreamFrame& frame : last_rst_frames_) { |
| 996 visitor_->OnRstStream(last_rst_frames_[i]); | 994 visitor_->OnRstStream(frame); |
| 997 if (!connected_) { | 995 if (!connected_) { |
| 998 return; | 996 return; |
| 999 } | 997 } |
| 1000 } | 998 } |
| 1001 for (size_t i = 0; i < last_ack_frames_.size(); ++i) { | 999 for (const QuicAckFrame& frame : last_ack_frames_) { |
| 1002 ProcessAckFrame(last_ack_frames_[i]); | 1000 ProcessAckFrame(frame); |
| 1003 if (!connected_) { | 1001 if (!connected_) { |
| 1004 return; | 1002 return; |
| 1005 } | 1003 } |
| 1006 } | 1004 } |
| 1007 for (size_t i = 0; i < last_stop_waiting_frames_.size(); ++i) { | 1005 for (const QuicStopWaitingFrame& frame : last_stop_waiting_frames_) { |
| 1008 ProcessStopWaitingFrame(last_stop_waiting_frames_[i]); | 1006 ProcessStopWaitingFrame(frame); |
| 1009 if (!connected_) { | 1007 if (!connected_) { |
| 1010 return; | 1008 return; |
| 1011 } | 1009 } |
| 1012 } | 1010 } |
| 1013 if (!last_close_frames_.empty()) { | 1011 if (!last_close_frames_.empty()) { |
| 1014 CloseConnection(last_close_frames_[0].error_code, true); | 1012 CloseConnection(last_close_frames_[0].error_code, true); |
| 1015 DCHECK(!connected_); | 1013 DCHECK(!connected_); |
| 1016 return; | 1014 return; |
| 1017 } | 1015 } |
| 1018 | 1016 |
| (...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2320 sequence_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; | 2318 sequence_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; |
| 2321 ++mtu_probe_count_; | 2319 ++mtu_probe_count_; |
| 2322 | 2320 |
| 2323 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; | 2321 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; |
| 2324 SendMtuDiscoveryPacket(mtu_discovery_target_); | 2322 SendMtuDiscoveryPacket(mtu_discovery_target_); |
| 2325 | 2323 |
| 2326 DCHECK(!mtu_discovery_alarm_->IsSet()); | 2324 DCHECK(!mtu_discovery_alarm_->IsSet()); |
| 2327 } | 2325 } |
| 2328 | 2326 |
| 2329 } // namespace net | 2327 } // namespace net |
| OLD | NEW |