httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graham Leggett" <>
Subject Re: mod_include "-A /path" (Re: Expression Parser API?)
Date Thu, 29 Nov 2007 10:31:52 GMT
On Thu, November 29, 2007 3:21 am, Nick Kew wrote:

> OK, fairy nuff I understand the shell args derivation, and that's
> fine by me.  I'd prefer "-A /foo/bar.txt < 400", but I'm happy
> to accept your version.

Aaargh... something else I struggled with was to chose just how far to
take it. It would have been really easy to start with the idea "add the
ability to test whether URLs are accessible", and then run with it, ending
up where ages later you have ultimately reengineered three quarters of
mod_include, and blown any chance of a backport to 2.2.

In sh syntax, the -X arg tests are typically boolean in nature, whereas
"-A /foo/bar.txt < 400" is really string in nature. This leads onto the
idea of supporting some kind of function syntax, such as "status(/url)",
but this overloads the brackets as to now meaning either the grouping
around conditional expressions (like now), or marking a parameter, and
suddenly you're re-engineering the entire parser.

> What I don't like about the patch is the evaluation inline within
> the parser.

The trouble is part of a bigger problem, where all the other evaluations
are done inline within the parser as well, but because they are "small",
it passes unnoticed.

I saw the problem of adding the -A option, and the problem of refactoring
the parser to be generic as two separate problems, the second one being
more difficult to backport.

> I'm updating my working version to pass in an evaluation
> function for shell-stuff, but there's no way that's going to make 2.2.7.
> So in the meantime, I attach a patch that puts the evaluation and
> subrequest stuff into a separate function, in preparation for taking
> the parser from mod_include to core at a future date.  Patch attached.
> If you're happy with this minor reorganisation of your proposal,
> then you have my +1 on it.

When I have some real internet access, will definitely take a look and
sort it out.


View raw message