openbsd-ports/www/lighttpd/patches/patch-src_connections_c
sthen 5b9d7d9e95 fixes from lighttpd upstream via Brad (maintainer)
- Add static-file.disable-pathinfo option to prevent handling of
  urls like .../secret.php/image.jpg as static file.
- Don't overwrite 401 (auth required) with 501 (unknown method).
2011-09-06 08:49:51 +00:00

49 lines
1.7 KiB
Plaintext

$OpenBSD: patch-src_connections_c,v 1.16 2011/09/06 08:49:51 sthen Exp $
--- src/connections.c.orig Sun Apr 24 11:55:46 2011
+++ src/connections.c Mon Sep 5 20:38:50 2011
@@ -445,6 +445,7 @@ static int connection_handle_write_prepare(server *srv
default:
switch(con->http_status) {
case 400: /* bad request */
+ case 401: /* authorization required */
case 414: /* overload request header */
case 505: /* unknown protocol */
case 207: /* this was webdav */
@@ -617,8 +618,9 @@ static int connection_handle_write_prepare(server *srv
}
static int connection_handle_write(server *srv, connection *con) {
- switch(network_write_chunkqueue(srv, con, con->write_queue)) {
+ switch(network_write_chunkqueue(srv, con, con->write_queue, MAX_WRITE_LIMIT)) {
case 0:
+ con->write_request_ts = srv->cur_ts;
if (con->file_finished) {
connection_set_state(srv, con, CON_STATE_RESPONSE_END);
joblist_append(srv, con);
@@ -635,6 +637,7 @@ static int connection_handle_write(server *srv, connec
joblist_append(srv, con);
break;
case 1:
+ con->write_request_ts = srv->cur_ts;
con->is_writable = 0;
/* not finished yet -> WRITE */
@@ -1251,8 +1254,6 @@ static handler_t connection_handle_fdevent(server *srv
log_error_write(srv, __FILE__, __LINE__, "ds",
con->fd,
"handle write failed.");
- } else if (con->state == CON_STATE_WRITE) {
- con->write_request_ts = srv->cur_ts;
}
}
@@ -1667,8 +1668,6 @@ int connection_state_machine(server *srv, connection *
con->fd,
"handle write failed.");
connection_set_state(srv, con, CON_STATE_ERROR);
- } else if (con->state == CON_STATE_WRITE) {
- con->write_request_ts = srv->cur_ts;
}
}