[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Patch] Rework of r1866425 ('Last-Modified' header)

From: Sergey Raevskiy <Sergey.Raevskiy_at_visualsvn.com>
Date: Mon, 9 Dec 2019 18:54:03 +0300

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

Received on 2019-12-09 16:54:31 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.