updates to lighttpd from upstream svn, from Brad

- remove "let HEAD for 0-byte files return the Content-Length" patch,
there are some cases where this is undesirable

- fix handling if etags are disabled but cache-dir is set - may
lead to double response
This commit is contained in:
sthen 2012-01-13 23:02:15 +00:00
parent 0f5aa34593
commit 003a3d9f83
3 changed files with 17 additions and 20 deletions

View File

@ -1,10 +1,11 @@
# $OpenBSD: Makefile,v 1.93 2011/12/20 22:27:28 sthen Exp $
# $OpenBSD: Makefile,v 1.94 2012/01/13 23:02:15 sthen Exp $
SHARED_ONLY= Yes
COMMENT= secure, fast, compliant, and very flexible web-server
DISTNAME= lighttpd-1.4.30
REVISION= 0
CATEGORIES= www net
MASTER_SITES= http://download.lighttpd.net/lighttpd/releases-1.4.x/

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-src_connections_c,v 1.19 2011/12/20 22:27:28 sthen Exp $
let HEAD for 0-byte files return the Content-Length
--- src/connections.c.orig Wed Nov 30 12:42:45 2011
+++ src/connections.c Tue Dec 20 16:33:10 2011
@@ -567,8 +567,10 @@ static int connection_handle_write_prepare(server *srv
if (NULL != (ds = (data_string*) array_get_element(con->response.headers, "Content-Length"))) {
buffer_reset(ds->value); /* Headers with empty values are ignored for output */
}
- } else if (qlen > 0 || con->request.http_method != HTTP_METHOD_HEAD) {
- /* qlen = 0 is important for Redirects (301, ...) as they MAY have
+ } else if (qlen >= 0) {
+ /* the Content-Length header has to be >= 0 to be valid.
+ *
+ * qlen = 0 is important for Redirects (301, ...) as they MAY have
* a content. Browsers are waiting for a Content otherwise
*/
buffer_copy_off_t(srv->tmp_buf, qlen);

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_mod_compress_c,v 1.3 2012/01/13 23:02:15 sthen Exp $
Fix handling if etags are disabled but cache-dir is set - may lead to double response.
--- src/mod_compress.c.orig Fri Jan 13 16:26:52 2012
+++ src/mod_compress.c Fri Jan 13 16:28:29 2012
@@ -826,7 +826,7 @@ PHYSICALPATH_FUNC(mod_compress_physical) {
}
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
/* let mod_staticfile handle the cached compressed files, physical path was modified */
- return p->conf.compress_cache_dir->used ? HANDLER_GO_ON : HANDLER_FINISHED;
+ return (use_etag && p->conf.compress_cache_dir->used) ? HANDLER_GO_ON : HANDLER_FINISHED;
}
}
}