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 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ | 5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ |
6 #define NET_QUIC_QUIC_PROTOCOL_H_ | 6 #define NET_QUIC_QUIC_PROTOCOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // We match SPDY's use of 32 (since we'd compete with SPDY). | 68 // We match SPDY's use of 32 (since we'd compete with SPDY). |
69 const QuicPacketCount kInitialCongestionWindow = 32; | 69 const QuicPacketCount kInitialCongestionWindow = 32; |
70 | 70 |
71 // Minimum size of initial flow control window, for both stream and session. | 71 // Minimum size of initial flow control window, for both stream and session. |
72 const uint32_t kMinimumFlowControlSendWindow = 16 * 1024; // 16 KB | 72 const uint32_t kMinimumFlowControlSendWindow = 16 * 1024; // 16 KB |
73 | 73 |
74 // Maximum flow control receive window limits for connection and stream. | 74 // Maximum flow control receive window limits for connection and stream. |
75 const QuicByteCount kStreamReceiveWindowLimit = 16 * 1024 * 1024; // 16 MB | 75 const QuicByteCount kStreamReceiveWindowLimit = 16 * 1024 * 1024; // 16 MB |
76 const QuicByteCount kSessionReceiveWindowLimit = 24 * 1024 * 1024; // 24 MB | 76 const QuicByteCount kSessionReceiveWindowLimit = 24 * 1024 * 1024; // 24 MB |
77 | 77 |
| 78 // Default limit on the size of uncompressed headers. |
| 79 const QuicByteCount kDefaultMaxUncompressedHeaderSize = 16 * 1024; // 16 KB |
| 80 |
| 81 // Minimum size of the CWND, in packets, when doing bandwidth resumption. |
| 82 const QuicPacketCount kMinCongestionWindowForBandwidthResumption = 10; |
| 83 |
78 // Maximum number of tracked packets. | 84 // Maximum number of tracked packets. |
79 const QuicPacketCount kMaxTrackedPackets = 10000; | 85 const QuicPacketCount kMaxTrackedPackets = 10000; |
80 | 86 |
81 // Default size of the socket receive buffer in bytes. | 87 // Default size of the socket receive buffer in bytes. |
82 const QuicByteCount kDefaultSocketReceiveBuffer = 1024 * 1024; | 88 const QuicByteCount kDefaultSocketReceiveBuffer = 1024 * 1024; |
83 | 89 |
84 // Don't allow a client to suggest an RTT shorter than 10ms. | 90 // Don't allow a client to suggest an RTT shorter than 10ms. |
85 const uint32_t kMinInitialRoundTripTimeUs = 10 * kNumMicrosPerMilli; | 91 const uint32_t kMinInitialRoundTripTimeUs = 10 * kNumMicrosPerMilli; |
86 | 92 |
87 // Don't allow a client to suggest an RTT longer than 15 seconds. | 93 // Don't allow a client to suggest an RTT longer than 15 seconds. |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 // Server is not authoritative for this URL. | 480 // Server is not authoritative for this URL. |
475 QUIC_UNAUTHORIZED_PROMISE_URL, | 481 QUIC_UNAUTHORIZED_PROMISE_URL, |
476 // Can't have more than one active PUSH_PROMISE per URL. | 482 // Can't have more than one active PUSH_PROMISE per URL. |
477 QUIC_DUPLICATE_PROMISE_URL, | 483 QUIC_DUPLICATE_PROMISE_URL, |
478 // Vary check failed. | 484 // Vary check failed. |
479 QUIC_PROMISE_VARY_MISMATCH, | 485 QUIC_PROMISE_VARY_MISMATCH, |
480 // Only GET and HEAD methods allowed. | 486 // Only GET and HEAD methods allowed. |
481 QUIC_INVALID_PROMISE_METHOD, | 487 QUIC_INVALID_PROMISE_METHOD, |
482 // The push stream is unclaimed and timed out. | 488 // The push stream is unclaimed and timed out. |
483 QUIC_PUSH_STREAM_TIMED_OUT, | 489 QUIC_PUSH_STREAM_TIMED_OUT, |
| 490 // Received headers were too large. |
| 491 QUIC_HEADERS_TOO_LARGE, |
484 // No error. Used as bound while iterating. | 492 // No error. Used as bound while iterating. |
485 QUIC_STREAM_LAST_ERROR, | 493 QUIC_STREAM_LAST_ERROR, |
486 }; | 494 }; |
487 // QUIC error codes are encoded to a single octet on-the-wire. | 495 // QUIC error codes are encoded to a single octet on-the-wire. |
488 static_assert(static_cast<int>(QUIC_STREAM_LAST_ERROR) <= | 496 static_assert(static_cast<int>(QUIC_STREAM_LAST_ERROR) <= |
489 std::numeric_limits<uint8_t>::max(), | 497 std::numeric_limits<uint8_t>::max(), |
490 "QuicErrorCode exceeds single octet"); | 498 "QuicErrorCode exceeds single octet"); |
491 | 499 |
492 // These values must remain stable as they are uploaded to UMA histograms. | 500 // These values must remain stable as they are uploaded to UMA histograms. |
493 // To add a new error code, use the current value of QUIC_LAST_ERROR and | 501 // To add a new error code, use the current value of QUIC_LAST_ERROR and |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 : iov(iov), iov_count(iov_count), total_length(total_length) {} | 1519 : iov(iov), iov_count(iov_count), total_length(total_length) {} |
1512 | 1520 |
1513 const struct iovec* iov; | 1521 const struct iovec* iov; |
1514 const int iov_count; | 1522 const int iov_count; |
1515 const size_t total_length; | 1523 const size_t total_length; |
1516 }; | 1524 }; |
1517 | 1525 |
1518 } // namespace net | 1526 } // namespace net |
1519 | 1527 |
1520 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1528 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |