summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_session.h
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-25 05:27:03 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-25 05:27:03 +0000
commit9db4439170f43fb458827d4731ac24211ddb6ecf (patch)
tree94d350faaa0024fd030fdd9c0d4f41bff86d4139 /net/quic/quic_session.h
parent5729f4ac33ddeb87b632c858b4a502f43392c938 (diff)
downloadchromium_src-9db4439170f43fb458827d4731ac24211ddb6ecf.zip
chromium_src-9db4439170f43fb458827d4731ac24211ddb6ecf.tar.gz
chromium_src-9db4439170f43fb458827d4731ac24211ddb6ecf.tar.bz2
Land recent QUIC changes.
Reviving entropy flag of missing packet. Merge internal change: 42912121 Fix bug in QuicConnection::OnCanWrite in which the packet generator never flushed the packets when the visitor did not write all bytes. Merge internal change: 42919513 Clarify the SendAlarm behavior of the TestHelper in QuicConnectionTests. In particular, it is important that if we set a send alarm for a delay of Zero, that IsSendAlarmSet() returns true. Merge internal change: 42908913 Fix bug in SimpleQuicFramerVisitor which did not make a copy of StreamFrame data. Merge internal change: 42880797 Use the QuicPacketGenerator in QuicConnection. Merge internal change: 42861764 Add new files Create a new QuicPacketGenerator class to encapsulate the write side operation of a QuicConnection. It provides methods for enqueing control frames, consuming stream data, and sending acks and feedback. It does just-in-time serialization. Also adds a new test-only simple framer which provides an easy mechanism for parsing packets to verify they contain correct contents. Merge internal change: 42813986 Add missing files Implementing logic for checking entropy of received packets and setting entropy on outgoing packets. Merge internal change: 42715914 Fixing a bug where when QuicPacketCreator queues a stream frame, the underlying string is not immediately owned, which can cause issues if SendStreamData doesn't always flush packets before exiting. Merge internal change: 42649091 Add the SetKey, SetNoncePrefix, GetKeySize, and GetNoncePrefixSize methods to the QuicEncrypter and QuicDecrypter interfaces. Specify the format of the nonce for AEAD algorithms. Add a |packet_sequence_number| argument to QuicEncrypter::Encrypt and QuicDecrypter::Decrypt. This requires passing the packet sequence number to QuicFramer::EncryptPacket and QuicFramer::DecryptPayload. Merge internal change: 42641062 Move all logic out of ReceivedInfo. Now it is just a plain struct that is used to represent the state of the received packets info. Also, fixes the following bug: i) Packet 7 8 get lost, largest observed packet is 6. ii) Packet 9 arrives with an AckFrame which has least unacked as 9. iii) We clear 7 8 from missing packets. iv) While adding packet 9 we reinsert 7 and 8 as missing packets since largest observed is 6. Merge internal change: 42556974 Make framer return SerializedPacket instead of QuicPacket. Merge internal change: 42551314 Add SendConnectionClosePacket method to QuicConnection Merge internal change: 42474257 Removing offset from the reset stream frame. Merge internal change: 42436913 Fix for when the end of a frame leave too few bytes for the next header Merge internal change: 42435044 Bug fix for packet loss in inter arrival. Added min drift threshold for inter arrival. Merge internal change: 42391696 Add missing file. Use linked_hash_map to store UnackedPackets: simplifies and optimizes the code. Merge internal change: 42381785 Bugfix "Flaky tests due to QuicTime not initialized" Removed DCHECK that due to timing was invalid Merge internal change: 42374053 Fix TSAN test failure. Merge internal change: 42371302 A simple tcp tail drop like implementation. Merge internal change: 42314912 Adding the GoAway Frame. Merge internal change: 42291652 Chromium review fixes. Merge internal change: 42290161 Implement framing for entropy in AckFrame. Merge internal change: 42286308 Make QuicPacketCreator return SerializedPacket struct. Merge internal change: 42240179 Fix for incoming duplicate packet. Avoids NACKing a duplicate. Merge internal change: 42150291 Remove QuicConnectionVisitorInterface::AckedPackets and use the existing SequenceSet typedef instead. Renamed SequenceSet to SequenceNumberSet to be more readable. Merge internal change: 42147690 Made ramp up bitrate in inter arrival aware of the current send rate. Merge internal change: 42118607 Style fix of full_packet. Merge internal change: 42057032 Packing multiple streams together in a single packet from OnCanWrite. Merge internal change: 42054845 Change the representation of public and private flags to explicts bools. Using enums turns out to be problematic because ENUM1 | ENUM2 can not be assigned to EnumType. I discovered this problem in attempting to implement version negotiation. Merge internal change: 42042022 Various small QUIC cleanups after merging to Chrome. Merge internal change: 42041347 Start using QuicClock Now where needed and sending it around instead of querying it multiple times. This CL also fixes the reports of incoming lost packets which had been lost. Merge internal change: 41944659 Fix mock clock. Adding Now function back to QuicClock but now as a more accurate now Merge internal change: 41909929 Rename of function Now to ApproximateNow to allow us to differentiate between the two in the future. Merge internal change: 41909178 TBR=jar@chromium.org R=jar@chromium.org BUG= Review URL: https://chromiumcodereview.appspot.com/12334063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/quic_session.h')
-rw-r--r--net/quic/quic_session.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/net/quic/quic_session.h b/net/quic/quic_session.h
index 32bffc1..6f07b9a 100644
--- a/net/quic/quic_session.h
+++ b/net/quic/quic_session.h
@@ -40,9 +40,10 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
const QuicPacketHeader& header,
const std::vector<QuicStreamFrame>& frame) OVERRIDE;
virtual void OnRstStream(const QuicRstStreamFrame& frame) OVERRIDE;
+ virtual void OnGoAway(const QuicGoAwayFrame& frame) OVERRIDE;
virtual void ConnectionClose(QuicErrorCode error, bool from_peer) OVERRIDE;
// Not needed for HTTP.
- virtual void OnAck(AckedPackets acked_packets) OVERRIDE {}
+ virtual void OnAck(const SequenceNumberSet& acked_packets) OVERRIDE {}
virtual bool OnCanWrite() OVERRIDE;
// Called by streams when they want to write data to the peer.
@@ -56,8 +57,10 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
bool fin);
// Called by streams when they want to close the stream in both directions.
void SendRstStream(QuicStreamId id,
- QuicErrorCode error,
- QuicStreamOffset offset);
+ QuicErrorCode error);
+
+ // Called when the session wants to go away and not accept any new streams.
+ void SendGoAway(QuicErrorCode error_code, const std::string& reason);
// Removes the stream associated with 'stream_id' from the active stream map.
virtual void CloseStream(QuicStreamId stream_id);
@@ -90,6 +93,14 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
void MarkWriteBlocked(QuicStreamId id);
+ bool goaway_received() const {
+ return goaway_received_;
+ }
+
+ bool goaway_sent() const {
+ return goaway_sent_;
+ }
+
protected:
// Creates a new stream, owned by the caller, to handle a peer-initiated
// stream. Returns NULL and does error handling if the stream can not be
@@ -111,15 +122,10 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
ReliableQuicStream* GetIncomingReliableStream(QuicStreamId stream_id);
- size_t get_max_open_streams() const {
- return max_open_streams_;
- }
-
- protected:
// This is called after every call other than OnConnectionClose from the
// QuicConnectionVisitor to allow post-processing once the work has been done.
// In this case, it deletes streams given that it's safe to do so (no other
- // opterations are being done on the streams at this time)
+ // operations are being done on the streams at this time)
virtual void PostProcessAfterData();
base::hash_map<QuicStreamId, ReliableQuicStream*>* streams() {
@@ -129,6 +135,10 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
return &closed_streams_;
}
+ size_t get_max_open_streams() const {
+ return max_open_streams_;
+ }
+
private:
friend class test::QuicSessionPeer;
friend class VisitorShim;
@@ -161,6 +171,11 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
std::list<QuicStreamId> write_blocked_streams_;
QuicStreamId largest_peer_created_stream_id_;
+
+ // Whether a GoAway has been received.
+ bool goaway_received_;
+ // Whether a GoAway has been sent.
+ bool goaway_sent_;
};
} // namespace net