update to 1.4.24, from Brad (maintainer).

This commit is contained in:
sthen 2009-10-27 23:02:11 +00:00
parent 4756f8638f
commit b518dd066d
7 changed files with 30 additions and 141 deletions

View File

@ -1,11 +1,10 @@
# $OpenBSD: Makefile,v 1.60 2009/08/11 21:55:27 sthen Exp $ # $OpenBSD: Makefile,v 1.61 2009/10/27 23:02:11 sthen Exp $
SHARED_ONLY= Yes SHARED_ONLY= Yes
COMMENT= secure, fast, compliant, and very flexible web-server COMMENT= secure, fast, compliant, and very flexible web-server
DISTNAME= lighttpd-1.4.23 DISTNAME= lighttpd-1.4.24
PKGNAME= ${DISTNAME}p1
CATEGORIES= www net CATEGORIES= www net
MASTER_SITES= ${HOMEPAGE}/download/ MASTER_SITES= ${HOMEPAGE}/download/

View File

@ -1,5 +1,5 @@
MD5 (lighttpd-1.4.23.tar.gz) = Qd+tXDZtNNg8PStG1MCPXA== MD5 (lighttpd-1.4.24.tar.gz) = yyFVIw9XOL9W0UExh0w2/g==
RMD160 (lighttpd-1.4.23.tar.gz) = aWuOGFyK2/IV8A0lnigqQmvNkcM= RMD160 (lighttpd-1.4.24.tar.gz) = 4B8S58i13/SDbeh6/MueMXysoio=
SHA1 (lighttpd-1.4.23.tar.gz) = N/i0gn16H2mBLYGF/Oz3IncCCHY= SHA1 (lighttpd-1.4.24.tar.gz) = +SXwe0ClCsl6WVVC+ovugMN+TtA=
SHA256 (lighttpd-1.4.23.tar.gz) = hVXbIu19QpFgcBVVYR2M1e/0L8fm4607BQJ5ybIUVGk= SHA256 (lighttpd-1.4.24.tar.gz) = 18tRTglTqNipuIsAKeWgOAynQK44W0Zb0FkgI611oMc=
SIZE (lighttpd-1.4.23.tar.gz) = 803422 SIZE (lighttpd-1.4.24.tar.gz) = 777013

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-src_connections_c,v 1.8 2009/06/22 09:28:07 sthen Exp $
--- src/connections.c.orig Sun Jun 21 22:00:27 2009
+++ src/connections.c Sun Jun 21 22:03:27 2009
@@ -782,13 +782,13 @@ int connection_reset(server *srv, connection *con) {
CLEAN(request.pathinfo);
CLEAN(request.request);
- CLEAN(request.orig_uri);
+ /* CLEAN(request.orig_uri); */
CLEAN(uri.scheme);
- CLEAN(uri.authority);
- CLEAN(uri.path);
+ /* CLEAN(uri.authority); */
+ /* CLEAN(uri.path); */
CLEAN(uri.path_raw);
- CLEAN(uri.query);
+ /* CLEAN(uri.query); */
CLEAN(physical.doc_root);
CLEAN(physical.path);
@@ -1400,6 +1400,11 @@ int connection_state_machine(server *srv, connection *
log_error_write(srv, __FILE__, __LINE__, "sds",
"state for fd", con->fd, connection_get_state(con->state));
}
+
+ buffer_reset(con->uri.authority);
+ buffer_reset(con->uri.path);
+ buffer_reset(con->uri.query);
+ buffer_reset(con->request.orig_uri);
if (http_request_parse(srv, con)) {
/* we have to read some data from the POST request */

View File

@ -1,59 +0,0 @@
$OpenBSD: patch-src_http-header-glue_c,v 1.1 2009/08/11 21:55:27 sthen Exp $
--- src/http-header-glue.c.orig Sat Aug 8 21:37:20 2009
+++ src/http-header-glue.c Sat Aug 8 21:41:59 2009
@@ -259,7 +259,7 @@ int http_response_handle_cachable(server *srv, connect
}
if (0 == strncmp(con->request.http_if_modified_since, mtime->ptr, used_len)) {
- con->http_status = 304;
+ if ('\0' == mtime->ptr[used_len]) con->http_status = 304;
return HANDLER_FINISHED;
} else {
char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
@@ -281,15 +281,16 @@ int http_response_handle_cachable(server *srv, connect
strncpy(buf, con->request.http_if_modified_since, used_len);
buf[used_len] = '\0';
- tm.tm_isdst = 0;
if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
con->http_status = 412;
con->mode = DIRECT;
return HANDLER_FINISHED;
}
+ tm.tm_isdst = 0;
t_header = mktime(&tm);
strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
+ tm.tm_isdst = 0;
t_file = mktime(&tm);
if (t_file > t_header) return HANDLER_GO_ON;
@@ -318,7 +319,7 @@ int http_response_handle_cachable(server *srv, connect
}
if (0 == strncmp(con->request.http_if_modified_since, mtime->ptr, used_len)) {
- con->http_status = 304;
+ if ('\0' == mtime->ptr[used_len]) con->http_status = 304;
return HANDLER_FINISHED;
} else {
char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
@@ -331,7 +332,6 @@ int http_response_handle_cachable(server *srv, connect
strncpy(buf, con->request.http_if_modified_since, used_len);
buf[used_len] = '\0';
- tm.tm_isdst = 0;
if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
/**
* parsing failed, let's get out of here
@@ -340,9 +340,11 @@ int http_response_handle_cachable(server *srv, connect
"strptime() failed on", buf);
return HANDLER_GO_ON;
}
+ tm.tm_isdst = 0;
t_header = mktime(&tm);
strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
+ tm.tm_isdst = 0;
t_file = mktime(&tm);
if (t_file > t_header) return HANDLER_GO_ON;

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-src_mod_magnet_c,v 1.3 2009/10/27 23:02:11 sthen Exp $
--- src/mod_magnet.c.orig Mon Oct 26 20:15:11 2009
+++ src/mod_magnet.c Mon Oct 26 20:15:41 2009
@@ -170,6 +170,7 @@ static int magnet_pairs(lua_State *L) {
return lua_gettop(L);
} else {
lua_pushvalue(L, lua_upvalueindex(1));
+ lua_insert(L, 1);
lua_call(L, lua_gettop(L) - 1, LUA_MULTRET);
return lua_gettop(L);
}

View File

@ -1,41 +0,0 @@
$OpenBSD: patch-src_mod_status_c,v 1.1 2009/06/22 09:28:07 sthen Exp $
--- src/mod_status.c.orig Sun Jun 21 22:03:52 2009
+++ src/mod_status.c Sun Jun 21 22:08:42 2009
@@ -438,7 +438,7 @@ static handler_t mod_status_handle_server_status_html(
buffer_append_string_len(b, CONST_STR_LEN(
"<hr />\n<pre><b>legend</b>\n"
- ". = connect, C = close, E = hard error\n"
+ ". = connect, C = close, E = hard error, k = keep-alive\n"
"r = read, R = read-POST, W = write, h = handle-request\n"
"q = request-start, Q = request-end\n"
"s = response-start, S = response-end\n"));
@@ -449,8 +449,14 @@ static handler_t mod_status_handle_server_status_html(
for (j = 0; j < srv->conns->used; j++) {
connection *c = srv->conns->ptr[j];
- const char *state = connection_get_short_state(c->state);
+ const char *state;
+ if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
+ state = "k";
+ } else {
+ state = connection_get_short_state(c->state);
+ }
+
buffer_append_string_len(b, state, 1);
if (((j + 1) % 50) == 0) {
@@ -497,7 +503,11 @@ static handler_t mod_status_handle_server_status_html(
buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"string\">"));
- buffer_append_string(b, connection_get_state(c->state));
+ if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
+ buffer_append_string_len(b, CONST_STR_LEN("keep-alive"));
+ } else {
+ buffer_append_string(b, connection_get_state(c->state));
+ }
buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"int\">"));

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_server_c,v 1.7 2009/10/27 23:02:11 sthen Exp $
--- src/server.c.orig Wed Oct 14 14:05:43 2009
+++ src/server.c Mon Oct 19 16:44:37 2009
@@ -211,7 +211,7 @@ static server *server_init(void) {
srv->mtime_cache[i].str = buffer_init();
}
- if ((NULL != (frandom = fopen("/dev/urandom", "rb")) || NULL != (frandom = fopen("/dev/random", "rb")))
+ if ((NULL != (frandom = fopen("/dev/arandom", "rb")) || NULL != (frandom = fopen("/dev/urandom", "rb")))
&& 1 == fread(srv->entropy, sizeof(srv->entropy), 1, frandom)) {
srand(*(unsigned int*)srv->entropy);
srv->is_real_entropy = 1;