Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3828)

Unified Diff: Lib/http/server.py

Issue 6085: Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag
Patch Set: Created 1 year, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Doc/library/http.server.rst ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -558,15 +558,9 @@
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
def address_string(self):
- """Return the client address formatted for logging.
+ """Return the client address."""
- This version looks up the full hostname using gethostbyaddr(),
- and tries to find a name that contains at least one dot.
-
- """
-
- host, port = self.client_address[:2]
- return socket.getfqdn(host)
+ return self.client_address[0]
# Essentially static class variables
@@ -1035,9 +1029,6 @@
env['SCRIPT_NAME'] = scriptname
if query:
env['QUERY_STRING'] = query
- host = self.address_string()
- if host != self.client_address[0]:
- env['REMOTE_HOST'] = host
env['REMOTE_ADDR'] = self.client_address[0]
authorization = self.headers.get("authorization")
if authorization:
« no previous file with comments | « Doc/library/http.server.rst ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7