| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 packet_generator_.ConsumeData(id, data, offset, fin); | 807 packet_generator_.ConsumeData(id, data, offset, fin); |
| 808 if (crypto_frame_while_batch_mode) { | 808 if (crypto_frame_while_batch_mode) { |
| 809 // Restore batch mode. | 809 // Restore batch mode. |
| 810 packet_generator_.StartBatchOperations(); | 810 packet_generator_.StartBatchOperations(); |
| 811 } | 811 } |
| 812 return consumed_data; | 812 return consumed_data; |
| 813 } | 813 } |
| 814 | 814 |
| 815 void QuicConnection::SendRstStream(QuicStreamId id, | 815 void QuicConnection::SendRstStream(QuicStreamId id, |
| 816 QuicRstStreamErrorCode error) { | 816 QuicRstStreamErrorCode error) { |
| 817 LOG(INFO) << "Sending RST_STREAM: " << id << " code: " << error; |
| 817 packet_generator_.AddControlFrame( | 818 packet_generator_.AddControlFrame( |
| 818 QuicFrame(new QuicRstStreamFrame(id, error))); | 819 QuicFrame(new QuicRstStreamFrame(id, error))); |
| 819 } | 820 } |
| 820 | 821 |
| 821 const QuicConnectionStats& QuicConnection::GetStats() { | 822 const QuicConnectionStats& QuicConnection::GetStats() { |
| 822 // Update rtt and estimated bandwidth. | 823 // Update rtt and estimated bandwidth. |
| 823 stats_.rtt = congestion_manager_.SmoothedRtt().ToMicroseconds(); | 824 stats_.rtt = congestion_manager_.SmoothedRtt().ToMicroseconds(); |
| 824 stats_.estimated_bandwidth = | 825 stats_.estimated_bandwidth = |
| 825 congestion_manager_.BandwidthEstimate().ToBytesPerSecond(); | 826 congestion_manager_.BandwidthEstimate().ToBytesPerSecond(); |
| 826 return stats_; | 827 return stats_; |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 timeout = connection_timeout; | 1720 timeout = connection_timeout; |
| 1720 } | 1721 } |
| 1721 } | 1722 } |
| 1722 | 1723 |
| 1723 timeout_alarm_->Cancel(); | 1724 timeout_alarm_->Cancel(); |
| 1724 timeout_alarm_->Set(clock_->ApproximateNow().Add(timeout)); | 1725 timeout_alarm_->Set(clock_->ApproximateNow().Add(timeout)); |
| 1725 return false; | 1726 return false; |
| 1726 } | 1727 } |
| 1727 | 1728 |
| 1728 } // namespace net | 1729 } // namespace net |
| OLD | NEW |