Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Feb 2023 07:29:20 +0900 (JST)
From:      Mori Hiroki <yamori813@yahoo.co.jp>
To:        "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>
Subject:   post not work mini_httpd
Message-ID:  <507818037.1743060.1677364160616.JavaMail.yahoo@mail.yahoo.co.jp>
References:  <507818037.1743060.1677364160616.JavaMail.yahoo.ref@mail.yahoo.co.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?507818037.1743060.1677364160616.JavaMail.yahoo>