| 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 // The entity that handles framing writes for a Quic client or server. | 5 // The entity that handles framing writes for a Quic client or server. |
| 6 // Each QuicSession will have a connection associated with it. | 6 // Each QuicSession will have a connection associated with it. |
| 7 // | 7 // |
| 8 // On the server side, the Dispatcher handles the raw reads, and hands off | 8 // On the server side, the Dispatcher handles the raw reads, and hands off |
| 9 // packets via ProcessUdpPacket for framing and processing. | 9 // packets via ProcessUdpPacket for framing and processing. |
| 10 // | 10 // |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 uint32_t cipher_id() const { return framer_.decrypter()->cipher_id(); } | 654 uint32_t cipher_id() const { return framer_.decrypter()->cipher_id(); } |
| 655 | 655 |
| 656 std::vector<QuicEncryptedPacket*>* termination_packets() { | 656 std::vector<QuicEncryptedPacket*>* termination_packets() { |
| 657 return termination_packets_.get(); | 657 return termination_packets_.get(); |
| 658 } | 658 } |
| 659 | 659 |
| 660 bool ack_frame_updated() const; | 660 bool ack_frame_updated() const; |
| 661 | 661 |
| 662 QuicConnectionHelperInterface* helper() { return helper_; } | 662 QuicConnectionHelperInterface* helper() { return helper_; } |
| 663 | 663 |
| 664 base::StringPiece GetCurrentPacket(); |
| 665 |
| 664 protected: | 666 protected: |
| 665 // Send a packet to the peer, and takes ownership of the packet if the packet | 667 // Send a packet to the peer, and takes ownership of the packet if the packet |
| 666 // cannot be written immediately. | 668 // cannot be written immediately. |
| 667 virtual void SendOrQueuePacket(SerializedPacket* packet); | 669 virtual void SendOrQueuePacket(SerializedPacket* packet); |
| 668 | 670 |
| 669 // Migrate the connection if peer address changes. This function should only | 671 // Migrate the connection if peer address changes. This function should only |
| 670 // be called after the packet is validated. | 672 // be called after the packet is validated. |
| 671 virtual void MaybeMigrateConnectionToNewPeerAddress(); | 673 virtual void MaybeMigrateConnectionToNewPeerAddress(); |
| 672 | 674 |
| 673 // Selects and updates the version of the protocol being used by selecting a | 675 // Selects and updates the version of the protocol being used by selecting a |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 | 841 |
| 840 // Used to store latest peer IP address for IP address migration. | 842 // Used to store latest peer IP address for IP address migration. |
| 841 IPAddress migrating_peer_ip_; | 843 IPAddress migrating_peer_ip_; |
| 842 // Used to store latest peer port to possibly migrate to later. | 844 // Used to store latest peer port to possibly migrate to later. |
| 843 uint16_t migrating_peer_port_; | 845 uint16_t migrating_peer_port_; |
| 844 | 846 |
| 845 // True if the last packet has gotten far enough in the framer to be | 847 // True if the last packet has gotten far enough in the framer to be |
| 846 // decrypted. | 848 // decrypted. |
| 847 bool last_packet_decrypted_; | 849 bool last_packet_decrypted_; |
| 848 QuicByteCount last_size_; // Size of the last received packet. | 850 QuicByteCount last_size_; // Size of the last received packet. |
| 851 // TODO(rch): remove this when b/27221014 is fixed. |
| 852 const char* current_packet_data_; // UDP payload of packet currently being |
| 853 // parsed or nullptr. |
| 849 EncryptionLevel last_decrypted_packet_level_; | 854 EncryptionLevel last_decrypted_packet_level_; |
| 850 QuicPacketHeader last_header_; | 855 QuicPacketHeader last_header_; |
| 851 QuicStopWaitingFrame last_stop_waiting_frame_; | 856 QuicStopWaitingFrame last_stop_waiting_frame_; |
| 852 bool should_last_packet_instigate_acks_; | 857 bool should_last_packet_instigate_acks_; |
| 853 | 858 |
| 854 // Track some peer state so we can do less bookkeeping | 859 // Track some peer state so we can do less bookkeeping |
| 855 // Largest sequence sent by the peer which had an ack frame (latest ack info). | 860 // Largest sequence sent by the peer which had an ack frame (latest ack info). |
| 856 QuicPacketNumber largest_seen_packet_with_ack_; | 861 QuicPacketNumber largest_seen_packet_with_ack_; |
| 857 | 862 |
| 858 // Largest packet number sent by the peer which had a stop waiting frame. | 863 // Largest packet number sent by the peer which had a stop waiting frame. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 | 1038 |
| 1034 // If true, multipath is enabled for this connection. | 1039 // If true, multipath is enabled for this connection. |
| 1035 bool multipath_enabled_; | 1040 bool multipath_enabled_; |
| 1036 | 1041 |
| 1037 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 1042 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 1038 }; | 1043 }; |
| 1039 | 1044 |
| 1040 } // namespace net | 1045 } // namespace net |
| 1041 | 1046 |
| 1042 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 1047 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |