From: Marcin Krol Date: Tue, 26 Jul 2016 12:40:43 +0000 (+0000) Subject: - updated to 1.4.40, partial PLD merge X-Git-Url: https://git.tld-linux.org/?p=packages%2Flighttpd.git;a=commitdiff_plain;h=82b54184faf5e32cf65c54d52bcecea5c2f03d5c - updated to 1.4.40, partial PLD merge --- diff --git a/lighttpd-branding.patch b/lighttpd-branding.patch index a3f634c..f7e6dd5 100644 --- a/lighttpd-branding.patch +++ b/lighttpd-branding.patch @@ -1,11 +1,19 @@ ---- lighttpd-1.4.36/src/response.c~ 2015-07-26 13:36:36.000000000 +0300 -+++ lighttpd-1.4.36/src/response.c 2015-07-26 18:29:48.302220417 +0300 -@@ -109,7 +109,7 @@ +--- lighttpd-1.4.40/src/response.c~ 2016-07-16 13:06:16.000000000 +0300 ++++ lighttpd-1.4.40/src/response.c 2016-07-25 14:16:59.131926942 +0300 +@@ -5,6 +5,7 @@ + #include "log.h" + #include "stat_cache.h" + #include "chunk.h" ++#include "version.h" - if (!have_server) { - if (buffer_is_empty(con->conf.server_tag)) { -- buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_DESC)); -+ buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_DESC " (TLD Linux)")); - } else if (!buffer_string_is_empty(con->conf.server_tag)) { + #include "configfile.h" + +@@ -111,6 +111,8 @@ + if (!buffer_string_is_empty(con->conf.server_tag)) { buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: ")); buffer_append_string_encoded(b, CONST_BUF_LEN(con->conf.server_tag), ENCODING_HTTP_HEADER); ++ } else { ++ buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_DESC " (TLD Linux)")); + } + } + diff --git a/lighttpd-mod_evasive-status_code.patch b/lighttpd-mod_evasive-status_code.patch index 02cbd9e..7f8dacc 100644 --- a/lighttpd-mod_evasive-status_code.patch +++ b/lighttpd-mod_evasive-status_code.patch @@ -1,11 +1,12 @@ ---- lighttpd-1.4.19/src/mod_evasive.c 2008-09-19 17:50:24.307245276 +0300 -+++ lighttpd-1.4.22/src/mod_evasive.c 2009-05-12 02:21:58.524447939 +0300 -@@ -28,11 +28,15 @@ +--- lighttpd-1.4.40/src/mod_evasive.c 2016-07-16 10:06:16.000000000 +0000 ++++ lighttpd-1.4.40/src/mod_evasive.c 2016-07-26 12:11:56.730554000 +0000 +@@ -31,12 +31,16 @@ typedef struct { unsigned short max_conns; unsigned short silent; + unsigned short http_status_code; + unsigned int retry_after; + buffer *location; } plugin_config; typedef struct { @@ -16,7 +17,7 @@ plugin_config **config_storage; plugin_config conf; -@@ -46,6 +50,10 @@ +@@ -47,6 +51,10 @@ p = calloc(1, sizeof(*p)); @@ -27,7 +28,7 @@ return p; } -@@ -56,6 +64,8 @@ +@@ -57,6 +65,8 @@ if (!p) return HANDLER_GO_ON; @@ -36,46 +37,49 @@ if (p->config_storage) { size_t i; for (i = 0; i < srv->config_context->used; i++) { -@@ -85,6 +85,8 @@ - config_values_t cv[] = { +@@ -84,6 +94,8 @@ { "evasive.max-conns-per-ip", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 0 */ { "evasive.silent", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */ -+ { "evasive.http-status-code", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 2 */ -+ { "evasive.retry-after", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 3 */ + { "evasive.location", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */ ++ { "evasive.http-status-code", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 3 */ ++ { "evasive.retry-after", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 4 */ { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET } }; -@@ -94,11 +96,15 @@ +@@ -94,13 +106,17 @@ plugin_config *s; s = calloc(1, sizeof(plugin_config)); - s->max_conns = 0; - s->silent = 0; +- s->location = buffer_init(); + s->max_conns = 0; + s->silent = 0; ++ s->location = buffer_init(); + s->http_status_code = 503; + s->retry_after = 0; cv[0].destination = &(s->max_conns); cv[1].destination = &(s->silent); + cv[2].destination = s->location; + cv[2].destination = &(s->http_status_code); + cv[3].destination = &(s->retry_after); p->config_storage[i] = s; -@@ -107,6 +123,8 @@ - +@@ -121,6 +137,8 @@ PATCH(max_conns); PATCH(silent); + PATCH(location); + PATCH(http_status_code); + PATCH(retry_after); /* skip the first, the global context */ for (i = 1; i < srv->config_context->used; i++) { -@@ -124,6 +142,10 @@ - PATCH(max_conns); - } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.silent"))) { +@@ -140,6 +158,10 @@ PATCH(silent); + } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.location"))) { + PATCH(location); + } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.http-status-code"))) { + PATCH(http_status_code); + } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.retry-after"))) { @@ -83,15 +87,14 @@ } } } -@@ -192,8 +214,10 @@ - inet_ntop_cache_get_ip(srv, &(con->dst_addr)), - "turned away. Too many connections."); - -- con->http_status = 403; +@@ -205,7 +227,9 @@ + con->http_status = 302; + con->file_finished = 1; + } else { +- con->http_status = 403; ++ con->http_status = p->conf.http_status_code; ++ buffer_copy_long(p->evasive_rftmp, p->conf.retry_after); ++ response_header_overwrite(srv, con, CONST_STR_LEN("Retry-After"), CONST_BUF_LEN(p->evasive_rftmp)); + } con->mode = DIRECT; -+ con->http_status = p->conf.http_status_code; -+ buffer_copy_long(p->evasive_rftmp, p->conf.retry_after); -+ response_header_overwrite(srv, con, CONST_STR_LEN("Retry-After"), CONST_BUF_LEN(p->evasive_rftmp)); return HANDLER_FINISHED; - } - } diff --git a/lighttpd.spec b/lighttpd.spec index 4d7f483..35eb70b 100644 --- a/lighttpd.spec +++ b/lighttpd.spec @@ -29,12 +29,12 @@ Summary: Fast and light HTTP server Summary(pl.UTF-8): Szybki i lekki serwer HTTP Name: lighttpd -Version: 1.4.39 -Release: 2 +Version: 1.4.40 +Release: 1 License: BSD Group: Networking/Daemons/HTTP Source0: http://download.lighttpd.net/lighttpd/releases-1.4.x/%{name}-%{version}.tar.xz -# Source0-md5: 63c7563be1c7a7a9819a51f07f1af8b2 +# Source0-md5: 89e0da2b6b8a2c4592d549ff10094068 Source1: %{name}.init Source2: %{name}.conf Source3: %{name}.user @@ -858,6 +858,7 @@ if [ "$ver" != "%{version}" ]; then fi %{__libtoolize} +%{__autoheader} %{__aclocal} %{__autoconf} %{__automake}