diff options
author | Omar Polo <op@omarpolo.com> | 2021-02-22 08:53:14 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-02-23 13:43:24 +0100 |
commit | 793835cb26c39202133c754fb33f8909ebf8fb92 (patch) | |
tree | 4e9bdaa9a6d1d035e6c3bb004ba504a8271db0fd /server.c | |
parent | fd9a4869253110c96e94b4705d4c3604f4d28ce7 (diff) |
add `log on/off' to enable/disable logs per-location
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -224,6 +224,22 @@ vhost_require_ca(struct vhost *v, const char *path) return v->locations[0].reqca; } +int +vhost_disable_log(struct vhost *v, const char *path) +{ + struct location *loc; + + if (v == NULL || path == NULL) + return 0; + + for (loc = &v->locations[1]; loc->match != NULL; ++loc) { + if (loc->disable_log && matches(loc->match, path)) + return 1; + } + + return v->locations[0].disable_log; +} + static int check_path(struct client *c, const char *path, int *fd) { |