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 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 return true; | 1737 return true; |
1738 } | 1738 } |
1739 | 1739 |
1740 if (result.status == WRITE_STATUS_ERROR) { | 1740 if (result.status == WRITE_STATUS_ERROR) { |
1741 OnWriteError(result.error_code); | 1741 OnWriteError(result.error_code); |
1742 DLOG(ERROR) << ENDPOINT << "failed writing " << encrypted_length | 1742 DLOG(ERROR) << ENDPOINT << "failed writing " << encrypted_length |
1743 << " bytes " | 1743 << " bytes " |
1744 << " from host " << (self_address().address().empty() | 1744 << " from host " << (self_address().address().empty() |
1745 ? " empty address " | 1745 ? " empty address " |
1746 : self_address().ToStringWithoutPort()) | 1746 : self_address().ToStringWithoutPort()) |
1747 << " to address " << peer_address().ToString(); | 1747 << " to address " << peer_address().ToString() |
| 1748 << " with error code " << result.error_code; |
1748 return false; | 1749 return false; |
1749 } | 1750 } |
1750 | 1751 |
1751 return true; | 1752 return true; |
1752 } | 1753 } |
1753 | 1754 |
1754 bool QuicConnection::ShouldDiscardPacket(const SerializedPacket& packet) { | 1755 bool QuicConnection::ShouldDiscardPacket(const SerializedPacket& packet) { |
1755 if (!connected_) { | 1756 if (!connected_) { |
1756 DVLOG(1) << ENDPOINT << "Not sending packet as connection is disconnected."; | 1757 DVLOG(1) << ENDPOINT << "Not sending packet as connection is disconnected."; |
1757 return true; | 1758 return true; |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2559 | 2560 |
2560 void QuicConnection::CheckIfApplicationLimited() { | 2561 void QuicConnection::CheckIfApplicationLimited() { |
2561 if (queued_packets_.empty() && | 2562 if (queued_packets_.empty() && |
2562 !sent_packet_manager_->HasPendingRetransmissions() && | 2563 !sent_packet_manager_->HasPendingRetransmissions() && |
2563 !visitor_->WillingAndAbleToWrite()) { | 2564 !visitor_->WillingAndAbleToWrite()) { |
2564 sent_packet_manager_->OnApplicationLimited(); | 2565 sent_packet_manager_->OnApplicationLimited(); |
2565 } | 2566 } |
2566 } | 2567 } |
2567 | 2568 |
2568 } // namespace net | 2569 } // namespace net |
OLD | NEW |