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 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 } | 978 } |
979 | 979 |
980 return consumed_data; | 980 return consumed_data; |
981 } | 981 } |
982 | 982 |
983 void QuicConnection::SendRstStream(QuicStreamId id, | 983 void QuicConnection::SendRstStream(QuicStreamId id, |
984 QuicRstStreamErrorCode error, | 984 QuicRstStreamErrorCode error, |
985 QuicStreamOffset bytes_written) { | 985 QuicStreamOffset bytes_written) { |
986 // Opportunistically bundle an ack with this outgoing packet. | 986 // Opportunistically bundle an ack with this outgoing packet. |
987 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); | 987 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); |
988 packet_generator_.AddControlFrame( | 988 packet_generator_.AddControlFrame(QuicFrame(new QuicRstStreamFrame( |
989 QuicFrame(new QuicRstStreamFrame(id, error, bytes_written))); | 989 id, AdjustErrorForVersion(error, version()), bytes_written))); |
990 } | 990 } |
991 | 991 |
992 void QuicConnection::SendWindowUpdate(QuicStreamId id, | 992 void QuicConnection::SendWindowUpdate(QuicStreamId id, |
993 QuicStreamOffset byte_offset) { | 993 QuicStreamOffset byte_offset) { |
994 // Opportunistically bundle an ack with this outgoing packet. | 994 // Opportunistically bundle an ack with this outgoing packet. |
995 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); | 995 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); |
996 packet_generator_.AddControlFrame( | 996 packet_generator_.AddControlFrame( |
997 QuicFrame(new QuicWindowUpdateFrame(id, byte_offset))); | 997 QuicFrame(new QuicWindowUpdateFrame(id, byte_offset))); |
998 } | 998 } |
999 | 999 |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 // If we changed the generator's batch state, restore original batch state. | 1827 // If we changed the generator's batch state, restore original batch state. |
1828 if (!already_in_batch_mode_) { | 1828 if (!already_in_batch_mode_) { |
1829 DVLOG(1) << "Leaving Batch Mode."; | 1829 DVLOG(1) << "Leaving Batch Mode."; |
1830 connection_->packet_generator_.FinishBatchOperations(); | 1830 connection_->packet_generator_.FinishBatchOperations(); |
1831 } | 1831 } |
1832 DCHECK_EQ(already_in_batch_mode_, | 1832 DCHECK_EQ(already_in_batch_mode_, |
1833 connection_->packet_generator_.InBatchMode()); | 1833 connection_->packet_generator_.InBatchMode()); |
1834 } | 1834 } |
1835 | 1835 |
1836 } // namespace net | 1836 } // namespace net |
OLD | NEW |