diff options
author | Chris Johns <chrisj@rtems.org> | 2018-03-08 15:12:30 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2018-03-08 15:34:15 +1100 |
commit | c3353ae565c3d3f9a605583b4c45abbdda7ac47b (patch) | |
tree | 6db1d50552a2c59d4a17a4d844b9cb592c9d2c38 /cpukit/mghttpd/mongoose.h | |
parent | libtest/dl01: Add dlerror tests. (diff) | |
download | rtems-c3353ae565c3d3f9a605583b4c45abbdda7ac47b.tar.bz2 |
cpukit/mttpd: Add a callback to generate a per file HTTP etag.
Closes #3324
Diffstat (limited to '')
-rw-r--r-- | cpukit/mghttpd/mongoose.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cpukit/mghttpd/mongoose.h b/cpukit/mghttpd/mongoose.h index ad7c40f2dd..787922a983 100644 --- a/cpukit/mghttpd/mongoose.h +++ b/cpukit/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. |