[LEDE-DEV] [PATCH packages] lighttpd: fix regression in local-redir used with url.rewrite-once

Rafał Miłecki zajec5 at gmail.com
Tue Feb 21 05:39:36 PST 2017


From: Rafał Miłecki <rafal at milecki.pl>

This fixes upstream regression introduced in 1.4.40. It was reported,
debugged & fixed in https://redmine.lighttpd.net/issues/2793

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 net/lighttpd/Makefile                              |  2 +-
 ...tion-between-CGI-local-redir-and-the-url..patch | 29 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 net/lighttpd/patches/0001-Fix-interaction-between-CGI-local-redir-and-the-url..patch

diff --git a/net/lighttpd/Makefile b/net/lighttpd/Makefile
index 64b8500f..870fe80c 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-Fix-interaction-between-CGI-local-redir-and-the-url..patch b/net/lighttpd/patches/0001-Fix-interaction-between-CGI-local-redir-and-the-url..patch
new file mode 100644
index 00000000..27cdc289
--- /dev/null
+++ b/net/lighttpd/patches/0001-Fix-interaction-between-CGI-local-redir-and-the-url..patch
@@ -0,0 +1,29 @@
+From: Glenn Strauss <gstrauss at gluelogic.com>
+Subject: [PATCH] Fix interaction between CGI local-redir and the
+ url.rewrite-once state
+
+This fixes regression introduced in 1.4.40. Redirecting didn't work
+properly between 2 URLs handled by url.rewrite-once.
+
+Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
+---
+
+--- a/src/mod_cgi.c
++++ b/src/mod_cgi.c
+@@ -560,6 +560,7 @@ static int cgi_demux_response(server *srv, handler_ctx *hctx) {
+ 							}
+ 
+ 							connection_response_reset(srv, con); /*(includes con->http_status = 0)*/
++							plugins_call_connection_reset(srv, con);
+ 
+ 							con->mode = DIRECT;
+ 							return FDEVENT_HANDLED_COMEBACK;
+@@ -780,7 +781,7 @@ static int cgi_recv_response(server *srv, handler_ctx *hctx) {
+ 			/* 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)*/
+ 			return HANDLER_COMEBACK;
+ 		case FDEVENT_HANDLED_ERROR:
+ 			log_error_write(srv, __FILE__, __LINE__, "s", "demuxer failed: ");
-- 
2.11.0




More information about the Lede-dev mailing list