From 1aaf868654a6605f36e2dba6c70073bc5078b18b Mon Sep 17 00:00:00 2001 From: brad Date: Thu, 23 Oct 2008 20:29:17 +0000 Subject: [PATCH] Upgrade to lighttpd 1.4.20. Large bug fix update. Tested by a number of users. --- www/lighttpd/Makefile | 5 +- www/lighttpd/distinfo | 10 +-- www/lighttpd/patches/patch-src_connections_c | 70 ------------------- www/lighttpd/patches/patch-src_mod_cgi_c | 34 --------- www/lighttpd/patches/patch-src_mod_compress_c | 14 ---- .../patches/patch-src_mod_extforward_c | 14 ---- www/lighttpd/patches/patch-src_mod_magnet_c | 18 ----- .../patches/patch-src_network_openssl_c | 19 ----- www/lighttpd/patches/patch-src_response_c | 12 ---- www/lighttpd/pkg/PLIST | 8 +-- 10 files changed, 11 insertions(+), 193 deletions(-) delete mode 100644 www/lighttpd/patches/patch-src_connections_c delete mode 100644 www/lighttpd/patches/patch-src_mod_cgi_c delete mode 100644 www/lighttpd/patches/patch-src_mod_compress_c delete mode 100644 www/lighttpd/patches/patch-src_mod_extforward_c delete mode 100644 www/lighttpd/patches/patch-src_mod_magnet_c delete mode 100644 www/lighttpd/patches/patch-src_network_openssl_c delete mode 100644 www/lighttpd/patches/patch-src_response_c diff --git a/www/lighttpd/Makefile b/www/lighttpd/Makefile index cd048a3a36e..362c73e0a54 100644 --- a/www/lighttpd/Makefile +++ b/www/lighttpd/Makefile @@ -1,11 +1,10 @@ -# $OpenBSD: Makefile,v 1.53 2008/04/25 10:23:07 jasper Exp $ +# $OpenBSD: Makefile,v 1.54 2008/10/23 20:29:17 brad Exp $ SHARED_ONLY= Yes COMMENT= secure, fast, compliant, and very flexible web-server -DISTNAME= lighttpd-1.4.19 -PKGNAME= ${DISTNAME}p3 +DISTNAME= lighttpd-1.4.20 CATEGORIES= www net MASTER_SITES= ${HOMEPAGE}/download/ diff --git a/www/lighttpd/distinfo b/www/lighttpd/distinfo index 92affcbeead..3233fd8aae9 100644 --- a/www/lighttpd/distinfo +++ b/www/lighttpd/distinfo @@ -1,5 +1,5 @@ -MD5 (lighttpd-1.4.19.tar.gz) = zt5BDnre4+oUIGdJGQqLXQ== -RMD160 (lighttpd-1.4.19.tar.gz) = fb4qIgUeGPQDe0juSBHiyXONIM8= -SHA1 (lighttpd-1.4.19.tar.gz) = eeLWHdkBfDxQwP6YsiicrlwSVe4= -SHA256 (lighttpd-1.4.19.tar.gz) = RFMkuVgR4o7RryPbA2SBNs4zR4HomrhY+0/VcQFvsd8= -SIZE (lighttpd-1.4.19.tar.gz) = 815568 +MD5 (lighttpd-1.4.20.tar.gz) = fOfu+0h2grYdmwa0GGTGSg== +RMD160 (lighttpd-1.4.20.tar.gz) = Ii6cabYUZ/k3Z2j5Kl7uOt15YCA= +SHA1 (lighttpd-1.4.20.tar.gz) = YXkMAtnpbDyyP/05B/HK7mTEdd0= +SHA256 (lighttpd-1.4.20.tar.gz) = MqJa0ZNyvVvkUQ2TR5VqywM3D9hs/t3tYfQjtze33bE= +SIZE (lighttpd-1.4.20.tar.gz) = 827538 diff --git a/www/lighttpd/patches/patch-src_connections_c b/www/lighttpd/patches/patch-src_connections_c deleted file mode 100644 index dab974dfeaf..00000000000 --- a/www/lighttpd/patches/patch-src_connections_c +++ /dev/null @@ -1,70 +0,0 @@ -$OpenBSD: patch-src_connections_c,v 1.6 2008/04/08 19:11:40 jasper Exp $ ---- src/connections.c.orig Wed Feb 27 18:41:35 2008 -+++ src/connections.c Mon Apr 7 21:39:42 2008 -@@ -199,6 +199,7 @@ static int connection_handle_read_ssl(server *srv, con - - /* don't resize the buffer if we were in SSL_ERROR_WANT_* */ - -+ ERR_clear_error(); - do { - if (!con->ssl_error_want_reuse_buffer) { - b = buffer_init(); -@@ -1668,21 +1669,51 @@ int connection_state_machine(server *srv, connection * - } - #ifdef USE_OPENSSL - if (srv_sock->is_ssl) { -- int ret; -+ int ret, ssl_r; -+ unsigned long err; -+ ERR_clear_error(); - switch ((ret = SSL_shutdown(con->ssl))) { - case 1: - /* ok */ - break; - case 0: -- SSL_shutdown(con->ssl); -- break; -+ ERR_clear_error(); -+ if (-1 != (ret = SSL_shutdown(con->ssl))) break; -+ -+ /* fall through */ - default: -- log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:", -- SSL_get_error(con->ssl, ret), -- ERR_error_string(ERR_get_error(), NULL)); -- return -1; -+ -+ switch ((ssl_r = SSL_get_error(con->ssl, ret))) { -+ case SSL_ERROR_WANT_WRITE: -+ case SSL_ERROR_WANT_READ: -+ break; -+ case SSL_ERROR_SYSCALL: -+ /* perhaps we have error waiting in our error-queue */ -+ if (0 != (err = ERR_get_error())) { -+ do { -+ log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:", -+ ssl_r, ret, -+ ERR_error_string(err, NULL)); -+ } while((err = ERR_get_error())); -+ } else { -+ log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL (error):", -+ ssl_r, ret, errno, -+ strerror(errno)); -+ } -+ -+ break; -+ default: -+ while((err = ERR_get_error())) { -+ log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:", -+ ssl_r, ret, -+ ERR_error_string(err, NULL)); -+ } -+ -+ break; -+ } - } - } -+ ERR_clear_error(); - #endif - - switch(con->mode) { diff --git a/www/lighttpd/patches/patch-src_mod_cgi_c b/www/lighttpd/patches/patch-src_mod_cgi_c deleted file mode 100644 index 5ce438fba7e..00000000000 --- a/www/lighttpd/patches/patch-src_mod_cgi_c +++ /dev/null @@ -1,34 +0,0 @@ -$OpenBSD: patch-src_mod_cgi_c,v 1.1 2008/04/25 10:23:07 jasper Exp $ ---- src/mod_cgi.c.orig Thu Apr 24 01:17:35 2008 -+++ src/mod_cgi.c Thu Apr 24 01:19:08 2008 -@@ -1058,8 +1058,9 @@ static int cgi_create_env(server *srv, connection *con - switch(errno) { - case ENOSPC: - con->http_status = 507; -- - break; -+ case EINTR: -+ continue; - default: - con->http_status = 403; - break; -@@ -1071,8 +1072,9 @@ static int cgi_create_env(server *srv, connection *con - switch(errno) { - case ENOSPC: - con->http_status = 507; -- - break; -+ case EINTR: -+ continue; - default: - con->http_status = 403; - break; -@@ -1087,6 +1089,8 @@ static int cgi_create_env(server *srv, connection *con - c->offset += r; - cq->bytes_out += r; - } else { -+ log_error_write(srv, __FILE__, __LINE__, "ss", "write() failed due to: ", strerror(errno)); -+ con->http_status = 500; - break; - } - chunkqueue_remove_finished_chunks(cq); diff --git a/www/lighttpd/patches/patch-src_mod_compress_c b/www/lighttpd/patches/patch-src_mod_compress_c deleted file mode 100644 index 3933ce5ae73..00000000000 --- a/www/lighttpd/patches/patch-src_mod_compress_c +++ /dev/null @@ -1,14 +0,0 @@ -$OpenBSD: patch-src_mod_compress_c,v 1.1 2008/03/16 18:43:31 brad Exp $ ---- src/mod_compress.c.orig Sun Mar 16 09:14:55 2008 -+++ src/mod_compress.c Sun Mar 16 09:15:28 2008 -@@ -178,9 +178,9 @@ SETDEFAULTS_FUNC(mod_compress_setdefaults) { - } - - if (!buffer_is_empty(s->compress_cache_dir)) { -+ struct stat st; - mkdir_recursive(s->compress_cache_dir->ptr); - -- struct stat st; - if (0 != stat(s->compress_cache_dir->ptr, &st)) { - log_error_write(srv, __FILE__, __LINE__, "sbs", "can't stat compress.cache-dir", - s->compress_cache_dir, strerror(errno)); diff --git a/www/lighttpd/patches/patch-src_mod_extforward_c b/www/lighttpd/patches/patch-src_mod_extforward_c deleted file mode 100644 index 1bf1c441370..00000000000 --- a/www/lighttpd/patches/patch-src_mod_extforward_c +++ /dev/null @@ -1,14 +0,0 @@ -$OpenBSD: patch-src_mod_extforward_c,v 1.1 2008/03/16 18:43:31 brad Exp $ ---- src/mod_extforward.c.orig Sun Mar 16 09:16:32 2008 -+++ src/mod_extforward.c Sun Mar 16 09:17:07 2008 -@@ -281,8 +281,9 @@ static int is_proxy_trusted(const char *ipstr, plugin_ - static const char *last_not_in_array(array *a, plugin_data *p) - { - array *forwarder = p->conf.forwarder; -+ int i; - -- for (int i = a->used - 1; i >= 0; i--) { -+ for (i = a->used - 1; i >= 0; i--) { - data_string *ds = (data_string *)a->data[i]; - const char *ip = ds->value->ptr; - diff --git a/www/lighttpd/patches/patch-src_mod_magnet_c b/www/lighttpd/patches/patch-src_mod_magnet_c deleted file mode 100644 index cd4879296b6..00000000000 --- a/www/lighttpd/patches/patch-src_mod_magnet_c +++ /dev/null @@ -1,18 +0,0 @@ -$OpenBSD: patch-src_mod_magnet_c,v 1.1 2008/04/25 10:23:07 jasper Exp $ ---- src/mod_magnet.c.orig Thu Apr 24 01:16:35 2008 -+++ src/mod_magnet.c Thu Apr 24 01:17:24 2008 -@@ -761,11 +761,13 @@ static handler_t magnet_attract(server *srv, connectio - - if (lua_return_value > 99) { - con->http_status = lua_return_value; -- con->file_finished = 1; - - /* try { ...*/ - if (0 == setjmp(exceptionjmp)) { - magnet_attach_content(srv, con, p, L); -+ if (!chunkqueue_is_empty(con->write_queue)) { -+ con->mode = p->id; -+ } - } else { - /* } catch () { */ - con->http_status = 500; diff --git a/www/lighttpd/patches/patch-src_network_openssl_c b/www/lighttpd/patches/patch-src_network_openssl_c deleted file mode 100644 index 575ed955da9..00000000000 --- a/www/lighttpd/patches/patch-src_network_openssl_c +++ /dev/null @@ -1,19 +0,0 @@ -$OpenBSD: patch-src_network_openssl_c,v 1.1 2008/04/03 10:18:15 jasper Exp $ ---- src/network_openssl.c.orig Wed Apr 2 19:20:16 2008 -+++ src/network_openssl.c Wed Apr 2 19:21:18 2008 -@@ -85,6 +85,7 @@ int network_write_chunkqueue_openssl(server *srv, conn - * - */ - -+ ERR_clear_error(); - if ((r = SSL_write(ssl, offset, toSend)) <= 0) { - unsigned long err; - -@@ -187,6 +188,7 @@ int network_write_chunkqueue_openssl(server *srv, conn - - close(ifd); - -+ ERR_clear_error(); - if ((r = SSL_write(ssl, s, toSend)) <= 0) { - unsigned long err; - diff --git a/www/lighttpd/patches/patch-src_response_c b/www/lighttpd/patches/patch-src_response_c deleted file mode 100644 index e95298695e9..00000000000 --- a/www/lighttpd/patches/patch-src_response_c +++ /dev/null @@ -1,12 +0,0 @@ -$OpenBSD: patch-src_response_c,v 1.1 2008/04/16 20:42:35 jasper Exp $ ---- src/response.c.orig Fri Apr 11 19:36:38 2008 -+++ src/response.c Fri Apr 11 19:37:12 2008 -@@ -101,7 +101,7 @@ int http_response_write_header(server *srv, connection - if (!have_server) { - if (buffer_is_empty(con->conf.server_tag)) { - BUFFER_APPEND_STRING_CONST(b, "\r\nServer: " PACKAGE_NAME "/" PACKAGE_VERSION); -- } else { -+ } else if (con->conf.server_tag->used > 1) { - BUFFER_APPEND_STRING_CONST(b, "\r\nServer: "); - buffer_append_string_encoded(b, CONST_BUF_LEN(con->conf.server_tag), ENCODING_HTTP_HEADER); - } diff --git a/www/lighttpd/pkg/PLIST b/www/lighttpd/pkg/PLIST index 5f499aa5bbd..cbb13417b92 100644 --- a/www/lighttpd/pkg/PLIST +++ b/www/lighttpd/pkg/PLIST @@ -1,7 +1,7 @@ -@comment $OpenBSD: PLIST,v 1.18 2008/04/16 20:42:35 jasper Exp $ +@comment $OpenBSD: PLIST,v 1.19 2008/10/23 20:29:17 brad Exp $ @newgroup _lighttpd:585 @newuser _lighttpd:585:_lighttpd:daemon:lighttpd Account:/nonexistent:/sbin/nologin -bin/spawn-fcgi +@bin bin/spawn-fcgi lib/lighttpd/ @comment lib/lighttpd/mod_access.la lib/lighttpd/mod_access.so @@ -68,8 +68,8 @@ lib/lighttpd/mod_webdav.so %%mysql%% @man man/man1/lighttpd.1 @man man/man1/spawn-fcgi.1 -sbin/lighttpd -sbin/lighttpd-angel +@bin sbin/lighttpd +@bin sbin/lighttpd-angel share/doc/lighttpd/ share/doc/lighttpd/access.txt share/doc/lighttpd/accesslog.txt