On Mon, Dec 9, 2019 at 10:54 AM Sergey Raevskiy <sergey.raevs...@visualsvn.com> wrote: > > Hello! > > I've spent some time examining r1866425 [1] ('Last-Modified' header) and I > would like to suggest a patch with some rework related to this code. > > I see two main problems in r1866425: usage of the pointer comparison (which is > hackish and relies on the implementation of parse_uri()) and using -1 for > 'bad time' value. > > APR_DATE_BAD is defined in APR headers by the way and it's value is 0 (zero), > not -1. Anyway, it is better to avoid 'special values' for APR_TIME_T if > possible. > > I've attached a patch that removes both problems and also reduces code > coupling (since get_last_modified() function cannot be actually reused > anywhere > but in set_headers()). Also I've removed RESOURCE_LACKS_ETAG_POTENTIAL() > check > which is now redundant. > > Log message: > [[[ > Rework r1866425 ('Last-Modified' header). Do not use pointer comparison > and 'special value' for APR_TIME_T. > > * subversion/mod_dav_svn/dav_svn.h > (dav_resource_private): Add new member IS_PUBLIC_URI. > > * subversion/mod_dav_svn/repos.c > (parse_uri, > get_parentpath_resource): Set IS_PUBLIC_URI to TRUE for 'public' URIs (not > under '/!svn/') > (get_last_modified): Delete. > (set_headers): Rework of 'Last-Modified' related code. > > Patch by: sergey.raevskiy{_AT_}visualsvn.com > ]]] > > [1] https://svn.apache.org/r1866425
Committed, r1872381. Cheers, Nathan