diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2014-07-31 18:07:12 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2014-07-31 18:07:12 +0000 |
commit | c2f3eca2e7655f0a597c69c9ed7edfd86eeede0c (patch) | |
tree | eb85969fd1d8d184e71bd8ae0c511e59fa6b5123 /usr.sbin | |
parent | 982cd47aa30ac29102e9fe4a9fc940f3bd303d29 (diff) |
Only write the HTTP header for the first fastcgi chunk.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/httpd/httpd.h | 3 | ||||
-rw-r--r-- | usr.sbin/httpd/server_fcgi.c | 5 | ||||
-rw-r--r-- | usr.sbin/httpd/server_http.c | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/httpd/httpd.h b/usr.sbin/httpd/httpd.h index 2605a068621..d45783a6303 100644 --- a/usr.sbin/httpd/httpd.h +++ b/usr.sbin/httpd/httpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: httpd.h,v 1.25 2014/07/31 17:55:09 reyk Exp $ */ +/* $OpenBSD: httpd.h,v 1.26 2014/07/31 18:07:11 reyk Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org> @@ -261,6 +261,7 @@ struct client { int clt_persist; int clt_line; int clt_done; + int clt_chunk; int clt_inflight; struct evbuffer *clt_log; diff --git a/usr.sbin/httpd/server_fcgi.c b/usr.sbin/httpd/server_fcgi.c index bc8d25176c7..01187df061f 100644 --- a/usr.sbin/httpd/server_fcgi.c +++ b/usr.sbin/httpd/server_fcgi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_fcgi.c,v 1.4 2014/07/31 17:55:09 reyk Exp $ */ +/* $OpenBSD: server_fcgi.c,v 1.5 2014/07/31 18:07:11 reyk Exp $ */ /* * Copyright (c) 2014 Florian Obser <florian@openbsd.org> @@ -230,7 +230,8 @@ server_fcgi_read(struct bufferevent *bev, void *arg) DPRINTF("%s", (char *) &buf + sizeof(struct fcgi_record_header)); - server_fcgi_header(clt, 200); + if (++clt->clt_chunk == 1) + server_fcgi_header(clt, 200); server_bufferevent_write(clt, (char *)&buf + sizeof(struct fcgi_record_header), len - sizeof(struct fcgi_record_header)); diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c index 4b29da4faa8..7849c61630e 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.24 2014/07/31 17:55:09 reyk Exp $ */ +/* $OpenBSD: server_http.c,v 1.25 2014/07/31 18:07:11 reyk Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org> @@ -513,6 +513,7 @@ server_reset_http(struct client *clt) clt->clt_headerlen = 0; clt->clt_line = 0; clt->clt_done = 0; + clt->clt_chunk = 0; clt->clt_bev->readcb = server_read_http; clt->clt_srv_conf = &srv->srv_conf; } |