From: Guido van Rossum Date: Fri, 1 Sep 2000 03:27:34 +0000 (+0000) Subject: Now that StreamRequestHandler defaults rfile to buffered, make it X-Git-Tag: v2.0b1~99 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6aefd91c7f4f446dc6ea95ea00c62fc847ce886a;p=thirdparty%2FPython%2Fcpython.git Now that StreamRequestHandler defaults rfile to buffered, make it unbuffered (by setting the class variable rbufsize to 0), because we (may) need to pass the file descriptor to the subprocess running the CGI script positioned after the headers. --- diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py index fa30cbdddae2..6a259a32daaf 100644 --- a/Lib/CGIHTTPServer.py +++ b/Lib/CGIHTTPServer.py @@ -35,6 +35,10 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): """ + # Make rfile unbuffered -- we need to read one line and then pass + # the rest to a subprocess, so we can't use buffered input. + rbufsize = 0 + def do_POST(self): """Serve a POST request.