summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2021-03-09 16:28:23 +0000
committerYann Ylavic <ylavic@apache.org>2021-03-09 16:28:23 +0000
commit1d65a704e05de6d1c4a0c67108ed8703cddb6cb0 (patch)
tree586c0f4eccce0c0248b049073df750d289aeec83 /server
parentb442289123f4878711f213eaf5e1a66d1b750900 (diff)
downloadhttpd-1d65a704e05de6d1c4a0c67108ed8703cddb6cb0.tar.gz
Merge r1879285, r1879322, r1879345, r1879346, r1879465, r1879469, r1879470, r1879488, r1879541, r1879548 from trunk:
"[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. Be defensive when the request is missing. Remove tabs. Use a dedicated constant for the base64 sha1 length. Be defensive when calculating the digest. Make sure the offset is initialised to zero before reading the current offset. Seek to the start of the file when calculating the ETag. Add log numbers to util_etag.c. Add MMAP support to ETag generation. Use a brigade instead of direct reads, allow APR to handle MMAP. Bump the logno. Submitted by: minfrin Reviewed by: minfrin, jim, ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1887384 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/core.c b/server/core.c
index 567ad4a702..fe3a16f7fd 100644
--- a/server/core.c
+++ b/server/core.c
@@ -2165,6 +2165,9 @@ static const char *set_etag_bits(cmd_parms *cmd, void *mconfig,
else if (ap_cstr_casecmp(token, "INode") == 0) {
bit = ETAG_INODE;
}
+ else if (ap_cstr_casecmp(token, "Digest") == 0) {
+ bit = ETAG_DIGEST;
+ }
else {
return apr_pstrcat(cmd->pool, "Unknown keyword '",
token, "' for ", cmd->cmd->name,
@@ -4915,7 +4918,7 @@ static int default_handler(request_rec *r)
ap_update_mtime(r, r->finfo.mtime);
ap_set_last_modified(r);
- ap_set_etag(r);
+ ap_set_etag_fd(r, fd);
ap_set_accept_ranges(r);
ap_set_content_length(r, r->finfo.size);
if (bld_content_md5) {