aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-02-06 18:28:43 +0000
committerOmar Polo <op@omarpolo.com>2021-02-06 18:28:43 +0000
commite3ddf390950bf51d0c6c9cc6b931879006936e4c (patch)
treeb5c8af6e5209006b99b4a65f222bbf169483c57e /server.c
parentafc025ff600c11e5cbe8794b944b560492290cce (diff)
add the ``entrypoint'' option
Diffstat (limited to 'server.c')
-rw-r--r--server.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/server.c b/server.c
index ec44649..33eda69 100644
--- a/server.c
+++ b/server.c
@@ -481,8 +481,15 @@ handle_open_conn(struct pollfd *fds, struct client *c)
return;
}
- if (!apply_block_return(fds, c))
- open_file(fds, c);
+ if (apply_block_return(fds, c))
+ return;
+
+ if (c->host->entrypoint != NULL) {
+ start_cgi(c->host->entrypoint, c->iri.path, fds, c);
+ return;
+ }
+
+ open_file(fds, c);
}
static void