diff options
author | Felix Fietkau <nbd@nbd.name> | 2016-06-16 18:29:59 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-06-16 18:29:59 +0200 |
commit | 9d9f07142bbef1c63a79620967a847a9493105e5 (patch) | |
tree | 24eef6d2f4b4d15c2a3f6c580cde9d115e0f4815 /file.c | |
parent | 242401f544df790b1df7d12b3be5f5b429da091c (diff) |
file: add support for disabling cache related precondition checks via handlers
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -565,11 +565,12 @@ static void uh_file_free(struct client *cl) static void uh_file_data(struct client *cl, struct path_info *pi, int fd) { /* test preconditions */ - if (!uh_file_if_modified_since(cl, &pi->stat) || - !uh_file_if_match(cl, &pi->stat) || - !uh_file_if_range(cl, &pi->stat) || - !uh_file_if_unmodified_since(cl, &pi->stat) || - !uh_file_if_none_match(cl, &pi->stat)) { + if (!cl->dispatch.no_cache && + (!uh_file_if_modified_since(cl, &pi->stat) || + !uh_file_if_match(cl, &pi->stat) || + !uh_file_if_range(cl, &pi->stat) || + !uh_file_if_unmodified_since(cl, &pi->stat) || + !uh_file_if_none_match(cl, &pi->stat))) { ustream_printf(cl->us, "\r\n"); uh_request_done(cl); close(fd); |