summaryrefslogtreecommitdiffstats
path: root/usr.sbin/httpd/server_http.c
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2014-07-31 17:55:09 +0000
committerreyk <reyk@openbsd.org>2014-07-31 17:55:09 +0000
commitcebbf23c9fbb7df6bcc4715bf4c9221520b00cd2 (patch)
treefb1c3798960c932e5c6c7991b9ab1d06f19aa0af /usr.sbin/httpd/server_http.c
parentuse proper on-disk inode size: no more, no less. (diff)
downloadwireguard-openbsd-cebbf23c9fbb7df6bcc4715bf4c9221520b00cd2.tar.xz
wireguard-openbsd-cebbf23c9fbb7df6bcc4715bf4c9221520b00cd2.zip
some fastcgi improvements:
- DPRINTF instead of log_info for internal debugging. - submit QUERY_STRING, if it exists - use a proper function to create an HTTP header. - use server_file_error() to detect EOF and fastcgi stream errors. - disable keep-alive/persist for now until we have a reliable way to get the content length from the cgi response or support chunked encoding. "Cool, jep" florian@
Diffstat (limited to 'usr.sbin/httpd/server_http.c')
-rw-r--r--usr.sbin/httpd/server_http.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c
index 3eff410c891..4b29da4faa8 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.23 2014/07/31 09:34:57 reyk Exp $ */
+/* $OpenBSD: server_http.c,v 1.24 2014/07/31 17:55:09 reyk Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -48,7 +48,6 @@
#include "httpd.h"
#include "http.h"
-static void server_http_date(char *, size_t);
static int server_httpmethod_cmp(const void *, const void *);
static int server_httperror_cmp(const void *, const void *);
void server_httpdesc_free(struct http_descriptor *);
@@ -518,7 +517,7 @@ server_reset_http(struct client *clt)
clt->clt_srv_conf = &srv->srv_conf;
}
-static void
+void
server_http_date(char *tmbuf, size_t len)
{
time_t t;
@@ -673,7 +672,6 @@ server_response(struct httpd *httpd, struct client *clt)
struct server *srv = clt->clt_srv;
struct server_config *srv_conf = &srv->srv_conf, *location;
struct kv *kv, key, *host;
- int ret;
/* Canonicalize the request path */
if (desc->http_path == NULL ||
@@ -754,15 +752,8 @@ server_response(struct httpd *httpd, struct client *clt)
}
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);
-
- return (0);
+ return (server_fcgi(httpd, clt));
+ return (server_file(httpd, clt));
fail:
server_abort_http(clt, 400, "bad request");
return (-1);