On Thursday 18 October 2007 12:41, Alex Landau wrote:
> > host_port cannot be NULL. What do you really want to test there?
>
> Sure, my oops. It should have been *host_port == '\0'. Fixed.
Thanks. I typically add comments in such places.
> > Regarding your question about whether the current index.cgi approach is
> > enough for me, it
> isn't. Due to two reasons. First, it has to be a binary and be located in
> /cgi-bin/. I
> want it to be a PHP script. That's the main reason for me. (I can try putting
> a
> #!/bin/php at the top, but I think PHP will just display it...).
I cannot test this here, have no php installed. But even if it doesn't,
#!/bin/sh
exec php something.php
should work.
> Second, it's one page
> for the whole site, you can't decide that some directories have their own
> version of the
> default page.
You can analyze $QUERY_STRING env var. For example:
#!/bin/sh
# Must start with /
test x"${QUERY_STRING:0:1}" != x/ || exit 1
# Remove /
QUERY_STRING="${QUERY_STRING:1:9990}"
# cd into $QUERY_STRING dir
cd .. || exit 1
test "$QUERY_STRING" && cd "$QUERY_STRING" || exit 1
# If index.php exists, run it
test -f index.php && exec php index.php
...
Face it, httpd.c is already a mess. I'd rather not add even more.
PROXY support can't be done with helper CGI, START_PAGE can.
I am committing PROXY support to svn.
Note that code around fdprintf(proxy_fd...) has changed, needs testing.
If you want START_PAGE support too, explain a bit more
why index.cgi cannot fulfil your needs.
Testable example will be best.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox