Re: post not work mini_httpd

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Mon, 06 Mar 2023 16:37:49 UTC
Hi,

It seems mini_httpd is not in base. Is it in ports ?

If yes I think you should contact the author or maintainer for support. 

> On Feb 26, 2023, at 6:29 AM, Mori Hiroki <yamori813@yahoo.co.jp> wrote:
> 
> Hi
> 
> I use mini_httpd on RT3050.
> 
> I try this cgi.
> 
> #!/bin/sh                                                                                                                 
> 
> echo "Content-Type: text/html"
> echo ""
> echo "OK"
> 
> if [ "${REQUEST_METHOD}" = "POST"  ]; then
> echo `cat` > /tmp/xxx
> fi
> 
> This cgi work on GET but not work on POST.
> Firefox say connection reset.
> 
> I seem FreeBSD/amd64 is same.
> 
> This is patch.
> 
> --- mini_httpd.c.org    2018-10-27 04:47:50.000000000 +0900
> +++ mini_httpd.c        2023-02-26 07:25:15.504936000 +0900
> @@ -1842,7 +1842,8 @@
>            /* Interposer process. */
>            (void) close( p[0] );
>            cgi_interpose_input( p[1] );
> -           finish_request( 0 );
> +//         finish_request( 0 );
> +           exit ( 0 );
>            }
>        (void) close( p[1] );
>        if ( p[0] != STDIN_FILENO )
> 
> Work fine both.
> 
> Regards..
> 
> Hiroki Mori
> 
> 

Best regards,
Zhenlei