cgi-io: close pipe descriptors early
authorJo-Philipp Wich <jo@mein.io>
Wed, 18 Dec 2019 08:32:38 +0000 (09:32 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 18 Dec 2019 16:11:14 +0000 (17:11 +0100)
commitf57ca519acc293314a6ada5b9f4cad4b2d61dbf1
treec3e67d093a8049fc07bbcd94cf0dc15fa6bb8d80
parent9e434da4e08e987570a5ddaec17cc5cb14850e45
cgi-io: close pipe descriptors early

In the command read side, close the superfluous write end of the pipe
early to ensure that EOF is reliably detected. Without that change, splice
calls to read from the pipe will occasionally hang until the CGI process
is eventually killed due to timeout.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit dde503da13d5d0541187e81eda15e7693f38cb4f)
net/cgi-io/Makefile
net/cgi-io/src/main.c