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 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1758 return true; | 1758 return true; |
1759 } | 1759 } |
1760 | 1760 |
1761 if (result.status == WRITE_STATUS_ERROR) { | 1761 if (result.status == WRITE_STATUS_ERROR) { |
1762 OnWriteError(result.error_code); | 1762 OnWriteError(result.error_code); |
1763 DLOG(ERROR) << ENDPOINT << "failed writing " << encrypted_length | 1763 DLOG(ERROR) << ENDPOINT << "failed writing " << encrypted_length |
1764 << " bytes " | 1764 << " bytes " |
1765 << " from host " << (self_address().address().empty() | 1765 << " from host " << (self_address().address().empty() |
1766 ? " empty address " | 1766 ? " empty address " |
1767 : self_address().ToStringWithoutPort()) | 1767 : self_address().ToStringWithoutPort()) |
1768 << " to address " << peer_address().ToString(); | 1768 << " to address " << peer_address().ToString() |
| 1769 << " with error code " << result.error_code; |
1769 return false; | 1770 return false; |
1770 } | 1771 } |
1771 | 1772 |
1772 return true; | 1773 return true; |
1773 } | 1774 } |
1774 | 1775 |
1775 bool QuicConnection::ShouldDiscardPacket(const SerializedPacket& packet) { | 1776 bool QuicConnection::ShouldDiscardPacket(const SerializedPacket& packet) { |
1776 if (!connected_) { | 1777 if (!connected_) { |
1777 DVLOG(1) << ENDPOINT << "Not sending packet as connection is disconnected."; | 1778 DVLOG(1) << ENDPOINT << "Not sending packet as connection is disconnected."; |
1778 return true; | 1779 return true; |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2580 | 2581 |
2581 void QuicConnection::CheckIfApplicationLimited() { | 2582 void QuicConnection::CheckIfApplicationLimited() { |
2582 if (queued_packets_.empty() && | 2583 if (queued_packets_.empty() && |
2583 !sent_packet_manager_->HasPendingRetransmissions() && | 2584 !sent_packet_manager_->HasPendingRetransmissions() && |
2584 !visitor_->WillingAndAbleToWrite()) { | 2585 !visitor_->WillingAndAbleToWrite()) { |
2585 sent_packet_manager_->OnApplicationLimited(); | 2586 sent_packet_manager_->OnApplicationLimited(); |
2586 } | 2587 } |
2587 } | 2588 } |
2588 | 2589 |
2589 } // namespace net | 2590 } // namespace net |
OLD | NEW |