summaryrefslogtreecommitdiffstats
path: root/net/spdy
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-30 02:16:35 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-30 02:16:35 +0000
commitdae22c5cddc8f1ebdfe77e66ebbf834255f94319 (patch)
treef949e3011b81a4b1234c90311a074fda63706e9c /net/spdy
parentd420c31e107cd932582a4a8add0ce2676e4b52da (diff)
downloadchromium_src-dae22c5cddc8f1ebdfe77e66ebbf834255f94319.zip
chromium_src-dae22c5cddc8f1ebdfe77e66ebbf834255f94319.tar.gz
chromium_src-dae22c5cddc8f1ebdfe77e66ebbf834255f94319.tar.bz2
Bump the SPDY protocol version to version 2.
Remove "http1.1" and "spdy" from the NPN advertisement string (the proper values are "http/1.1" and "spdy/2", which were included redundantly). BUG=50550 TEST=existing Review URL: http://codereview.chromium.org/3044034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy')
-rw-r--r--net/spdy/spdy_framer_test.cc54
-rw-r--r--net/spdy/spdy_network_transaction_unittest.cc12
-rw-r--r--net/spdy/spdy_protocol.h4
3 files changed, 37 insertions, 33 deletions
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc
index 4e976ab..d238062 100644
--- a/net/spdy/spdy_framer_test.cc
+++ b/net/spdy/spdy_framer_test.cc
@@ -438,7 +438,7 @@ TEST_F(SpdyFramerTest, DecompressUncompressedFrame) {
TEST_F(SpdyFramerTest, Basic) {
const unsigned char input[] = {
- 0x80, 0x01, 0x00, 0x01, // SYN Stream #1
+ 0x80, 0x02, 0x00, 0x01, // SYN Stream #1
0x00, 0x00, 0x00, 0x14,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00,
@@ -452,7 +452,7 @@ TEST_F(SpdyFramerTest, Basic) {
0xde, 0xad, 0xbe, 0xef,
0xde, 0xad, 0xbe, 0xef,
- 0x80, 0x01, 0x00, 0x01, // SYN Stream #3
+ 0x80, 0x02, 0x00, 0x01, // SYN Stream #3
0x00, 0x00, 0x00, 0x0c,
0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x00,
@@ -467,7 +467,7 @@ TEST_F(SpdyFramerTest, Basic) {
0x00, 0x00, 0x00, 0x04,
0xde, 0xad, 0xbe, 0xef,
- 0x80, 0x01, 0x00, 0x03, // RST_STREAM on Stream #1
+ 0x80, 0x02, 0x00, 0x03, // RST_STREAM on Stream #1
0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00,
@@ -475,7 +475,7 @@ TEST_F(SpdyFramerTest, Basic) {
0x00, 0x00, 0x00, 0x03, // DATA on Stream #3
0x00, 0x00, 0x00, 0x00,
- 0x80, 0x01, 0x00, 0x03, // RST_STREAM on Stream #3
+ 0x80, 0x02, 0x00, 0x03, // RST_STREAM on Stream #3
0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x00,
@@ -496,7 +496,7 @@ TEST_F(SpdyFramerTest, Basic) {
// Test that the FIN flag on a data frame signifies EOF.
TEST_F(SpdyFramerTest, FinOnDataFrame) {
const unsigned char input[] = {
- 0x80, 0x01, 0x00, 0x01, // SYN Stream #1
+ 0x80, 0x02, 0x00, 0x01, // SYN Stream #1
0x00, 0x00, 0x00, 0x14,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00,
@@ -504,7 +504,7 @@ TEST_F(SpdyFramerTest, FinOnDataFrame) {
0x00, 0x02, 'h', 'h',
0x00, 0x02, 'v', 'v',
- 0x80, 0x01, 0x00, 0x02, // SYN REPLY Stream #1
+ 0x80, 0x02, 0x00, 0x02, // SYN REPLY Stream #1
0x00, 0x00, 0x00, 0x10,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01,
@@ -537,7 +537,7 @@ TEST_F(SpdyFramerTest, FinOnDataFrame) {
// Test that the FIN flag on a SYN reply frame signifies EOF.
TEST_F(SpdyFramerTest, FinOnSynReplyFrame) {
const unsigned char input[] = {
- 0x80, 0x01, 0x00, 0x01, // SYN Stream #1
+ 0x80, 0x02, 0x00, 0x01, // SYN Stream #1
0x00, 0x00, 0x00, 0x14,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00,
@@ -545,7 +545,7 @@ TEST_F(SpdyFramerTest, FinOnSynReplyFrame) {
0x00, 0x02, 'h', 'h',
0x00, 0x02, 'v', 'v',
- 0x80, 0x01, 0x00, 0x02, // SYN REPLY Stream #1
+ 0x80, 0x02, 0x00, 0x02, // SYN REPLY Stream #1
0x01, 0x00, 0x00, 0x10,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01,
@@ -788,7 +788,7 @@ TEST_F(SpdyFramerTest, CreateSynStreamUncompressed) {
headers["foo"] = "bar";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x01,
+ 0x80, 0x02, 0x00, 0x01,
0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00,
@@ -815,7 +815,7 @@ TEST_F(SpdyFramerTest, CreateSynStreamUncompressed) {
headers["foo"] = "bar";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x01,
+ 0x80, 0x02, 0x00, 0x01,
0x01, 0x00, 0x00, 0x1D,
0x7f, 0xff, 0xff, 0xff,
0x7f, 0xff, 0xff, 0xff,
@@ -842,7 +842,7 @@ TEST_F(SpdyFramerTest, CreateSynStreamUncompressed) {
headers["foo"] = "";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x01,
+ 0x80, 0x02, 0x00, 0x01,
0x01, 0x00, 0x00, 0x1D,
0x7f, 0xff, 0xff, 0xff,
0x7f, 0xff, 0xff, 0xff,
@@ -873,7 +873,7 @@ TEST_F(SpdyFramerTest, CreateSynStreamCompressed) {
headers["foo"] = "bar";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x01,
+ 0x80, 0x02, 0x00, 0x01,
0x00, 0x00, 0x00, 0x25,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00,
@@ -905,7 +905,7 @@ TEST_F(SpdyFramerTest, CreateSynReplyUncompressed) {
headers["foo"] = "bar";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x02,
+ 0x80, 0x02, 0x00, 0x02,
0x00, 0x00, 0x00, 0x1C,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x02,
@@ -929,7 +929,7 @@ TEST_F(SpdyFramerTest, CreateSynReplyUncompressed) {
headers["foo"] = "bar";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x02,
+ 0x80, 0x02, 0x00, 0x02,
0x01, 0x00, 0x00, 0x19,
0x7f, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x02,
@@ -953,7 +953,7 @@ TEST_F(SpdyFramerTest, CreateSynReplyUncompressed) {
headers["foo"] = "";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x02,
+ 0x80, 0x02, 0x00, 0x02,
0x01, 0x00, 0x00, 0x19,
0x7f, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x02,
@@ -981,7 +981,7 @@ TEST_F(SpdyFramerTest, CreateSynReplyCompressed) {
headers["foo"] = "bar";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x02,
+ 0x80, 0x02, 0x00, 0x02,
0x00, 0x00, 0x00, 0x21,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x38, 0xea,
@@ -1005,7 +1005,7 @@ TEST_F(SpdyFramerTest, CreateRstStream) {
{
const char kDescription[] = "RST_STREAM frame";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x03,
+ 0x80, 0x02, 0x00, 0x03,
0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01,
@@ -1017,7 +1017,7 @@ TEST_F(SpdyFramerTest, CreateRstStream) {
{
const char kDescription[] = "RST_STREAM frame with max stream ID";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x03,
+ 0x80, 0x02, 0x00, 0x03,
0x00, 0x00, 0x00, 0x08,
0x7f, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x01,
@@ -1030,7 +1030,7 @@ TEST_F(SpdyFramerTest, CreateRstStream) {
{
const char kDescription[] = "RST_STREAM frame with max status code";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x03,
+ 0x80, 0x02, 0x00, 0x03,
0x00, 0x00, 0x00, 0x08,
0x7f, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x06,
@@ -1061,7 +1061,7 @@ TEST_F(SpdyFramerTest, CreateSettings) {
settings.push_back(SpdySetting(0x01000004, 0xffffffff));
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x04,
+ 0x80, 0x02, 0x00, 0x04,
0x00, 0x00, 0x00, 0x44,
0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x00,
@@ -1091,7 +1091,7 @@ TEST_F(SpdyFramerTest, CreateSettings) {
SpdySettings settings;
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x04,
+ 0x80, 0x02, 0x00, 0x04,
0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00,
};
@@ -1106,7 +1106,7 @@ TEST_F(SpdyFramerTest, CreateNopFrame) {
{
const char kDescription[] = "NOOP frame";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x05,
+ 0x80, 0x02, 0x00, 0x05,
0x00, 0x00, 0x00, 0x00,
};
scoped_ptr<SpdyFrame> frame(framer.CreateNopFrame());
@@ -1120,7 +1120,7 @@ TEST_F(SpdyFramerTest, CreateGoAway) {
{
const char kDescription[] = "GOAWAY frame";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x07,
+ 0x80, 0x02, 0x00, 0x07,
0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00,
};
@@ -1131,7 +1131,7 @@ TEST_F(SpdyFramerTest, CreateGoAway) {
{
const char kDescription[] = "GOAWAY frame with max stream ID";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x07,
+ 0x80, 0x02, 0x00, 0x07,
0x00, 0x00, 0x00, 0x04,
0x7f, 0xff, 0xff, 0xff,
};
@@ -1146,7 +1146,7 @@ TEST_F(SpdyFramerTest, CreateWindowUpdate) {
{
const char kDescription[] = "WINDOW_UPDATE frame";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x09,
+ 0x80, 0x02, 0x00, 0x09,
0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01,
@@ -1158,7 +1158,7 @@ TEST_F(SpdyFramerTest, CreateWindowUpdate) {
{
const char kDescription[] = "WINDOW_UPDATE frame with max stream ID";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x09,
+ 0x80, 0x02, 0x00, 0x09,
0x00, 0x00, 0x00, 0x08,
0x7f, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x01,
@@ -1170,7 +1170,7 @@ TEST_F(SpdyFramerTest, CreateWindowUpdate) {
{
const char kDescription[] = "WINDOW_UPDATE frame with max window delta";
const unsigned char kFrameData[] = {
- 0x80, 0x01, 0x00, 0x09,
+ 0x80, 0x02, 0x00, 0x09,
0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x01,
0x7f, 0xff, 0xff, 0xff,
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index 3ac38cb..8da5389 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -12,6 +12,11 @@
//-----------------------------------------------------------------------------
namespace net {
+
+// This is the expected list of advertised protocols from the browser's NPN
+// list.
+static const char kExpectedNPNString[] = "\x08http/1.1\x06spdy/2";
+
enum SpdyNetworkTransactionTestTypes {
SPDYNPN,
SPDYNOSSL,
@@ -76,10 +81,9 @@ class SpdyNetworkTransactionTest
case SPDYNPN:
session_->mutable_alternate_protocols()->SetAlternateProtocolFor(
HostPortPair("www.google.com", 80), 443,
- HttpAlternateProtocols::NPN_SPDY_1);
+ HttpAlternateProtocols::NPN_SPDY_2);
HttpNetworkTransaction::SetUseAlternateProtocols(true);
- HttpNetworkTransaction::SetNextProtos(
- "\x08http/1.1\x07http1.1\x06spdy/1\x04spdy");
+ HttpNetworkTransaction::SetNextProtos(kExpectedNPNString);
break;
case SPDYNOSSL:
HttpNetworkTransaction::SetUseSSLOverSpdyWithoutNPN(false);
@@ -181,7 +185,7 @@ class SpdyNetworkTransactionTest
new SSLSocketDataProvider(true, OK));
if(test_type_ == SPDYNPN) {
ssl_->next_proto_status = SSLClientSocket::kNextProtoNegotiated;
- ssl_->next_proto = "spdy/1";
+ ssl_->next_proto = "spdy/2";
ssl_->was_npn_negotiated = true;
}
ssl_vector_.push_back(ssl_);
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h
index 6b41e53..4637b5f 100644
--- a/net/spdy/spdy_protocol.h
+++ b/net/spdy/spdy_protocol.h
@@ -119,8 +119,8 @@
namespace spdy {
-// This implementation of Spdy is version 1.
-const int kSpdyProtocolVersion = 1;
+// The SPDY version of this implementation.
+const int kSpdyProtocolVersion = 2;
// Default initial window size.
const int kInitialWindowSize = 64 * 1024;