summaryrefslogtreecommitdiff
path: root/modules/dav
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2020-06-27 23:41:00 +0000
committerGraham Leggett <minfrin@apache.org>2020-06-27 23:41:00 +0000
commit8de97e5fabff6069844cc14f41a4bcb7759d5cdc (patch)
treec301ae85767d05e69653d264bbb4c2c581b0aa21 /modules/dav
parent1f6d74d465f2db2cbde89589989469296d8ca385 (diff)
downloadhttpd-8de97e5fabff6069844cc14f41a4bcb7759d5cdc.tar.gz
"[mod_dav_fs etag handling] should really honor the FileETag setting".
- It now does. - Add "Digest" to FileETag directive, allowing a strong ETag to be generated using a file digest. - Add ap_make_etag_ex() and ap_set_etag_fd() to allow full control over ETag generation. - Add concept of "binary notes" to request_rec, allowing packed bit flags to be added to a request. - First binary note - AP_REQUEST_STRONG_ETAG - allows modules to force the ETag to a strong ETag to comply with RFC requirements, such as those mandated by various WebDAV extensions. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879285 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/dav')
-rw-r--r--modules/dav/fs/repos.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c
index 58d410ba9c..ea08dfd924 100644
--- a/modules/dav/fs/repos.c
+++ b/modules/dav/fs/repos.c
@@ -1853,27 +1853,26 @@ static dav_error * dav_fs_walk(const dav_walk_params *params, int depth,
return dav_fs_internal_walk(params, depth, 0, NULL, response);
}
-/* dav_fs_etag: Stolen from ap_make_etag. Creates a strong etag
- * for file path.
- * ### do we need to return weak tags sometimes?
+/* dav_fs_etag: Creates an etag for the file path.
*/
static const char *dav_fs_getetag(const dav_resource *resource)
{
- dav_resource_private *ctx = resource->info;
- /* XXX: This should really honor the FileETag setting */
+ etag_rec er;
- if (!resource->exists)
- return apr_pstrdup(ctx->pool, "");
+ dav_resource_private *ctx = resource->info;
- if (ctx->finfo.filetype != APR_NOFILE) {
- return apr_psprintf(ctx->pool, "\"%" APR_UINT64_T_HEX_FMT "-%"
- APR_UINT64_T_HEX_FMT "\"",
- (apr_uint64_t) ctx->finfo.size,
- (apr_uint64_t) ctx->finfo.mtime);
+ if (!resource->exists) {
+ return "";
}
- return apr_psprintf(ctx->pool, "\"%" APR_UINT64_T_HEX_FMT "\"",
- (apr_uint64_t) ctx->finfo.mtime);
+ er.vlist_validator = NULL;
+ er.request_time = ctx->r->request_time;
+ er.finfo = &ctx->finfo;
+ er.pathname = ctx->pathname;
+ er.fd = NULL;
+ er.force_weak = 0;
+
+ return ap_make_etag_ex(ctx->r, &er);
}
static const dav_hooks_repository dav_hooks_repository_fs =