| 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 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 // Return true to stop processing. | 1545 // Return true to stop processing. |
| 1546 if (writer_->IsWriteBlocked()) { | 1546 if (writer_->IsWriteBlocked()) { |
| 1547 visitor_->OnWriteBlocked(); | 1547 visitor_->OnWriteBlocked(); |
| 1548 return true; | 1548 return true; |
| 1549 } | 1549 } |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 DCHECK_LE(encrypted_length, kMaxPacketSize); | 1552 DCHECK_LE(encrypted_length, kMaxPacketSize); |
| 1553 DCHECK_LE(encrypted_length, packet_generator_.GetCurrentMaxPacketLength()); | 1553 DCHECK_LE(encrypted_length, packet_generator_.GetCurrentMaxPacketLength()); |
| 1554 DVLOG(1) << ENDPOINT << "Sending packet " << packet_number << " : " | 1554 DVLOG(1) << ENDPOINT << "Sending packet " << packet_number << " : " |
| 1555 << (packet->is_fec_packet | 1555 << (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA |
| 1556 ? "FEC " | 1556 ? "data bearing " |
| 1557 : (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA | 1557 : " ack only ") |
| 1558 ? "data bearing " | |
| 1559 : " ack only ")) | |
| 1560 << ", encryption level: " | 1558 << ", encryption level: " |
| 1561 << QuicUtils::EncryptionLevelToString(packet->encryption_level) | 1559 << QuicUtils::EncryptionLevelToString(packet->encryption_level) |
| 1562 << ", encrypted length:" << encrypted_length; | 1560 << ", encrypted length:" << encrypted_length; |
| 1563 DVLOG(2) << ENDPOINT << "packet(" << packet_number << "): " << std::endl | 1561 DVLOG(2) << ENDPOINT << "packet(" << packet_number << "): " << std::endl |
| 1564 << QuicUtils::StringToHexASCIIDump( | 1562 << QuicUtils::StringToHexASCIIDump( |
| 1565 StringPiece(packet->encrypted_buffer, encrypted_length)); | 1563 StringPiece(packet->encrypted_buffer, encrypted_length)); |
| 1566 | 1564 |
| 1567 // Measure the RTT from before the write begins to avoid underestimating the | 1565 // Measure the RTT from before the write begins to avoid underestimating the |
| 1568 // min_rtt_, especially in cases where the thread blocks or gets swapped out | 1566 // min_rtt_, especially in cases where the thread blocks or gets swapped out |
| 1569 // during the WritePacket below. | 1567 // during the WritePacket below. |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2329 } | 2327 } |
| 2330 | 2328 |
| 2331 StringPiece QuicConnection::GetCurrentPacket() { | 2329 StringPiece QuicConnection::GetCurrentPacket() { |
| 2332 if (current_packet_data_ == nullptr) { | 2330 if (current_packet_data_ == nullptr) { |
| 2333 return StringPiece(); | 2331 return StringPiece(); |
| 2334 } | 2332 } |
| 2335 return StringPiece(current_packet_data_, last_size_); | 2333 return StringPiece(current_packet_data_, last_size_); |
| 2336 } | 2334 } |
| 2337 | 2335 |
| 2338 } // namespace net | 2336 } // namespace net |
| OLD | NEW |