From 6aefd91c7f4f446dc6ea95ea00c62fc847ce886a Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 1 Sep 2000 03:27:34 +0000 Subject: [PATCH] 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. --- Lib/CGIHTTPServer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py index fa30cbdddae..6a259a32daa 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.