vsbogd added the comment:
My last comment was imprecise. Not `CGIHTTPRequestHandler` reads data from
`rfile` but CGI script itself makes few reads.
--
___
Python tracker
<https://bugs.python.org/issue37
vsbogd added the comment:
Hi @shajianrui,
Thank you for such detailed explanation of experiments.
As you mentioned it is a expected behavior of the io.RawIOBase.read() (see
https://docs.python.org/3/library/io.html#io.RawIOBase), but
io.BufferedIOBase.read() has different behavior (see
vsbogd added the comment:
Hmm, seems strange I will try to reproduce and look at it.
Have you run my demo which is attached to the bug? Does it reproduce problem on
your machine?
--
___
Python tracker
<https://bugs.python.org/issue37
vsbogd added the comment:
Yeah, I have seen this comment as well. As I see this code for the first time I
am not very familiar with it.
It seems that this explanation is related to the case when non-Python CGI
script is executed:
os.dup2(self.rfile.fileno(), 0
vsbogd added the comment:
Analysis:
self.rfile.read(nbytes)
https://github.com/python/cpython/blob/3a1d50e7e573efb577714146bed5c03b9c95f466/Lib/http/server.py#L1207
Doesn't read full content of the file but only first chunk because self.rfile
is not BufferedIO instance. In fact
New submission from vsbogd :
Steps to reproduce: Use POST request with "multipart/form-data" encoding to
pass long (more than 64KiB) file to the CGI script.
Expected result: Script receives the whole file.
Actual result: Script receives only first part which size is about size o