aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-02-22 08:53:14 +0000
committerOmar Polo <op@omarpolo.com>2021-02-23 13:43:24 +0100
commit793835cb26c39202133c754fb33f8909ebf8fb92 (patch)
tree4e9bdaa9a6d1d035e6c3bb004ba504a8271db0fd /server.c
parentfd9a4869253110c96e94b4705d4c3604f4d28ce7 (diff)
add `log on/off' to enable/disable logs per-location
Diffstat (limited to 'server.c')
-rw-r--r--server.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/server.c b/server.c
index 13e0830..ec0762d 100644
--- a/server.c
+++ b/server.c
@@ -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)
{