summaryrefslogtreecommitdiff
path: root/include/http_protocol.h
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 /include/http_protocol.h
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 'include/http_protocol.h')
-rw-r--r--include/http_protocol.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/include/http_protocol.h b/include/http_protocol.h
index b7953d0a6b..9c9cb952b2 100644
--- a/include/http_protocol.h
+++ b/include/http_protocol.h
@@ -166,6 +166,27 @@ AP_DECLARE(const char *) ap_make_content_type(request_rec *r,
*/
AP_DECLARE(void) ap_setup_make_content_type(apr_pool_t *pool);
+/** A structure with the ingredients for a file based etag */
+typedef struct etag_rec etag_rec;
+
+/**
+ * @brief A structure with the ingredients for a file based etag
+ */
+struct etag_rec {
+ /** Optional vary list validator */
+ const char *vlist_validator;
+ /** Time when the request started */
+ apr_time_t request_time;
+ /** finfo.protection (st_mode) set to zero if no such file */
+ apr_finfo_t *finfo;
+ /** File pathname used when generating a digest */
+ const char *pathname;
+ /** File descriptor used when generating a digest */
+ apr_file_t *fd;
+ /** Force a non-digest etag to be weak */
+ int force_weak;
+};
+
/**
* Construct an entity tag from the resource information. If it's a real
* file, build in some of the file characteristics.
@@ -177,12 +198,27 @@ AP_DECLARE(void) ap_setup_make_content_type(apr_pool_t *pool);
AP_DECLARE(char *) ap_make_etag(request_rec *r, int force_weak);
/**
+ * Construct an entity tag from information provided in the etag_rec
+ * structure.
+ * @param r The current request
+ * @param er The etag record, containing ingredients for the etag.
+ */
+AP_DECLARE(char *) ap_make_etag_ex(request_rec *r, etag_rec *er);
+
+/**
* Set the E-tag outgoing header
* @param r The current request
*/
AP_DECLARE(void) ap_set_etag(request_rec *r);
/**
+ * Set the E-tag outgoing header, with the option of forcing a strong ETag.
+ * @param r The current request
+ * @param fd The file descriptor
+ */
+AP_DECLARE(void) ap_set_etag_fd(request_rec *r, apr_file_t *fd);
+
+/**
* Set the last modified time for the file being sent
* @param r The current request
*/
@@ -762,7 +798,7 @@ AP_DECLARE_HOOK(const char *,http_scheme,(const request_rec *r))
AP_DECLARE_HOOK(apr_port_t,default_port,(const request_rec *r))
-#define AP_PROTOCOL_HTTP1 "http/1.1"
+#define AP_PROTOCOL_HTTP1 "http/1.1"
/**
* Determine the list of protocols available for a connection/request. This may
@@ -1011,6 +1047,7 @@ AP_DECLARE(void) ap_finalize_sub_req_protocol(request_rec *sub_r);
*/
AP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers);
+
#ifdef __cplusplus
}
#endif