cgi-io: close pipe descriptors early
authorJo-Philipp Wich <jo@mein.io>
Wed, 18 Dec 2019 08:32:38 +0000 (09:32 +0100)
committerJohn Crispin <john@phrozen.org>
Wed, 18 Dec 2019 10:00:15 +0000 (11:00 +0100)
commit988c9ae3568c3d9e7b720bd448880ce030c3cc48
treea370dcc1f806aeb67e6db23348709327e9d7f4ce
parentbd04a5d8dcc99d486f708af96b81f3cb66f1903e
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>
Makefile
src/main.c