summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd/server_http.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2014-07-31 09:34:58 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2014-07-31 09:34:58 +0000
commit8c1b33a78cf3a28b10a20765091caa036f177778 (patch)
tree80c1ce02a4a131622d9a5d65a11bba3d41574773 /usr.sbin/httpd/server_http.c
parentbc45001cf4e743164a676f113a28ae6a97825012 (diff)
Add a configuration variable "fastcgi" to enable it per server or location.
Diffstat (limited to 'usr.sbin/httpd/server_http.c')
-rw-r--r--usr.sbin/httpd/server_http.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c
index da60d15ab99..3eff410c891 100644
--- a/usr.sbin/httpd/server_http.c
+++ b/usr.sbin/httpd/server_http.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server_http.c,v 1.22 2014/07/31 09:23:53 florian Exp $ */
+/* $OpenBSD: server_http.c,v 1.23 2014/07/31 09:34:57 reyk Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -748,18 +748,17 @@ server_response(struct httpd *httpd, struct client *clt)
fnmatch(location->location, desc->http_path,
FNM_CASEFOLD) == 0) {
/* Replace host configuration */
- clt->clt_srv_conf = location;
- srv_conf = NULL;
+ clt->clt_srv_conf = srv_conf = location;
break;
}
}
- if (strlen(desc->http_path) > strlen("/cgi-bin/") &&
- strncmp("/cgi-bin/", desc->http_path, strlen("/cgi-bin/")) == 0) {
- if ((ret = server_fcgi(httpd, clt)) == -1)
- return (-1);
- } else if ((ret = server_file(httpd, clt)) == -1)
- return (-1);
+ if (srv_conf->flags & SRVFLAG_FCGI)
+ ret = server_fcgi(httpd, clt);
+ else
+ ret = server_file(httpd, clt);
+ if (ret == -1)
+ return (ret);
server_reset_http(clt);