Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: net/spdy/spdy_framer.h

Issue 675863002: Code cleanup of control frame size enforcement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/spdy/spdy_framer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.h
diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h
index 99db36a417433fdf0406ff758308c073afa52638..29cab72e7c7b38b894f23b5ff2b8665918d06dd5 100644
--- a/net/spdy/spdy_framer.h
+++ b/net/spdy/spdy_framer.h
@@ -709,36 +709,18 @@ class NET_EXPORT_PRIVATE SpdyFramer {
// Set the error code and moves the framer into the error state.
void set_error(SpdyError error);
- // The maximum size of the control frames that we support.
- // This limit is arbitrary. We can enforce it here or at the application
- // layer. We chose the framing layer, but this can be changed (or removed)
- // if necessary later down the line.
- size_t GetControlFrameBufferMaxSize() const {
- // The theoretical maximum for SPDY3 and earlier is (2^24 - 1) +
- // 8, since the length field does not count the size of the
- // header.
- if (spdy_version_ == SPDY2) {
- return 64 * 1024;
- }
- if (spdy_version_ == SPDY3) {
- return 16 * 1024 * 1024;
- }
- // Absolute maximum size of HTTP2 frame payload (section 4.2 "Frame size").
- return (1<<14) - 1;
- }
-
- // TODO(jgraettinger): For h2-13 interop testing coverage,
- // fragment at smaller payload boundaries.
Bence 2016/02/09 15:28:09 Okay, so this was the original motivation for frag
- size_t GetHeaderFragmentMaxSize() const {
- return GetControlFrameBufferMaxSize() >> 4; // 1023 bytes.
- }
-
// The size of the control frame buffer.
// Since this is only used for control frame headers, the maximum control
// frame header size (SYN_STREAM) is sufficient; all remaining control
// frame data is streamed to the visitor.
static const size_t kControlFrameBufferSize;
+ // The maximum size of the control frames that we support.
+ // This limit is arbitrary. We can enforce it here or at the application
+ // layer. We chose the framing layer, but this can be changed (or removed)
+ // if necessary later down the line.
+ static const size_t kMaxControlFrameSize;
+
SpdyState state_;
SpdyState previous_state_;
SpdyError error_code_;
« no previous file with comments | « no previous file | net/spdy/spdy_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698