[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [users@httpd] mod_ratelimit working by steps ?

Hi Luca,

On Sat, Jun 16, 2018 at 8:56 AM, Luca Toscano <toscano.luca@xxxxxxxxx> wrote:
> While reading the code I didn't get if one particular use case may or may
> not happen at all, it is the only big doubt that I have before committing.
> Is it possible that the first bb to process (during the first invocation of
> the filter) is equal to the chunk_size + ctx->burst? IIUC the code relies on
> the fact that bb is not empty to decide whether or not to pass ctx->tmpp to
> the next filter in the chain, but if this is not the case then it may loop?

I'm not sure to follow, a loop in mod_ratelimit's filter itself?
1/ If bb is given empty then the filter does nothing (AFAICT), this
should not happen but it's not each filter's business to handle the
case either (just not crash or loop indefinitely of course).
2/ If bb is less than chunk_size + burst bytes, then data are retained
in holdingbb until the next call (provided not EOS/FLUSH and so
3/ If bb is greater or equal to chunk_size + burst bytes (the case you
are talking about AIUI), then each chunk is sent rate limited and
either 1/ or 2/ applies for the rest.

Which case exactly do you care about?