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 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 return group_map_[fec_group_num]; | 1155 return group_map_[fec_group_num]; |
1156 } | 1156 } |
1157 | 1157 |
1158 void QuicConnection::SendConnectionClose(QuicErrorCode error) { | 1158 void QuicConnection::SendConnectionClose(QuicErrorCode error) { |
1159 SendConnectionCloseWithDetails(error, string()); | 1159 SendConnectionCloseWithDetails(error, string()); |
1160 } | 1160 } |
1161 | 1161 |
1162 void QuicConnection::SendConnectionClosePacket(QuicErrorCode error, | 1162 void QuicConnection::SendConnectionClosePacket(QuicErrorCode error, |
1163 const string& details) { | 1163 const string& details) { |
1164 DLOG(INFO) << ENDPOINT << "Force closing with error " | 1164 DLOG(INFO) << ENDPOINT << "Force closing with error " |
1165 << QuicUtils::ErrorToString(error) << " (" << error << ")"; | 1165 << QuicUtils::ErrorToString(error) << " (" << error << ") " |
| 1166 << details; |
1166 QuicConnectionCloseFrame frame; | 1167 QuicConnectionCloseFrame frame; |
1167 frame.error_code = error; | 1168 frame.error_code = error; |
1168 frame.error_details = details; | 1169 frame.error_details = details; |
1169 UpdateOutgoingAck(); | 1170 UpdateOutgoingAck(); |
1170 frame.ack_frame = outgoing_ack_; | 1171 frame.ack_frame = outgoing_ack_; |
1171 | 1172 |
1172 SerializedPacket serialized_packet = | 1173 SerializedPacket serialized_packet = |
1173 packet_creator_.SerializeConnectionClose(&frame); | 1174 packet_creator_.SerializeConnectionClose(&frame); |
1174 | 1175 |
1175 // We need to update the sent entrophy hash for all sent packets. | 1176 // We need to update the sent entrophy hash for all sent packets. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 << " delta:" << delta.ToMicroseconds(); | 1242 << " delta:" << delta.ToMicroseconds(); |
1242 if (delta >= timeout_) { | 1243 if (delta >= timeout_) { |
1243 SendConnectionClose(QUIC_CONNECTION_TIMED_OUT); | 1244 SendConnectionClose(QUIC_CONNECTION_TIMED_OUT); |
1244 return true; | 1245 return true; |
1245 } | 1246 } |
1246 helper_->SetTimeoutAlarm(timeout_.Subtract(delta)); | 1247 helper_->SetTimeoutAlarm(timeout_.Subtract(delta)); |
1247 return false; | 1248 return false; |
1248 } | 1249 } |
1249 | 1250 |
1250 } // namespace net | 1251 } // namespace net |
OLD | NEW |