Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6aefd91

Browse files
committed
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.
1 parent 01fed4d commit 6aefd91

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/CGIHTTPServer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
3535
3636
"""
3737

38+
# Make rfile unbuffered -- we need to read one line and then pass
39+
# the rest to a subprocess, so we can't use buffered input.
40+
rbufsize = 0
41+
3842
def do_POST(self):
3943
"""Serve a POST request.
4044

0 commit comments

Comments
 (0)