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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 bool WriteQueuedPackets(); | 496 bool WriteQueuedPackets(); |
497 | 497 |
498 // If a packet can be revived from the current FEC group, then | 498 // If a packet can be revived from the current FEC group, then |
499 // revive and process the packet. | 499 // revive and process the packet. |
500 void MaybeProcessRevivedPacket(); | 500 void MaybeProcessRevivedPacket(); |
501 | 501 |
502 void UpdateOutgoingAck(); | 502 void UpdateOutgoingAck(); |
503 | 503 |
504 void MaybeSendAckInResponseToPacket(); | 504 void MaybeSendAckInResponseToPacket(); |
505 | 505 |
506 // Get the FEC group associate with the last processed packet. | 506 // Get the FEC group associate with the last processed packet or NULL, if the |
| 507 // group has already been deleted. |
507 QuicFecGroup* GetFecGroup(); | 508 QuicFecGroup* GetFecGroup(); |
508 | 509 |
509 // Closes any FEC groups protecting packets before |sequence_number|. | 510 // Closes any FEC groups protecting packets before |sequence_number|. |
510 void CloseFecGroupsBefore(QuicPacketSequenceNumber sequence_number); | 511 void CloseFecGroupsBefore(QuicPacketSequenceNumber sequence_number); |
511 | 512 |
512 scoped_ptr<QuicConnectionHelperInterface> helper_; | 513 scoped_ptr<QuicConnectionHelperInterface> helper_; |
513 EncryptionLevel encryption_level_; | 514 EncryptionLevel encryption_level_; |
514 const QuicClock* clock_; | 515 const QuicClock* clock_; |
515 QuicRandom* random_generator_; | 516 QuicRandom* random_generator_; |
516 | 517 |
517 const QuicGuid guid_; | 518 const QuicGuid guid_; |
518 // Address on the last successfully processed packet received from the | 519 // Address on the last successfully processed packet received from the |
519 // client. | 520 // client. |
520 IPEndPoint self_address_; | 521 IPEndPoint self_address_; |
521 IPEndPoint peer_address_; | 522 IPEndPoint peer_address_; |
522 // Address on the last(currently being processed) packet received. Not | |
523 // verified/authenticated. | |
524 IPEndPoint last_self_address_; | |
525 IPEndPoint last_peer_address_; | |
526 | 523 |
527 bool last_packet_revived_; // True if the last packet was revived from FEC. | 524 bool last_packet_revived_; // True if the last packet was revived from FEC. |
528 size_t last_size_; // Size of the last received packet. | 525 size_t last_size_; // Size of the last received packet. |
529 QuicPacketHeader last_header_; | 526 QuicPacketHeader last_header_; |
530 std::vector<QuicStreamFrame> last_stream_frames_; | 527 std::vector<QuicStreamFrame> last_stream_frames_; |
531 | 528 |
532 QuicAckFrame outgoing_ack_; | 529 QuicAckFrame outgoing_ack_; |
533 QuicCongestionFeedbackFrame outgoing_congestion_feedback_; | 530 QuicCongestionFeedbackFrame outgoing_congestion_feedback_; |
534 | 531 |
535 // Track some peer state so we can do less bookkeeping | 532 // Track some peer state so we can do less bookkeeping |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 // Congestion manager which controls the rate the connection sends packets | 596 // Congestion manager which controls the rate the connection sends packets |
600 // as well as collecting and generating congestion feedback. | 597 // as well as collecting and generating congestion feedback. |
601 QuicCongestionManager congestion_manager_; | 598 QuicCongestionManager congestion_manager_; |
602 | 599 |
603 // The state of connection in version negotiation finite state machine. | 600 // The state of connection in version negotiation finite state machine. |
604 QuicVersionNegotiationState version_negotiation_state_; | 601 QuicVersionNegotiationState version_negotiation_state_; |
605 | 602 |
606 // The version of the protocol this connection is using. | 603 // The version of the protocol this connection is using. |
607 QuicTag quic_version_; | 604 QuicTag quic_version_; |
608 | 605 |
| 606 size_t max_packets_per_retransmission_alarm_; |
| 607 |
609 // Tracks if the connection was created by the server. | 608 // Tracks if the connection was created by the server. |
610 bool is_server_; | 609 bool is_server_; |
611 | 610 |
612 // True by default. False if we've received or sent an explicit connection | 611 // True by default. False if we've received or sent an explicit connection |
613 // close. | 612 // close. |
614 bool connected_; | 613 bool connected_; |
615 | 614 |
616 // True if the last ack received from the peer may have been truncated. False | 615 // True if the last ack received from the peer may have been truncated. False |
617 // otherwise. | 616 // otherwise. |
618 bool received_truncated_ack_; | 617 bool received_truncated_ack_; |
619 | 618 |
620 bool send_ack_in_response_to_packet_; | 619 bool send_ack_in_response_to_packet_; |
621 | 620 |
| 621 // Set to true if the udp packet headers have a new self or peer address. |
| 622 // This is checked later on validating a data or version negotiation packet. |
| 623 bool address_migrating_; |
| 624 |
622 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 625 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
623 }; | 626 }; |
624 | 627 |
625 } // namespace net | 628 } // namespace net |
626 | 629 |
627 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 630 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |