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

Unified Diff: net/server/http_server.cc

Issue 181063006: Gets the peer address (if available) in server requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated commit message, minor CR fix. 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
« no previous file with comments | « no previous file | net/server/http_server_request_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/server/http_server.cc
diff --git a/net/server/http_server.cc b/net/server/http_server.cc
index a51feb84401e4ebf7c3ce370e423ee04ab34be89..57cbd592c499dd67e13a2d22c9e89809f59bacc0 100644
--- a/net/server/http_server.cc
+++ b/net/server/http_server.cc
@@ -132,6 +132,9 @@ void HttpServer::DidRead(StreamListenSocket* socket,
if (!ParseHeaders(connection, &request, &pos))
break;
+ // Sets peer address if exists.
+ socket->GetPeerAddress(&request.peer);
+
std::string connection_header = request.GetHeaderValue("connection");
if (connection_header == "Upgrade") {
connection->web_socket_.reset(WebSocket::CreateWebSocket(connection,
« no previous file with comments | « no previous file | net/server/http_server_request_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698