We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a773018 commit 5216564Copy full SHA for 5216564
Lib/http/server.py
@@ -1293,6 +1293,11 @@ def finish_request():
1293
while select.select([self.rfile._sock], [], [], 0)[0]:
1294
if not self.rfile._sock.recv(1):
1295
break
1296
+ try:
1297
+ p.stdin.close()
1298
+ except OSError:
1299
+ # already closed?
1300
+ pass
1301
if self.command.lower() == "post" and nbytes > 0:
1302
def _in_task():
1303
"""Pipe the input into the process stdin"""
@@ -1312,11 +1317,6 @@ def _in_task():
1312
1317
bytes_left -= len(data)
1313
1318
p.stdin.write(data)
1314
1319
finish_request()
1315
- try:
1316
- p.stdin.close()
- except OSError:
- # already closed
- pass
1320
request_relay_thread = threading.Thread(target=_in_task)
1321
request_relay_thread.start()
1322
else:
0 commit comments