From d13a62409e497c10725af6f975bdfb6ca17a3ebd Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Tue, 10 Apr 2018 15:30:23 +1000 Subject: cpukit/mttpd: Add a callback to generate a per file HTTP etag Close #3323. --- cpukit/include/mghttpd/mongoose.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cpukit/include/mghttpd') 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. -- cgit v1.2.3