On Fri, Jun 5, 2020 at 5:59 PM Mark Thomas <ma...@apache.org> wrote:

> On 05/06/2020 13:21, r...@apache.org wrote:
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > remm pushed a commit to branch master
> > in repository https://gitbox.apache.org/repos/asf/tomcat.git
> >
> >
> > The following commit(s) were added to refs/heads/master by this push:
> >      new e8bcbf1  Ignore exception getting content length
> > e8bcbf1 is described below
> >
> > commit e8bcbf1a017e598498343ebd05f77f07934910bb
> > Author: remm <r...@apache.org>
> > AuthorDate: Fri Jun 5 14:21:39 2020 +0200
> >
> >     Ignore exception getting content length
> >
> >     If the value is invalid, there will be another attempt to convert the
> >     number with no really easy way out. Ignore the exception which
> already
> >     happened in prepareRequest.
>
> Thanks for catching this.
>
> I think it would be useful to cache the fact that the header had been
> parsed (or not found) to save looping through the headers again.
>
> What do you think to switching to Long and using:
> - null -> not yet parsed
> - -1   -> known that no valid value is present
> - >=0  -> the parsed value of the header
>
> The alternative is a boolean flag. Long seems cleaner to me even if it
> is slightly more memory.
>
> Thoughts?
>

If you want to, but it's processed twice only if there's a problem so the
cost is minimal.

Rémy

Reply via email to