httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <>
Subject Re: Mod_include design
Date Thu, 02 Nov 2000 18:36:47 GMT
On Thu, Nov 02, 2000 at 11:20:59AM -0800, wrote:
> > Ryan, a state machine is how parsers like this work, in our "here is some
> > more text" model. It is required, but you can deny it all you like :-)
> Greg, the problem is where the state machine goes.  I agree that there
> will be _A_ state machine in mod_include.

That was certainly /not/ clear :-)

> I disagree that it should be
> the state machine that Paul initially outlined.  The state machine that he
> outlined was to determine how to split a tag out of the brigade.  This is
> unnecessary.  By just splitting the brigade at any subset of <!-- and
> -->, we can find the tag, and at that point we go into the state machine
> to actually parse the tag.


> > [ note that "buffer" could be a set-aside brigade; if you don't memcpy a
> >   directive out of a brigade into a buffer, then the parsing becomes much
> >   more difficult, and more states would be desirable to control and drive
> >   the parsing ]
> I disagree that the copy is necessary, because the code is completely
> localized to one or two functions, but that's fine.

It will be *incredibly* easier to parse a directive if we can turn it into a
contiguous string. Consider that we are going to have to do some level of
copying to deal with the tag [for a strcmp], and then copy each argument
into a new buffer, etc. The nature of this stuff is simply that we will
eventually copy an entire directive anyhow, so let's just do it up front and
simplify the parsing step.

If our goal is to rebuild mod_include into a *clean* and *maintainable*
module, then this will be quite handy. The parsing step will be clear and
quite servicable.

But: it definitely depends on how bounded the size of a directive can be. I
mean, can a directive be 10k long? If it is bounded, say, to MAX_PATH + 200,
then we just put that buffer into the ctx and run with it.

Performance-wise: copying 80 bytes of directive text is meaningless (despite
the fact that we'd end up copying the tag and args anyways).


Greg Stein,

View raw message