httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: Filtered I/O ... again. :-)
Date Wed, 31 May 2000 21:12:02 GMT
> From:
> Date: Wed, 31 May 2000 08:55:10 -0700 (PDT)
> Filters need to be able to say "I'm holding a piece of this data to
> process the next time you send me stuff, please wait" And this needs to be
> respected by the code.  For example, if mod_include gets half an SSI tag
> at the end of text block, it will hold the half of the tag it has, and
> return "I have to hold onto this", and when it gets the rest of the tag,
> it will return the correct result.  This means we need to be able to save
> the text and the current filters out of the way to be restored later.  If
> we don't save the current filter list, then somebody could re-write
> history.

I don't understand why a filter has to be able to tell the caller that
it hasn't processed everything when it can just put the data in its
pocket like in your mod_include example.  How would it tell the caller
this anyway (partial bytes written)?  What does "please wait" mean?

Suppose the mod_include filter is called twice.  The first time has a
bunch of text it doesn't modified followed by the first half of an SSI
tag; the second time has the rest of the SSI tag and some more text.

Call 1: 
  mod_include passes the first part of its input (up through the partial
  SSI tag) to the next filter

  mod_include holds onto the partial SSI tag

  mod_include tells its caller that it processed all input data

Call 2:
  mod_include gets to the end of the SSI tag and now knows what text
  to spit out for the entire SSI tag

  mod_include passes the inserted text to the next filter

  mod_include passes the rest of its current input buffer to the next

  mod_include tells its caller that it processed all input data

Everybody is happy.  The filter before mod_include didn't have any
decisions to make about what happened with mod_include.

mod_include needs to be able to signal an error if the filter is
removed but he is still waiting for the rest of an SSI tag.

Jeff Trawick | | PGP public key at web site:
          Born in Roswell... married an alien...

View raw message