| Index: net/quic/core/spdy_utils.cc
|
| diff --git a/net/quic/core/spdy_utils.cc b/net/quic/core/spdy_utils.cc
|
| index cf16e347fff465f8078d1977a3028d040914ba24..5ad6a43a5cdb6f2f78111f65b57fb06477dde15a 100644
|
| --- a/net/quic/core/spdy_utils.cc
|
| +++ b/net/quic/core/spdy_utils.cc
|
| @@ -32,24 +32,6 @@ string SpdyUtils::SerializeUncompressedHeaders(const SpdyHeaderBlock& headers) {
|
| }
|
|
|
| // static
|
| -bool SpdyUtils::ParseHeaders(const char* data,
|
| - uint32_t data_len,
|
| - int64_t* content_length,
|
| - SpdyHeaderBlock* headers) {
|
| - SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION);
|
| - if (!framer.ParseHeaderBlockInBuffer(data, data_len, headers) ||
|
| - headers->empty()) {
|
| - return false; // Headers were invalid.
|
| - }
|
| -
|
| - if (!QuicContainsKey(*headers, "content-length")) {
|
| - return true;
|
| - }
|
| -
|
| - return ExtractContentLengthFromHeaders(content_length, headers);
|
| -}
|
| -
|
| -// static
|
| bool SpdyUtils::ExtractContentLengthFromHeaders(int64_t* content_length,
|
| SpdyHeaderBlock* headers) {
|
| auto it = headers->find("content-length");
|
| @@ -83,47 +65,6 @@ bool SpdyUtils::ExtractContentLengthFromHeaders(int64_t* content_length,
|
| }
|
| }
|
|
|
| -// static
|
| -bool SpdyUtils::ParseTrailers(const char* data,
|
| - uint32_t data_len,
|
| - size_t* final_byte_offset,
|
| - SpdyHeaderBlock* trailers) {
|
| - SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION);
|
| - if (!framer.ParseHeaderBlockInBuffer(data, data_len, trailers) ||
|
| - trailers->empty()) {
|
| - QUIC_DVLOG(1) << "Request Trailers are invalid.";
|
| - return false; // Trailers were invalid.
|
| - }
|
| -
|
| - // Pull out the final offset pseudo header which indicates the number of
|
| - // response body bytes expected.
|
| - auto it = trailers->find(kFinalOffsetHeaderKey);
|
| - if (it == trailers->end() ||
|
| - !QuicTextUtils::StringToSizeT(it->second, final_byte_offset)) {
|
| - QUIC_DLOG(ERROR) << "Required key '" << kFinalOffsetHeaderKey
|
| - << "' not present";
|
| - return false;
|
| - }
|
| - // The final offset header is no longer needed.
|
| - trailers->erase(it->first);
|
| -
|
| - // Trailers must not have empty keys, and must not contain pseudo headers.
|
| - for (const auto& trailer : *trailers) {
|
| - QuicStringPiece key = trailer.first;
|
| - QuicStringPiece value = trailer.second;
|
| - if (QuicTextUtils::StartsWith(key, ":")) {
|
| - QUIC_DVLOG(1) << "Trailers must not contain pseudo-header: '" << key
|
| - << "','" << value << "'.";
|
| - return false;
|
| - }
|
| -
|
| - // TODO(rjshade): Check for other forbidden keys, following the HTTP/2 spec.
|
| - }
|
| -
|
| - QUIC_DVLOG(1) << "Successfully parsed Trailers: " << trailers->DebugString();
|
| - return true;
|
| -}
|
| -
|
| bool SpdyUtils::CopyAndValidateHeaders(const QuicHeaderList& header_list,
|
| int64_t* content_length,
|
| SpdyHeaderBlock* headers) {
|
|
|