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 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 ++stats_.packets_processed; | 1691 ++stats_.packets_processed; |
1692 delete packet; | 1692 delete packet; |
1693 undecryptable_packets_.pop_front(); | 1693 undecryptable_packets_.pop_front(); |
1694 } | 1694 } |
1695 | 1695 |
1696 // Once forward secure encryption is in use, there will be no | 1696 // Once forward secure encryption is in use, there will be no |
1697 // new keys installed and hence any undecryptable packets will | 1697 // new keys installed and hence any undecryptable packets will |
1698 // never be able to be decrypted. | 1698 // never be able to be decrypted. |
1699 if (encryption_level_ == ENCRYPTION_FORWARD_SECURE) { | 1699 if (encryption_level_ == ENCRYPTION_FORWARD_SECURE) { |
1700 if (debug_visitor_.get() != NULL) { | 1700 if (debug_visitor_.get() != NULL) { |
| 1701 // TODO(rtenneti): perhaps more efficient to pass the number of |
| 1702 // undecryptable packets as the argument to OnUndecryptablePacket so that |
| 1703 // we just need to call OnUndecryptablePacket once? |
1701 for (size_t i = 0; i < undecryptable_packets_.size(); ++i) { | 1704 for (size_t i = 0; i < undecryptable_packets_.size(); ++i) { |
1702 debug_visitor_->OnUndecryptablePacket(); | 1705 debug_visitor_->OnUndecryptablePacket(); |
1703 } | 1706 } |
1704 } | 1707 } |
1705 STLDeleteElements(&undecryptable_packets_); | 1708 STLDeleteElements(&undecryptable_packets_); |
1706 } | 1709 } |
1707 } | 1710 } |
1708 | 1711 |
1709 void QuicConnection::MaybeProcessRevivedPacket() { | 1712 void QuicConnection::MaybeProcessRevivedPacket() { |
1710 QuicFecGroup* group = GetFecGroup(); | 1713 QuicFecGroup* group = GetFecGroup(); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1988 // If we changed the generator's batch state, restore original batch state. | 1991 // If we changed the generator's batch state, restore original batch state. |
1989 if (!already_in_batch_mode_) { | 1992 if (!already_in_batch_mode_) { |
1990 DVLOG(1) << "Leaving Batch Mode."; | 1993 DVLOG(1) << "Leaving Batch Mode."; |
1991 connection_->packet_generator_.FinishBatchOperations(); | 1994 connection_->packet_generator_.FinishBatchOperations(); |
1992 } | 1995 } |
1993 DCHECK_EQ(already_in_batch_mode_, | 1996 DCHECK_EQ(already_in_batch_mode_, |
1994 connection_->packet_generator_.InBatchMode()); | 1997 connection_->packet_generator_.InBatchMode()); |
1995 } | 1998 } |
1996 | 1999 |
1997 } // namespace net | 2000 } // namespace net |
OLD | NEW |