Skip to content

Commit f00ef9f

Browse files
[3.14] Try to fix the fix for gh-119452
1 parent b053c2a commit f00ef9f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/http/server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,16 +1288,16 @@ def run_cgi(self):
12881288
env = env
12891289
)
12901290
if self.command.lower() == "post" and nbytes > 0:
1291-
cursize = 0
1292-
data = self.rfile.read(min(nbytes, _MIN_READ_BUF_SIZE))
1293-
while (len(data) < nbytes and len(data) != cursize and
1291+
cursize = min(nbytes, _MIN_READ_BUF_SIZE)
1292+
data = self.rfile.read(cursize)
1293+
while (len(data) == cursize < nbytes and
12941294
select.select([self.rfile._sock], [], [], 0)[0]):
1295-
cursize = len(data)
12961295
# This is a geometric increase in read size (never more
12971296
# than doubling our the current length of data per loop
12981297
# iteration).
12991298
delta = min(cursize, nbytes - cursize)
13001299
data += self.rfile.read(delta)
1300+
cursize += delta
13011301
else:
13021302
data = None
13031303
# throw away additional data [see bug #427345]

0 commit comments

Comments
 (0)