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

Side by Side Diff: net/spdy/spdy_http_utils.cc

Issue 6292013: Add chunked uploads support to SPDY (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/spdy/spdy_http_utils.h" 5 #include "net/spdy/spdy_http_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info, 78 void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
79 const HttpRequestHeaders& request_headers, 79 const HttpRequestHeaders& request_headers,
80 spdy::SpdyHeaderBlock* headers, 80 spdy::SpdyHeaderBlock* headers,
81 bool direct) { 81 bool direct) {
82 82
83 HttpRequestHeaders::Iterator it(request_headers); 83 HttpRequestHeaders::Iterator it(request_headers);
84 while (it.GetNext()) { 84 while (it.GetNext()) {
85 std::string name = StringToLowerASCII(it.name()); 85 std::string name = StringToLowerASCII(it.name());
86 if (name == "connection" || name == "proxy-connection") 86 if (name == "connection" || name == "proxy-connection" ||
87 name == "transfer-encoding") {
87 continue; 88 continue;
89 }
88 if (headers->find(name) == headers->end()) { 90 if (headers->find(name) == headers->end()) {
89 (*headers)[name] = it.value(); 91 (*headers)[name] = it.value();
90 } else { 92 } else {
91 std::string new_value = (*headers)[name]; 93 std::string new_value = (*headers)[name];
92 new_value.append(1, '\0'); // +=() doesn't append 0's 94 new_value.append(1, '\0'); // +=() doesn't append 0's
93 new_value += it.value(); 95 new_value += it.value();
94 (*headers)[name] = new_value; 96 (*headers)[name] = new_value;
95 } 97 }
96 } 98 }
97 static const char kHttpProtocolVersion[] = "HTTP/1.1"; 99 static const char kHttpProtocolVersion[] = "HTTP/1.1";
(...skipping 17 matching lines...) Expand all
115 case LOWEST: 117 case LOWEST:
116 return SPDY_PRIORITY_LOWEST - 1; 118 return SPDY_PRIORITY_LOWEST - 1;
117 case IDLE: 119 case IDLE:
118 return SPDY_PRIORITY_LOWEST; 120 return SPDY_PRIORITY_LOWEST;
119 default: 121 default:
120 return priority; 122 return priority;
121 } 123 }
122 } 124 }
123 125
124 } // namespace net 126 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698