William A. Rowe, Jr. wrote:

Once *one* byte of data has passed through a given filter within the filter chain, you cannot know if one filter is sitting on bytes of request or response body
that it is waiting for completion. Maybe it has a partial token stored, maybe
it's an incomplete multibyte sequence for a given code page translation.
In both cases, once a byte is inside the filter chain, during a request (this is
what I'm assuming your module does) you cannot add and drop filters.

+1 on this sentiment.


I assume that most filters that buffer data or have other saved state across invocations stash it off of f->ctx. If that exists, you know there is a possibility of corrupting the data stream if you remove the filter. If f->ctx doesn't exist, it's less likely but possible of course. Perhaps we should make a rule that if a filter stashes data, it better set f->ctx to non-null.

Greg

Reply via email to