POST with a CGI script causing NS_ERROR_NET_RESET
Brought to you by:
reinux
There is a bug when using POST with a CGI script, this is causing NS_ERROR_NET_RESET.
The problem lies in the do_cgi function: after processing POST input, it calls finish_request(0) prematurely, executing a shutdown on the connection before the CGI script has had a chance to send a response, causing the browser to report NS_ERROR_NET_RESET or connection reset.
Patch content (applicable to most versions, including v1.30):
--- mini_httpd.c.org
+++ mini_httpd.c
@@ -1842,7 +1842,8 @@
/* Interposer process. */
(void) close( p[0] );
cgi_interpose_input( p[1] );