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/core/quic_connection.h" | 5 #include "net/quic/core/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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 << last_header_.public_header.connection_id; | 987 << last_header_.public_header.connection_id; |
988 | 988 |
989 // An ack will be sent if a missing retransmittable packet was received; | 989 // An ack will be sent if a missing retransmittable packet was received; |
990 const bool was_missing = | 990 const bool was_missing = |
991 should_last_packet_instigate_acks_ && | 991 should_last_packet_instigate_acks_ && |
992 received_packet_manager_.IsMissing(last_header_.packet_number); | 992 received_packet_manager_.IsMissing(last_header_.packet_number); |
993 | 993 |
994 // Record received to populate ack info correctly before processing stream | 994 // Record received to populate ack info correctly before processing stream |
995 // frames, since the processing may result in a response packet with a bundled | 995 // frames, since the processing may result in a response packet with a bundled |
996 // ack. | 996 // ack. |
997 received_packet_manager_.RecordPacketReceived(last_size_, last_header_, | 997 received_packet_manager_.RecordPacketReceived(last_header_, |
998 time_of_last_received_packet_); | 998 time_of_last_received_packet_); |
999 | 999 |
1000 // Process stop waiting frames here, instead of inline, because the packet | 1000 // Process stop waiting frames here, instead of inline, because the packet |
1001 // needs to be considered 'received' before the entropy can be updated. | 1001 // needs to be considered 'received' before the entropy can be updated. |
1002 if (last_stop_waiting_frame_.least_unacked > 0) { | 1002 if (last_stop_waiting_frame_.least_unacked > 0) { |
1003 ProcessStopWaitingFrame(last_stop_waiting_frame_); | 1003 ProcessStopWaitingFrame(last_stop_waiting_frame_); |
1004 if (!connected_) { | 1004 if (!connected_) { |
1005 return; | 1005 return; |
1006 } | 1006 } |
1007 } | 1007 } |
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 | 2558 |
2559 void QuicConnection::CheckIfApplicationLimited() { | 2559 void QuicConnection::CheckIfApplicationLimited() { |
2560 if (queued_packets_.empty() && | 2560 if (queued_packets_.empty() && |
2561 !sent_packet_manager_->HasPendingRetransmissions() && | 2561 !sent_packet_manager_->HasPendingRetransmissions() && |
2562 !visitor_->WillingAndAbleToWrite()) { | 2562 !visitor_->WillingAndAbleToWrite()) { |
2563 sent_packet_manager_->OnApplicationLimited(); | 2563 sent_packet_manager_->OnApplicationLimited(); |
2564 } | 2564 } |
2565 } | 2565 } |
2566 | 2566 |
2567 } // namespace net | 2567 } // namespace net |
OLD | NEW |