diff options
author | Raymond Hettinger <python@rcn.com> | 2003-06-29 05:06:56 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-06-29 05:06:56 (GMT) |
commit | e2f18377ff21c0e3217d561c8509e6816ecb362d (patch) | |
tree | cd22efe60fc24595388e2056f4d028e44ee525f2 /Lib/CGIHTTPServer.py | |
parent | be2528d8668f9e4e1260ca156b9d1564c2f9f2ce (diff) | |
download | cpython-e2f18377ff21c0e3217d561c8509e6816ecb362d.zip cpython-e2f18377ff21c0e3217d561c8509e6816ecb362d.tar.gz cpython-e2f18377ff21c0e3217d561c8509e6816ecb362d.tar.bz2 |
SF bug #430160: CGIHTTPServer.py POST bug using IE
Minor improvement to previous bugfix.
Eating the remaining characters would lead to an endless loop
without a termination test.
Diffstat (limited to 'Lib/CGIHTTPServer.py')
-rw-r--r-- | Lib/CGIHTTPServer.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py index f14ebba..437ee80 100644 --- a/Lib/CGIHTTPServer.py +++ b/Lib/CGIHTTPServer.py @@ -202,7 +202,8 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): pid, sts = os.waitpid(pid, 0) # throw away additional data [see bug #427345] while select.select([self.rfile], [], [], 0)[0]: - waste = self.rfile.read(1) + if not self.rfile.read(1): + break if sts: self.log_error("CGI script exit status %#x", sts) return @@ -250,7 +251,8 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): fi.write(data) # throw away additional data [see bug #427345] while select.select([self.rfile._sock], [], [], 0)[0]: - waste = self.rfile._sock.recv(1) + if not self.rfile._sock.recv(1): + break fi.close() shutil.copyfileobj(fo, self.wfile) if self.have_popen3: |