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 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 packet_generator_.AddControlFrame(QuicFrame(frame)); | 1979 packet_generator_.AddControlFrame(QuicFrame(frame)); |
1980 packet_generator_.FlushAllQueuedFrames(); | 1980 packet_generator_.FlushAllQueuedFrames(); |
1981 } | 1981 } |
1982 | 1982 |
1983 void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) { | 1983 void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) { |
1984 if (!connected_) { | 1984 if (!connected_) { |
1985 DVLOG(1) << "Connection is already closed."; | 1985 DVLOG(1) << "Connection is already closed."; |
1986 return; | 1986 return; |
1987 } | 1987 } |
1988 connected_ = false; | 1988 connected_ = false; |
| 1989 DCHECK(visitor_ != nullptr); |
| 1990 visitor_->OnConnectionClosed(error, from_peer); |
1989 if (debug_visitor_ != nullptr) { | 1991 if (debug_visitor_ != nullptr) { |
1990 debug_visitor_->OnConnectionClosed(error, from_peer); | 1992 debug_visitor_->OnConnectionClosed(error, from_peer); |
1991 } | 1993 } |
1992 DCHECK(visitor_ != nullptr); | |
1993 visitor_->OnConnectionClosed(error, from_peer); | |
1994 // Cancel the alarms so they don't trigger any action now that the | 1994 // Cancel the alarms so they don't trigger any action now that the |
1995 // connection is closed. | 1995 // connection is closed. |
1996 ack_alarm_->Cancel(); | 1996 ack_alarm_->Cancel(); |
1997 ping_alarm_->Cancel(); | 1997 ping_alarm_->Cancel(); |
1998 fec_alarm_->Cancel(); | 1998 fec_alarm_->Cancel(); |
1999 resume_writes_alarm_->Cancel(); | 1999 resume_writes_alarm_->Cancel(); |
2000 retransmission_alarm_->Cancel(); | 2000 retransmission_alarm_->Cancel(); |
2001 send_alarm_->Cancel(); | 2001 send_alarm_->Cancel(); |
2002 timeout_alarm_->Cancel(); | 2002 timeout_alarm_->Cancel(); |
2003 mtu_discovery_alarm_->Cancel(); | 2003 mtu_discovery_alarm_->Cancel(); |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2344 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; | 2344 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; |
2345 ++mtu_probe_count_; | 2345 ++mtu_probe_count_; |
2346 | 2346 |
2347 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; | 2347 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; |
2348 SendMtuDiscoveryPacket(mtu_discovery_target_); | 2348 SendMtuDiscoveryPacket(mtu_discovery_target_); |
2349 | 2349 |
2350 DCHECK(!mtu_discovery_alarm_->IsSet()); | 2350 DCHECK(!mtu_discovery_alarm_->IsSet()); |
2351 } | 2351 } |
2352 | 2352 |
2353 } // namespace net | 2353 } // namespace net |
OLD | NEW |