[Python-checkins] python/dist/src/Lib BaseHTTPServer.py,1.27,1.28
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Fri Aug 8 23:01:43 EDT 2003
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv1427
Modified Files:
BaseHTTPServer.py
Log Message:
SF patch #747364: BaseHTTPServer doesn't need StringIO intermediary
(Contributed by Andrew Dalke.)
Index: BaseHTTPServer.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/BaseHTTPServer.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** BaseHTTPServer.py 2 Jun 2003 14:25:43 -0000 1.27
--- BaseHTTPServer.py 9 Aug 2003 05:01:41 -0000 1.28
***************
*** 76,80 ****
import mimetools
import SocketServer
- import cStringIO
# Default error message
--- 76,79 ----
***************
*** 277,291 ****
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)
conntype = self.headers.get('Connection', "")
--- 276,281 ----
self.command, self.path, self.request_version = command, path, version
# Examine the headers and look for a Connection directive
! self.headers = self.MessageClass(self.rfile, 0)
conntype = self.headers.get('Connection', "")
More information about the Python-checkins
mailing list