| Index: net/spdy/hpack_encoder.cc
|
| diff --git a/net/spdy/hpack_encoder.cc b/net/spdy/hpack_encoder.cc
|
| index 6cb8fad954161470b543eb8ddfc4e2ea194d27a7..64643ff75cae8262c1c03a8a4ec81a974432f4e2 100644
|
| --- a/net/spdy/hpack_encoder.cc
|
| +++ b/net/spdy/hpack_encoder.cc
|
| @@ -37,11 +37,9 @@ bool HpackEncoder::EncodeHeaderSet(const std::map<string, string>& header_set,
|
| // a map.
|
| CookieToCrumbs(*it, ®ular_headers);
|
| } else if (it->first[0] == kPseudoHeaderPrefix) {
|
| - pseudo_headers.push_back(make_pair(
|
| - StringPiece(it->first), StringPiece(it->second)));
|
| + DecomposeRepresentation(*it, &pseudo_headers);
|
| } else {
|
| - regular_headers.push_back(make_pair(
|
| - StringPiece(it->first), StringPiece(it->second)));
|
| + DecomposeRepresentation(*it, ®ular_headers);
|
| }
|
| }
|
|
|
| @@ -200,4 +198,17 @@ void HpackEncoder::CookieToCrumbs(const Representation& cookie,
|
| out->end());
|
| }
|
|
|
| +// static
|
| +void HpackEncoder::DecomposeRepresentation(const Representation& header_field,
|
| + Representations* out) {
|
| + size_t pos = 0;
|
| + size_t end = 0;
|
| + while (end != StringPiece::npos) {
|
| + end = header_field.second.find('\0', pos);
|
| + out->push_back(make_pair(header_field.first,
|
| + header_field.second.substr(pos, end - pos)));
|
| + pos = end + 1;
|
| + }
|
| +}
|
| +
|
| } // namespace net
|
|
|