From f99c3b2510bbc375ec48c116495b6d07a30e319f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 22 Feb 2017 08:19:49 +0100 Subject: [PATCH] lighttpd: fix regression in local-redir used with url.rewrite-once MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes upstream regression introduced in 1.4.40. It was reported & debugged in https://redmine.lighttpd.net/issues/2793 This fix is queued for 1.4.46 in the personal/gstrauss/master upstream branch. Signed-off-by: Rafał Miłecki --- net/lighttpd/Makefile | 2 +- ...local-redir-w-url.rewrite-once-fixes.patch | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 net/lighttpd/patches/0001-mod_cgi-fix-CGI-local-redir-w-url.rewrite-once-fixes.patch diff --git a/net/lighttpd/Makefile b/net/lighttpd/Makefile index 64b8500fcc..870fe80c85 100644 --- a/net/lighttpd/Makefile +++ b/net/lighttpd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lighttpd PKG_VERSION:=1.4.45 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://download.lighttpd.net/lighttpd/releases-1.4.x diff --git a/net/lighttpd/patches/0001-mod_cgi-fix-CGI-local-redir-w-url.rewrite-once-fixes.patch b/net/lighttpd/patches/0001-mod_cgi-fix-CGI-local-redir-w-url.rewrite-once-fixes.patch new file mode 100644 index 0000000000..a6bbcbe430 --- /dev/null +++ b/net/lighttpd/patches/0001-mod_cgi-fix-CGI-local-redir-w-url.rewrite-once-fixes.patch @@ -0,0 +1,32 @@ +From: Glenn Strauss +Subject: [PATCH] [mod_cgi] fix CGI local-redir w/ url.rewrite-once (fixes + #2793) + +x-ref: + "1.4.40 regression: broken redirect (using Location) between url.rewrite-once URLs" + https://redmine.lighttpd.net/issues/2793 +--- + src/mod_cgi.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/src/mod_cgi.c ++++ b/src/mod_cgi.c +@@ -560,8 +560,7 @@ static int cgi_demux_response(server *sr + } + + connection_response_reset(srv, con); /*(includes con->http_status = 0)*/ +- +- con->mode = DIRECT; ++ plugins_call_connection_reset(srv, con); + return FDEVENT_HANDLED_COMEBACK; + } + } +@@ -780,7 +779,7 @@ static int cgi_recv_response(server *srv + /* if we get a IN|HUP and have read everything don't exec the close twice */ + return HANDLER_FINISHED; + case FDEVENT_HANDLED_COMEBACK: +- cgi_connection_close(srv, hctx); ++ /*cgi_connection_close(srv, hctx);*//*(already cleaned up and hctx is now invalid)*/ + return HANDLER_COMEBACK; + case FDEVENT_HANDLED_ERROR: + log_error_write(srv, __FILE__, __LINE__, "s", "demuxer failed: "); -- 2.30.2