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

Unified Diff: net/server/http_server.cc

Issue 212683006: HttpServer: allows sending raw response data for nontypical responses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replaces request+connection with std::pair. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: net/server/http_server.cc
diff --git a/net/server/http_server.cc b/net/server/http_server.cc
index 85797b90c96ae2ed32f9139ce14ea65ee90096fd..df77c3672daa423fe54127495aa18b7a4262a104 100644
--- a/net/server/http_server.cc
+++ b/net/server/http_server.cc
@@ -47,6 +47,13 @@ void HttpServer::SendOverWebSocket(int connection_id,
connection->web_socket_->Send(data);
}
+void HttpServer::SendRaw(int connection_id, const std::string& data) {
+ HttpConnection* connection = FindConnection(connection_id);
+ if (connection == NULL)
+ return;
+ connection->Send(data);
+}
+
void HttpServer::SendResponse(int connection_id,
const HttpServerResponseInfo& response) {
HttpConnection* connection = FindConnection(connection_id);

Powered by Google App Engine
This is Rietveld 408576698