| 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 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); | 1976 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); |
| 1977 packet_generator_.AddControlFrame( | 1977 packet_generator_.AddControlFrame( |
| 1978 QuicFrame(new QuicGoAwayFrame(error, last_good_stream_id, reason))); | 1978 QuicFrame(new QuicGoAwayFrame(error, last_good_stream_id, reason))); |
| 1979 } | 1979 } |
| 1980 | 1980 |
| 1981 QuicByteCount QuicConnection::max_packet_length() const { | 1981 QuicByteCount QuicConnection::max_packet_length() const { |
| 1982 return packet_generator_.GetMaxPacketLength(); | 1982 return packet_generator_.GetMaxPacketLength(); |
| 1983 } | 1983 } |
| 1984 | 1984 |
| 1985 void QuicConnection::SetMaxPacketLength(QuicByteCount length) { | 1985 void QuicConnection::SetMaxPacketLength(QuicByteCount length) { |
| 1986 return packet_generator_.SetMaxPacketLength(LimitMaxPacketSize(length), | 1986 return packet_generator_.SetMaxPacketLength(LimitMaxPacketSize(length)); |
| 1987 /*force=*/false); | |
| 1988 } | 1987 } |
| 1989 | 1988 |
| 1990 bool QuicConnection::HasQueuedData() const { | 1989 bool QuicConnection::HasQueuedData() const { |
| 1991 return pending_version_negotiation_packet_ || !queued_packets_.empty() || | 1990 return pending_version_negotiation_packet_ || !queued_packets_.empty() || |
| 1992 packet_generator_.HasQueuedFrames(); | 1991 packet_generator_.HasQueuedFrames(); |
| 1993 } | 1992 } |
| 1994 | 1993 |
| 1995 void QuicConnection::EnableSavingCryptoPackets() { | 1994 void QuicConnection::EnableSavingCryptoPackets() { |
| 1996 save_crypto_packets_as_termination_packets_ = true; | 1995 save_crypto_packets_as_termination_packets_ = true; |
| 1997 } | 1996 } |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2345 } | 2344 } |
| 2346 | 2345 |
| 2347 StringPiece QuicConnection::GetCurrentPacket() { | 2346 StringPiece QuicConnection::GetCurrentPacket() { |
| 2348 if (current_packet_data_ == nullptr) { | 2347 if (current_packet_data_ == nullptr) { |
| 2349 return StringPiece(); | 2348 return StringPiece(); |
| 2350 } | 2349 } |
| 2351 return StringPiece(current_packet_data_, last_size_); | 2350 return StringPiece(current_packet_data_, last_size_); |
| 2352 } | 2351 } |
| 2353 | 2352 |
| 2354 } // namespace net | 2353 } // namespace net |
| OLD | NEW |