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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 } | 1109 } |
1110 | 1110 |
1111 pending_version_negotiation_packet_ = false; | 1111 pending_version_negotiation_packet_ = false; |
1112 } | 1112 } |
1113 | 1113 |
1114 QuicConsumedData QuicConnection::SendStreamData( | 1114 QuicConsumedData QuicConnection::SendStreamData( |
1115 QuicStreamId id, | 1115 QuicStreamId id, |
1116 QuicIOVector iov, | 1116 QuicIOVector iov, |
1117 QuicStreamOffset offset, | 1117 QuicStreamOffset offset, |
1118 bool fin, | 1118 bool fin, |
1119 QuicAckListenerInterface* listener) { | 1119 const scoped_refptr<QuicAckListenerInterface>& listener) { |
1120 if (!fin && iov.total_length == 0) { | 1120 if (!fin && iov.total_length == 0) { |
1121 QUIC_BUG << "Attempt to send empty stream frame"; | 1121 QUIC_BUG << "Attempt to send empty stream frame"; |
1122 return QuicConsumedData(0, false); | 1122 return QuicConsumedData(0, false); |
1123 } | 1123 } |
1124 | 1124 |
1125 // Opportunistically bundle an ack with every outgoing packet. | 1125 // Opportunistically bundle an ack with every outgoing packet. |
1126 // Particularly, we want to bundle with handshake packets since we don't know | 1126 // Particularly, we want to bundle with handshake packets since we don't know |
1127 // which decrypter will be used on an ack packet following a handshake | 1127 // which decrypter will be used on an ack packet following a handshake |
1128 // packet (a handshake packet from client to server could result in a REJ or a | 1128 // packet (a handshake packet from client to server could result in a REJ or a |
1129 // SHLO from the server, leading to two different decrypters at the server.) | 1129 // SHLO from the server, leading to two different decrypters at the server.) |
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2458 | 2458 |
2459 void QuicConnection::CheckIfApplicationLimited() { | 2459 void QuicConnection::CheckIfApplicationLimited() { |
2460 if (queued_packets_.empty() && | 2460 if (queued_packets_.empty() && |
2461 !sent_packet_manager_->HasPendingRetransmissions() && | 2461 !sent_packet_manager_->HasPendingRetransmissions() && |
2462 !visitor_->WillingAndAbleToWrite()) { | 2462 !visitor_->WillingAndAbleToWrite()) { |
2463 sent_packet_manager_->OnApplicationLimited(); | 2463 sent_packet_manager_->OnApplicationLimited(); |
2464 } | 2464 } |
2465 } | 2465 } |
2466 | 2466 |
2467 } // namespace net | 2467 } // namespace net |
OLD | NEW |