This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author shajianrui
Recipients georg.brandl, shajianrui, vsbogd
Date 2019-06-19.16:04:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1560960276.62.0.146687755948.issue37301@roundup.psfhosted.org>
In-reply-to
Content
Yes I reproduce this problem with a slight modification to your demo. 

Using your origianl version I fail to reproduce, maybe 2*65536 bytes size is too small.

I just change the size of data (in test_cgi_client.py ) to 8*65536, 16*65536 and 32*65536, and the result is shown on the image I attach.

From the image you can see
    - From 1 to 7 the length received doesn't change: always
      195540 bytes.And the process of sending are really slow.
    - At 8th test the server receive complete data. And the 
      sending is finished in a flash.(Maybe the socket suddenly
      enlarge the buffer?)
    - From 9 to 10 seems the "buffer" become smaller and smaller.

However, in my demo(Post in my last message), the data can be up to 65536*1024 bytes and 【seldom】 produce this problem.

I use "seldom" because I now confirm: If too many (more than 10) testclient.py are executed at the same time, the testserver.py will produce the problem too. Like this:

    testserver.py output:
                Connection closed.
                67108864
                0
                Connection closed.
                67108864
                0
                Connection closed.
                67108864
                0
                Connection closed.
                195640               # From here the problem show up.
                42440740
                2035240
                9327940
                13074300
                35004
                0
                Connection closed.
                67108864
                0
                Connection closed.

Seems this is a normal behavior of rfile.read() that it may not return as many bytes as we tell it to read.

Now I have a problem: Why the bytes returned from "rfile.read()" is so few when the rfile is in CGIHTTPRequestHandler?
History
Date User Action Args
2019-06-19 16:04:36shajianruisetrecipients: + shajianrui, georg.brandl, vsbogd
2019-06-19 16:04:36shajianruisetmessageid: <1560960276.62.0.146687755948.issue37301@roundup.psfhosted.org>
2019-06-19 16:04:36shajianruilinkissue37301 messages
2019-06-19 16:04:36shajianruicreate