Commits

Robert Brewer committed 1ca639c

Comment improvements.

Comments (0)

Files changed (3)

         """Obtain an HTTP Request object.
         
         client_address: the (IP address, port) of the client
-        remote_host: the IP address of the client
+        remote_host should be the client's host name. If not available
+            (because no reverse DNS lookup is performed), the client
+            IP should be provided.
         scheme: either "http" or "https"; defaults to "http"
         """
         if self.state == STOPPED:
     def __init__(self, remote_addr, remote_port, remote_host, scheme="http"):
         """Populate a new Request object.
         
-        remote_addr should be the client IP address
-        remote_port should be the client Port
-        remote_host should be string of the client's IP address.
+        remote_addr should be the client IP address.
+        remote_port should be the client Port.
+        remote_host should be the client's host name. If not available
+            (because no reverse DNS lookup is performed), the client
+            IP should be provided.
         scheme should be a string, either "http" or "https".
         """
         self.remote_addr = remote_addr
         
         request_line should be of the form "GET /path HTTP/1.0".
         headers should be a list of (name, value) tuples.
-        rfile should be a file-like object containing the HTTP request
-            entity.
+        rfile should be a file-like object containing the HTTP request entity.
         
         When run() is done, the returned object should have 3 attributes:
           status, e.g. "200 OK"
             # Get the 'Host' header, so we can do HTTPRedirects properly.
             self.process_headers()
             
-            # path_info should be the path from the app
-            # root (script_name) to the handler.
+            # path_info should be the path from the
+            # app root (script_name) to the handler.
             self.script_name = r = cherrypy.tree.script_name(self.path)
             self.app = cherrypy.tree.apps[r]
             self.path_info = self.path[len(r.rstrip("/")):]
     
     request = None
     try:
-        # LOGON_USER is served by IIS, and is the name of the
-        # user after having been mapped to a local account.
-        # Both IIS and Apache set REMOTE_USER, when possible.
         env = environ.get
         clientAddr = (env('REMOTE_ADDR', ''), int(env('REMOTE_PORT', -1)))
         request = cherrypy.engine.request(clientAddr, env('REMOTE_ADDR', ''),
                                           environ['wsgi.url_scheme'])
+        
+        # LOGON_USER is served by IIS, and is the name of the
+        # user after having been mapped to a local account.
+        # Both IIS and Apache set REMOTE_USER, when possible.
         request.login = (env('LOGON_USER') or env('REMOTE_USER') or None)
+        
         request.multithread = environ['wsgi.multithread']
         request.multiprocess = environ['wsgi.multiprocess']
         request.wsgi_environ = environ