diff options
| author | 2014-07-30 10:05:14 +0000 | |
|---|---|---|
| committer | 2014-07-30 10:05:14 +0000 | |
| commit | a916ec3792e702a65c7ab0f8019db6ec3e3da103 (patch) | |
| tree | b1e59dee4ad259da5a4cce5b36b88ee2d3183e29 /usr.sbin/httpd/server.c | |
| parent | Small fix and clarification (diff) | |
| download | wireguard-openbsd-a916ec3792e702a65c7ab0f8019db6ec3e3da103.tar.xz wireguard-openbsd-a916ec3792e702a65c7ab0f8019db6ec3e3da103.zip | |
Add "location" keyword to specify path-specific configuration in
servers, for example auto index for a sub-directory only. Internally,
a "location" is just a special type of a "virtual" server.
Diffstat (limited to 'usr.sbin/httpd/server.c')
| -rw-r--r-- | usr.sbin/httpd/server.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/usr.sbin/httpd/server.c b/usr.sbin/httpd/server.c index cff35e0607b..2b230111cd7 100644 --- a/usr.sbin/httpd/server.c +++ b/usr.sbin/httpd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.15 2014/07/29 16:38:34 reyk Exp $ */ +/* $OpenBSD: server.c,v 1.16 2014/07/30 10:05:14 reyk Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org> @@ -96,6 +96,9 @@ server_shutdown(void) int server_privinit(struct server *srv) { + if (srv->srv_conf.flags & SRVFLAG_LOCATION) + return (0); + log_debug("%s: adding server %s", __func__, srv->srv_conf.name); if ((srv->srv_s = server_socket_listen(&srv->srv_conf.ss, @@ -196,6 +199,19 @@ server_byaddr(struct sockaddr *addr, in_port_t port) return (NULL); } +struct server * +server_byname(const char *name) +{ + struct server *srv; + + TAILQ_FOREACH(srv, env->sc_servers, srv_entry) { + if (strcmp(srv->srv_conf.name, name) == 0) + return (srv); + } + + return (NULL); +} + int server_socket_af(struct sockaddr_storage *ss, in_port_t port) { |
