summaryrefslogtreecommitdiff
path: root/Lib/BaseHTTPServer.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-08-09 05:01:41 +0000
committerRaymond Hettinger <python@rcn.com>2003-08-09 05:01:41 +0000
commit1755da915d631e17de92338f0b10023ccc4c1f5e (patch)
tree9c4604f0356747bdefc84e52318eb3e6352bf880 /Lib/BaseHTTPServer.py
parent552fd9f4eeb7587679e4062e36dde3b304dd9e87 (diff)
downloadcpython-1755da915d631e17de92338f0b10023ccc4c1f5e.tar.gz
SF patch #747364: BaseHTTPServer doesn't need StringIO intermediary
(Contributed by Andrew Dalke.)
Diffstat (limited to 'Lib/BaseHTTPServer.py')
-rw-r--r--Lib/BaseHTTPServer.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/Lib/BaseHTTPServer.py b/Lib/BaseHTTPServer.py
index edb15ab430..15e7525e0b 100644
--- a/Lib/BaseHTTPServer.py
+++ b/Lib/BaseHTTPServer.py
@@ -75,7 +75,6 @@ import time
import socket # For gethostbyaddr()
import mimetools
import SocketServer
-import cStringIO
# Default error message
DEFAULT_ERROR_MESSAGE = """\
@@ -276,17 +275,8 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
return False
self.command, self.path, self.request_version = command, path, version
- # Deal with pipelining
- bytes = ""
- while 1:
- line = self.rfile.readline()
- bytes = bytes + line
- if line == '\r\n' or line == '\n' or line == '':
- break
-
# Examine the headers and look for a Connection directive
- hfile = cStringIO.StringIO(bytes)
- self.headers = self.MessageClass(hfile)
+ self.headers = self.MessageClass(self.rfile, 0)
conntype = self.headers.get('Connection', "")
if conntype.lower() == 'close':