| 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 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 // Now that we have received an ack, we might be able to send packets which | 1160 // Now that we have received an ack, we might be able to send packets which |
| 1161 // are queued locally, or drain streams which are blocked. | 1161 // are queued locally, or drain streams which are blocked. |
| 1162 if (defer_send_in_response_to_packets_) { | 1162 if (defer_send_in_response_to_packets_) { |
| 1163 send_alarm_->Update(clock_->ApproximateNow(), QuicTime::Delta::Zero()); | 1163 send_alarm_->Update(clock_->ApproximateNow(), QuicTime::Delta::Zero()); |
| 1164 } else { | 1164 } else { |
| 1165 WriteAndBundleAcksIfNotBlocked(); | 1165 WriteAndBundleAcksIfNotBlocked(); |
| 1166 } | 1166 } |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 void QuicConnection::SendVersionNegotiationPacket() { | 1169 void QuicConnection::SendVersionNegotiationPacket() { |
| 1170 // TODO(alyssar): implement zero server state negotiation. | |
| 1171 pending_version_negotiation_packet_ = true; | 1170 pending_version_negotiation_packet_ = true; |
| 1172 if (writer_->IsWriteBlocked()) { | 1171 if (writer_->IsWriteBlocked()) { |
| 1173 visitor_->OnWriteBlocked(); | 1172 visitor_->OnWriteBlocked(); |
| 1174 return; | 1173 return; |
| 1175 } | 1174 } |
| 1176 DVLOG(1) << ENDPOINT << "Sending version negotiation packet: {" | 1175 DVLOG(1) << ENDPOINT << "Sending version negotiation packet: {" |
| 1177 << QuicVersionVectorToString(framer_.supported_versions()) << "}"; | 1176 << QuicVersionVectorToString(framer_.supported_versions()) << "}"; |
| 1178 std::unique_ptr<QuicEncryptedPacket> version_packet( | 1177 std::unique_ptr<QuicEncryptedPacket> version_packet( |
| 1179 packet_generator_.SerializeVersionNegotiationPacket( | 1178 packet_generator_.SerializeVersionNegotiationPacket( |
| 1180 framer_.supported_versions())); | 1179 framer_.supported_versions())); |
| (...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2546 | 2545 |
| 2547 void QuicConnection::CheckIfApplicationLimited() { | 2546 void QuicConnection::CheckIfApplicationLimited() { |
| 2548 if (queued_packets_.empty() && | 2547 if (queued_packets_.empty() && |
| 2549 !sent_packet_manager_->HasPendingRetransmissions() && | 2548 !sent_packet_manager_->HasPendingRetransmissions() && |
| 2550 !visitor_->WillingAndAbleToWrite()) { | 2549 !visitor_->WillingAndAbleToWrite()) { |
| 2551 sent_packet_manager_->OnApplicationLimited(); | 2550 sent_packet_manager_->OnApplicationLimited(); |
| 2552 } | 2551 } |
| 2553 } | 2552 } |
| 2554 | 2553 |
| 2555 } // namespace net | 2554 } // namespace net |
| OLD | NEW |