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/quic_connection.h" | 5 #include "net/quic/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 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 | 1536 |
1537 stats_.bytes_sent += result.bytes_written; | 1537 stats_.bytes_sent += result.bytes_written; |
1538 ++stats_.packets_sent; | 1538 ++stats_.packets_sent; |
1539 if (packet->transmission_type != NOT_RETRANSMISSION) { | 1539 if (packet->transmission_type != NOT_RETRANSMISSION) { |
1540 stats_.bytes_retransmitted += result.bytes_written; | 1540 stats_.bytes_retransmitted += result.bytes_written; |
1541 ++stats_.packets_retransmitted; | 1541 ++stats_.packets_retransmitted; |
1542 } | 1542 } |
1543 | 1543 |
1544 if (result.status == WRITE_STATUS_ERROR) { | 1544 if (result.status == WRITE_STATUS_ERROR) { |
1545 OnWriteError(result.error_code); | 1545 OnWriteError(result.error_code); |
| 1546 DLOG(ERROR) << ENDPOINT << "failed writing " << encrypted->length() |
| 1547 << "bytes " |
| 1548 << " from host " << self_address().ToStringWithoutPort() |
| 1549 << " to address " << peer_address().ToString(); |
1546 return false; | 1550 return false; |
1547 } | 1551 } |
1548 | 1552 |
1549 return true; | 1553 return true; |
1550 } | 1554 } |
1551 | 1555 |
1552 bool QuicConnection::ShouldDiscardPacket(const QueuedPacket& packet) { | 1556 bool QuicConnection::ShouldDiscardPacket(const QueuedPacket& packet) { |
1553 if (!connected_) { | 1557 if (!connected_) { |
1554 DVLOG(1) << ENDPOINT | 1558 DVLOG(1) << ENDPOINT |
1555 << "Not sending packet as connection is disconnected."; | 1559 << "Not sending packet as connection is disconnected."; |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2113 } | 2117 } |
2114 for (const QuicFrame& frame : retransmittable_frames->frames()) { | 2118 for (const QuicFrame& frame : retransmittable_frames->frames()) { |
2115 if (frame.type == CONNECTION_CLOSE_FRAME) { | 2119 if (frame.type == CONNECTION_CLOSE_FRAME) { |
2116 return true; | 2120 return true; |
2117 } | 2121 } |
2118 } | 2122 } |
2119 return false; | 2123 return false; |
2120 } | 2124 } |
2121 | 2125 |
2122 } // namespace net | 2126 } // namespace net |
OLD | NEW |