summaryrefslogtreecommitdiffstats
path: root/net/tools/quic/quic_spdy_server_stream.h
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 09:24:58 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 09:24:58 +0000
commit457d695943b205d852e9eb9c8b03d4d1bbb8caa7 (patch)
treecc76421d8ac45c708fa10ab82b7913a3a76bfb0c /net/tools/quic/quic_spdy_server_stream.h
parentad8ff0e4b3067681dfe04cdebb423cdf3e68181d (diff)
downloadchromium_src-457d695943b205d852e9eb9c8b03d4d1bbb8caa7.zip
chromium_src-457d695943b205d852e9eb9c8b03d4d1bbb8caa7.tar.gz
chromium_src-457d695943b205d852e9eb9c8b03d4d1bbb8caa7.tar.bz2
Land Recent QUIC Changes.
Temporarily change the maximum server initial congestion window to 10 from 100, because many existing Chrome clients are still negotiating 100, causing visible performance issues, particularly for YouTube rebuffers. Merge internal change: 57996291 https://codereview.chromium.org/102373005/ Merge the QUIC unacked packet map with the unacked fec packet map and merge the retransmission timer with the discard fec timer. Merge internal change: 57978547 https://codereview.chromium.org/114683002/ Pool 64 bits of entropy instead of calling OpenSSL's RNG for one bit when creating packets. Clean up the entropy bit while I'm at it. Changes: 1. QuicPacketCreator buffers 64 bits of entropy and consumes them one-at-a-time. This should resolve the performance issue. Covered this with a unit test. Removed the RandBool call from QuicRandom. 2. The first packet gets a random entropy bit. We used to never set it because we failed to test it properly. This was sad because the first packet deserves the most protection. 3. The entropy hash computation had a TODO to make it stronger, but I'm convinced the current algorithm is in fact sound. Removed the TODO and tightened up the implementation to avoid an unpredictable branch (no behavior change!) Also covered by the test. 4. Fixed the bugs in QuicConnectionTest that prevented setting the bit in the first packet. Switched tests to properly use MockRandom. Merge internal change: 57908681 https://codereview.chromium.org/109323006/ Minor change of QUIC's RTO behavior to not change the congestion window when the RTO fires, but there are no retransmittable packets. Merge internal change: 57907460 https://codereview.chromium.org/99583006/ QuicSentPacketManager cleanup to simplify OnAbandonFECTimeout() and remove unused DefaultRetransmissionTime(). Merge internal change: 57897409 https://codereview.chromium.org/110383006/ Minor cleanup of QuicSpdyServerStream and QuicSpdyClientStream. Merge internal change: 57834426 https://codereview.chromium.org/105103007/ Break out the basic reliable QUIC stream functionality from the headers-capable QUIC stream functionality. The crypto stream does not do have header processing, and and the soon-to-be-written headers stream will not have header processing in the way that data streams do. No functionality change. Refactor ReliableQuicStream class. Merge internal change: 57796557 https://codereview.chromium.org/100173005/ Merge ReliableQuicStream::WriteData with ReliableQuicStream::WriteOrBuffer, and make this method non-virtual. It turns out the only cases where it was overridden could easily be worked around. Remove ReliableQuicStream::WriteDataInternal and use a MakeIovec helper to work around it. Rename ReliableQuicStream::WritevDataInternal to ReliableQuicStream::WritevData. Rename QuicStream::WritevData to QuicStream::Writev. Cleanup of the various Write methods in ReliableQuicStream. Merge internal change: 57753091 https://codereview.chromium.org/112343002/ Cleanup of QUIC stream classes. Remove abstract QuicReliableClientStream class and fold it into the derived QuicSpdyClientStream class. Remove abstract QuicReliableServerStream class and fold it into the derived QuicSpdyServerStream class. Merge internal change: 57751931 https://codereview.chromium.org/111073003/ R=rch@chromium.org Review URL: https://codereview.chromium.org/103973007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240569 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools/quic/quic_spdy_server_stream.h')
-rw-r--r--net/tools/quic/quic_spdy_server_stream.h33
1 files changed, 26 insertions, 7 deletions
diff --git a/net/tools/quic/quic_spdy_server_stream.h b/net/tools/quic/quic_spdy_server_stream.h
index b5f100b..574ef76 100644
--- a/net/tools/quic/quic_spdy_server_stream.h
+++ b/net/tools/quic/quic_spdy_server_stream.h
@@ -8,7 +8,9 @@
#include <string>
#include "net/base/io_buffer.h"
-#include "net/tools/quic/quic_reliable_server_stream.h"
+#include "net/quic/quic_data_stream.h"
+#include "net/quic/quic_protocol.h"
+#include "net/tools/balsa/balsa_headers.h"
namespace net {
@@ -16,9 +18,13 @@ class QuicSession;
namespace tools {
-// All this does right now is aggregate data, and on fin, send a cached
+namespace test {
+class QuicSpdyServerStreamPeer;
+} // namespace test
+
+// All this does right now is aggregate data, and on fin, send an HTTP
// response.
-class QuicSpdyServerStream : public QuicReliableServerStream {
+class QuicSpdyServerStream : public QuicDataStream {
public:
QuicSpdyServerStream(QuicStreamId id, QuicSession* session);
virtual ~QuicSpdyServerStream();
@@ -26,13 +32,26 @@ class QuicSpdyServerStream : public QuicReliableServerStream {
// ReliableQuicStream implementation called by the session when there's
// data for us.
virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE;
-
- virtual void SendHeaders(const BalsaHeaders& response_headers) OVERRIDE;
+ virtual void OnFinRead() OVERRIDE;
int ParseRequestHeaders();
- protected:
- virtual void OnFinRead() OVERRIDE;
+ private:
+ friend class test::QuicSpdyServerStreamPeer;
+
+ // Sends a basic 200 response using SendHeaders for the headers and WriteData
+ // for the body.
+ void SendResponse();
+
+ // Sends a basic 500 response using SendHeaders for the headers and WriteData
+ // for the body
+ void SendErrorResponse();
+
+ void SendHeadersAndBody(const BalsaHeaders& response_headers,
+ base::StringPiece body);
+
+ BalsaHeaders headers_;
+ string body_;
// Buffer into which response header data is read.
scoped_refptr<GrowableIOBuffer> read_buf_;