Chromium Code Reviews| 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 604 // Get the FEC group associate with the last processed packet or NULL, if the | 604 // Get the FEC group associate with the last processed packet or NULL, if the |
| 605 // group has already been deleted. | 605 // group has already been deleted. |
| 606 QuicFecGroup* GetFecGroup(); | 606 QuicFecGroup* GetFecGroup(); |
| 607 | 607 |
| 608 // Closes any FEC groups protecting packets before |sequence_number|. | 608 // Closes any FEC groups protecting packets before |sequence_number|. |
| 609 void CloseFecGroupsBefore(QuicPacketSequenceNumber sequence_number); | 609 void CloseFecGroupsBefore(QuicPacketSequenceNumber sequence_number); |
| 610 | 610 |
| 611 // Sets the ping alarm to the appropriate value, if any. | 611 // Sets the ping alarm to the appropriate value, if any. |
| 612 void SetPingAlarm(); | 612 void SetPingAlarm(); |
| 613 | 613 |
| 614 // On arrival of a new packet, checks to see if the socket addresses have | |
| 615 // changed since the last packet we saw on this connection. | |
| 616 void CheckForAddressMigration(const IPEndPoint& self_address, | |
| 617 const IPEndPoint& peer_address); | |
| 618 | |
| 614 QuicFramer framer_; | 619 QuicFramer framer_; |
| 615 QuicConnectionHelperInterface* helper_; // Not owned. | 620 QuicConnectionHelperInterface* helper_; // Not owned. |
| 616 QuicPacketWriter* writer_; // Not owned. | 621 QuicPacketWriter* writer_; // Not owned. |
| 617 EncryptionLevel encryption_level_; | 622 EncryptionLevel encryption_level_; |
| 618 const QuicClock* clock_; | 623 const QuicClock* clock_; |
| 619 QuicRandom* random_generator_; | 624 QuicRandom* random_generator_; |
| 620 | 625 |
| 621 const QuicConnectionId connection_id_; | 626 const QuicConnectionId connection_id_; |
| 622 // Address on the last successfully processed packet received from the | 627 // Address on the last successfully processed packet received from the |
| 623 // client. | 628 // client. |
| 624 IPEndPoint self_address_; | 629 IPEndPoint self_address_; |
| 625 IPEndPoint peer_address_; | 630 IPEndPoint peer_address_; |
| 631 // Used to store latest peer port to possibly migrate to later. | |
| 632 int migrating_peer_port_; | |
| 626 | 633 |
| 627 bool last_packet_revived_; // True if the last packet was revived from FEC. | 634 bool last_packet_revived_; // True if the last packet was revived from FEC. |
| 628 size_t last_size_; // Size of the last received packet. | 635 size_t last_size_; // Size of the last received packet. |
| 629 EncryptionLevel last_decrypted_packet_level_; | 636 EncryptionLevel last_decrypted_packet_level_; |
| 630 QuicPacketHeader last_header_; | 637 QuicPacketHeader last_header_; |
| 631 std::vector<QuicStreamFrame> last_stream_frames_; | 638 std::vector<QuicStreamFrame> last_stream_frames_; |
| 632 std::vector<QuicAckFrame> last_ack_frames_; | 639 std::vector<QuicAckFrame> last_ack_frames_; |
| 633 std::vector<QuicCongestionFeedbackFrame> last_congestion_frames_; | 640 std::vector<QuicCongestionFeedbackFrame> last_congestion_frames_; |
| 634 std::vector<QuicStopWaitingFrame> last_stop_waiting_frames_; | 641 std::vector<QuicStopWaitingFrame> last_stop_waiting_frames_; |
| 635 std::vector<QuicRstStreamFrame> last_rst_frames_; | 642 std::vector<QuicRstStreamFrame> last_rst_frames_; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 // The state of connection in version negotiation finite state machine. | 734 // The state of connection in version negotiation finite state machine. |
| 728 QuicVersionNegotiationState version_negotiation_state_; | 735 QuicVersionNegotiationState version_negotiation_state_; |
| 729 | 736 |
| 730 // Tracks if the connection was created by the server. | 737 // Tracks if the connection was created by the server. |
| 731 bool is_server_; | 738 bool is_server_; |
| 732 | 739 |
| 733 // True by default. False if we've received or sent an explicit connection | 740 // True by default. False if we've received or sent an explicit connection |
| 734 // close. | 741 // close. |
| 735 bool connected_; | 742 bool connected_; |
| 736 | 743 |
| 737 // Set to true if the udp packet headers have a new self or peer address. | 744 // Set to true if the UDP packet headers have a new IP address for the peer. |
| 738 // This is checked later on validating a data or version negotiation packet. | 745 // If true, do not perform connection migration. |
| 739 bool address_migrating_; | 746 bool peer_ip_changed_; |
| 747 | |
| 748 // Set to true if the UDP packet headers have a new port for the peer. | |
| 749 // If true, and the IP has not changed, then we can migrate the connection. | |
| 750 bool peer_port_changed_; | |
| 751 | |
| 752 // Set to true if the UDP packet headers are addressed to a different IP. | |
| 753 // We do not support connection migration when the self IP changed. | |
| 754 bool self_ip_changed_; | |
| 755 | |
| 756 // Set to true if the UDP packet headers are addressed to a different port. | |
| 757 // If true, and the IP has not changed, then we can migrate the connection. | |
|
wtc
2014/05/13 16:37:15
IMPORTANT: this comment doesn't match the code in
Robbie Shade
2014/05/13 21:31:21
Correct - this comment is wrong, make the change w
ramant (doing other things)
2014/05/14 05:30:23
Made this change in https://codereview.chromium.or
| |
| 758 bool self_port_changed_; | |
| 740 | 759 |
| 741 // If non-empty this contains the set of versions received in a | 760 // If non-empty this contains the set of versions received in a |
| 742 // version negotiation packet. | 761 // version negotiation packet. |
| 743 QuicVersionVector server_supported_versions_; | 762 QuicVersionVector server_supported_versions_; |
| 744 | 763 |
| 745 // Initial flow control receive window size for new streams. | 764 // Initial flow control receive window size for new streams. |
| 746 uint32 max_flow_control_receive_window_bytes_; | 765 uint32 max_flow_control_receive_window_bytes_; |
| 747 | 766 |
| 748 // Used for connection level flow control. | 767 // Used for connection level flow control. |
| 749 scoped_ptr<QuicFlowController> flow_controller_; | 768 scoped_ptr<QuicFlowController> flow_controller_; |
| 750 | 769 |
| 751 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 770 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 752 }; | 771 }; |
| 753 | 772 |
| 754 } // namespace net | 773 } // namespace net |
| 755 | 774 |
| 756 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 775 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |