On 1/30/2017 4:45 AM, Ruediger Pluem wrote: > Thinking of all the above it might be best if you read in mode > AP_MODE_SPECULATIVE on your own from upstream until > you have MIN_HDR_LEN data. If the PROXY header is present, read MIN_HDR_LEN > in AP_MODE_READBYTES to finally consume the > data and move on. If the PROXY header is not present, well then just forward > the original request and you are fine. > This way you leave all the hassle to the upstream filters.
Yes, definitely. I was contemplating the same thing given the permutations of modes it may be called in and the various cases to deal with. That's the approach I've taken in the latest commit because the hassle is definitely best left to upstream :-) At a high level, it no longer stores the data to pass along. When optional processing is enabled, the filter starts in speculative read mode. Once MIN_HDR_LEN is read and we know if a header is there or not we can discard ctx->bb, reinitialize ctx and move to READBYTES mode. -- Daniel Ruggeri