| 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 #include "net/tools/quic/spdy_utils.h" | 5 #include "net/tools/quic/spdy_utils.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 BalsaHeaders* request_headers) { | 243 BalsaHeaders* request_headers) { |
| 244 typedef SpdyHeaderBlock::const_iterator BlockIt; | 244 typedef SpdyHeaderBlock::const_iterator BlockIt; |
| 245 | 245 |
| 246 BlockIt status_it = header_block.find(kV3Status); | 246 BlockIt status_it = header_block.find(kV3Status); |
| 247 BlockIt version_it = header_block.find(kV3Version); | 247 BlockIt version_it = header_block.find(kV3Version); |
| 248 BlockIt end_it = header_block.end(); | 248 BlockIt end_it = header_block.end(); |
| 249 if (status_it == end_it || version_it == end_it) { | 249 if (status_it == end_it || version_it == end_it) { |
| 250 return false; | 250 return false; |
| 251 } | 251 } |
| 252 | 252 |
| 253 request_headers->SetRequestVersion(version_it->second); | |
| 254 if (!ParseReasonAndStatus(status_it->second, request_headers)) { | 253 if (!ParseReasonAndStatus(status_it->second, request_headers)) { |
| 255 return false; | 254 return false; |
| 256 } | 255 } |
| 256 request_headers->SetResponseVersion(version_it->second); |
| 257 for (BlockIt it = header_block.begin(); it != header_block.end(); ++it) { | 257 for (BlockIt it = header_block.begin(); it != header_block.end(); ++it) { |
| 258 if (!IsSpecialSpdyHeader(it, request_headers)) { | 258 if (!IsSpecialSpdyHeader(it, request_headers)) { |
| 259 request_headers->AppendHeader(it->first, it->second); | 259 request_headers->AppendHeader(it->first, it->second); |
| 260 } | 260 } |
| 261 } | 261 } |
| 262 return true; | 262 return true; |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace tools | 265 } // namespace tools |
| 266 } // namespace net | 266 } // namespace net |
| OLD | NEW |