Actually, I'd read the documentation when installing on my atom. However,
still couldn't get this to work with the arm system. And the odd thing was
that it was fine with the same busybox build and configuration.
I did get a bit further in debugging though - the only difference between
the two were the bash shells. The atom bash was a known quantity, but I dont
know what they did with the bash on the arm core. Switching from bash to ash
on the arm core got the simple scripts running fine. Curious as to how bash
is knocking it on the head though.
Thanks for the quick replies - it got my head cleared enough to keep
debugging :)
Regards,
Daniel Stonier.

2009/9/19 Denys Vlasenko <[email protected]>

> On Friday 18 September 2009 18:30, Leonid Lisovskiy wrote:
> > >I'm having a problem getting httpd to run shell scripts - they just
> return
> > >empty screens.
> >
> > Answer is simple - you have to read documentation first ;-)
> >
> > Since some version, busybox's httpd expects that you are responsible
> > for generating HTTP headers inside shell script. I.e. you have to do
> > like this:
> >
> > echo "HTTP/1.0 200 OK
> > Content-type: image/png
> > Connection: close
> > "
> No. You do not _have to_ output it, it's optional.
> httpd will supply "HTTP/1.0 200 OK" if it is not supplied
> by the CGI. Here is the relevant code from httpd.c:
>
>                                } else if (out_cnt >= 4) {
>                                        /* Did CGI add "HTTP"? */
>                                        if (memcmp(rbuf, HTTP_200, 4) != 0)
> {
>                                                /* there is no "HTTP", do it
> ourself */
>                                                if
> (full_write(STDOUT_FILENO, HTTP_200, sizeof(HTTP_200)-1) !=
> sizeof(HTTP_200)-1)
>                                                        break;
>                                        }
>
> But you _have to_ output at least the one empty
> line, to signify end of header.
>
> Here's the doc:
>
> http://hoohoo.ncsa.illinois.edu/cgi/out.html
>
> Parsed headers
>
> The output of scripts begins with a small header.
> This header consists of text lines, in the same format as an HTTP header,
> terminated by a blank line (a line with only a linefeed or CR/LF).
>
>
>
> IOW:
>
> printf "\r\nMinimal CGI example"
> --
> vda
>
> _______________________________________________
> busybox mailing list
> [email protected]
> http://lists.busybox.net/mailman/listinfo/busybox
>
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to