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

Unified Diff: net/server/http_server_response_info.cc

Issue 296053012: Replace StreamListenSocket with StreamSocket in HttpServer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Redo changes reverted with unknown reason. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: net/server/http_server_response_info.cc
diff --git a/net/server/http_server_response_info.cc b/net/server/http_server_response_info.cc
index e4c6043aa8d627a76aed82eb08b774da55a91412..2d0a32e6cce1752ac56e828e7f4d96fc808506f8 100644
--- a/net/server/http_server_response_info.cc
+++ b/net/server/http_server_response_info.cc
@@ -41,8 +41,14 @@ void HttpServerResponseInfo::SetBody(const std::string& body,
const std::string& content_type) {
DCHECK(body_.empty());
body_ = body;
+ SetContentHeaders(body.length(), content_type);
+}
+
+void HttpServerResponseInfo::SetContentHeaders(
+ size_t content_length,
+ const std::string& content_type) {
AddHeader(HttpRequestHeaders::kContentLength,
- base::StringPrintf("%" PRIuS, body.length()));
+ base::StringPrintf("%" PRIuS, content_length));
AddHeader(HttpRequestHeaders::kContentType, content_type);
}

Powered by Google App Engine
This is Rietveld 408576698