summaryrefslogtreecommitdiffstats
path: root/cpukit/include/mghttpd
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2018-04-10 15:30:23 +1000
committerChris Johns <chrisj@rtems.org>2018-04-11 12:47:01 +1000
commitd13a62409e497c10725af6f975bdfb6ca17a3ebd (patch)
tree7329e958fabcede58b5e7b68b4dcf1b5596bcb57 /cpukit/include/mghttpd
parentconfigure: Add subdir-objects to all automake flags. (diff)
downloadrtems-d13a62409e497c10725af6f975bdfb6ca17a3ebd.tar.bz2
cpukit/mttpd: Add a callback to generate a per file HTTP etag
Close #3323.
Diffstat (limited to 'cpukit/include/mghttpd')
-rw-r--r--cpukit/include/mghttpd/mongoose.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/cpukit/include/mghttpd/mongoose.h b/cpukit/include/mghttpd/mongoose.h
index 330ed6701b..f975dfb66f 100644
--- a/cpukit/include/mghttpd/mongoose.h
+++ b/cpukit/include/mghttpd/mongoose.h
@@ -124,6 +124,19 @@ struct mg_callbacks {
// Parameters:
// status: HTTP error status code.
int (*http_error)(struct mg_connection *, int status);
+
+ // Called when mongoose needs to generate an HTTP etag.
+ // Implementing this callback allows a custom etag to be generated. If
+ // not implemented the standard etag generator is used which is the
+ // modification time as a hex value and the file size.
+ // Use this callback if the modification time cannot be controlled.
+ // Parameters:
+ // path: path to the file being requested
+ // etag: buffer to write the etag into
+ // etag_len: the length of the etag buffer
+ // Return value:
+ int (*http_etag)(const struct mg_connection *,
+ const char *path, char *etag, size_t etag_len);
};
// Start web server.