Minor refactoring.
This commit is contained in:
parent
abe335e57d
commit
5d4c7829bf
|
@ -248,6 +248,9 @@ def read_http_body_response(rfile, headers, all, limit):
|
|||
|
||||
|
||||
def read_response(rfile, method, body_size_limit):
|
||||
"""
|
||||
Return an (httpversion, code, msg, headers, content) tuple.
|
||||
"""
|
||||
line = rfile.readline()
|
||||
if line == "\r\n" or line == "\n": # Possible leftover from previous message
|
||||
line = rfile.readline()
|
||||
|
|
|
@ -156,8 +156,8 @@ class TCPServer:
|
|||
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
self.socket.bind(self.server_address)
|
||||
self.server_address = self.socket.getsockname()
|
||||
self.port = self.server_address[1]
|
||||
self.socket.listen(self.request_queue_size)
|
||||
self.port = self.socket.getsockname()[1]
|
||||
|
||||
def request_thread(self, request, client_address):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue