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

Side by Side Diff: net/quic/spdy_utils.h

Issue 1494403002: Adds a ParseTrailers method to SpdyUtils, with some basic validation of the header keys provided. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@108694474
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/spdy_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_SPDY_UTILS_H_ 5 #ifndef NET_QUIC_SPDY_UTILS_H_
6 #define NET_QUIC_SPDY_UTILS_H_ 6 #define NET_QUIC_SPDY_UTILS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 11 matching lines...) Expand all
22 // Parses |data| as a std::string containing serialized HTTP/2 HEADERS frame, 22 // Parses |data| as a std::string containing serialized HTTP/2 HEADERS frame,
23 // populating |headers| with the key->value std:pairs found. 23 // populating |headers| with the key->value std:pairs found.
24 // |content_length| will be populated with the value of the content-length 24 // |content_length| will be populated with the value of the content-length
25 // header if one or more are present. 25 // header if one or more are present.
26 // Returns true on success, false if parsing fails, or invalid keys are found. 26 // Returns true on success, false if parsing fails, or invalid keys are found.
27 static bool ParseHeaders(const char* data, 27 static bool ParseHeaders(const char* data,
28 uint32 data_len, 28 uint32 data_len,
29 int* content_length, 29 int* content_length,
30 SpdyHeaderBlock* headers); 30 SpdyHeaderBlock* headers);
31 31
32 // Parses |data| as a std::string containing serialized HTTP/2 HEADERS frame,
33 // populating |trailers| with the key->value std:pairs found.
34 // The :final-offset header will be excluded from |trailers|, and instead the
35 // value will be copied to |final_byte_offset|.
36 // Returns true on success, false if parsing fails, or invalid keys are found.
37 static bool ParseTrailers(const char* data,
38 uint32 data_len,
39 size_t* final_byte_offset,
40 SpdyHeaderBlock* trailers);
41
32 private: 42 private:
33 DISALLOW_COPY_AND_ASSIGN(SpdyUtils); 43 DISALLOW_COPY_AND_ASSIGN(SpdyUtils);
34 }; 44 };
35 45
36 } // namespace net 46 } // namespace net
37 47
38 #endif // NET_QUIC_SPDY_UTILS_H_ 48 #endif // NET_QUIC_SPDY_UTILS_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/spdy_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698