[oe-commits] org.oe.dev lighttpd: backport support for url.redirect-code from 1.5 branch

jeremy_laine commit oe at amethyst.openembedded.net
Wed Jun 11 16:10:09 UTC 2008


lighttpd: backport support for url.redirect-code from 1.5 branch

Author: jeremy_laine at openembedded.org
Branch: org.openembedded.dev
Revision: 1881f1e08c19772afb57e141b8e9cfe8a3308a4a
ViewMTN: http://monotone.openembedded.org/revision/info/1881f1e08c19772afb57e141b8e9cfe8a3308a4a
Files:
1
packages/lighttpd/lighttpd/mod_redirect.c.patch
packages/lighttpd/lighttpd_1.4.18.bb
Diffs:

#
# mt diff -r99ed4d92c897fb19999e63a3d7eb3b5fae762ff3 -r1881f1e08c19772afb57e141b8e9cfe8a3308a4a
#
#
#
# add_file "packages/lighttpd/lighttpd/mod_redirect.c.patch"
#  content [72125cb3f78b258d8cc10312b081efda99dc6566]
# 
# patch "packages/lighttpd/lighttpd_1.4.18.bb"
#  from [632e100a9bf487c1c13ab8a725b547925ad9d3b4]
#    to [87bdba70a8b53a9b74d557c0e814401db916a0b8]
#
============================================================
--- packages/lighttpd/lighttpd/mod_redirect.c.patch	72125cb3f78b258d8cc10312b081efda99dc6566
+++ packages/lighttpd/lighttpd/mod_redirect.c.patch	72125cb3f78b258d8cc10312b081efda99dc6566
@@ -0,0 +1,56 @@
+Backport support for url.redirect-code directive from 1.5 branch.
+
+diff -urN lighttpd-1.4.18.orig/src/mod_redirect.c lighttpd-1.4.18/src/mod_redirect.c
+--- lighttpd-1.4.18.orig/src/mod_redirect.c	2007-04-10 09:52:58.000000000 +0200
++++ lighttpd-1.4.18/src/mod_redirect.c	2008-06-11 17:38:50.000000000 +0200
+@@ -16,6 +16,8 @@
+ typedef struct {
+ 	pcre_keyvalue_buffer *redirect;
+ 	data_config *context; /* to which apply me */
++
++	unsigned short redirect_code;
+ } plugin_config;
+ 
+ typedef struct {
+@@ -72,6 +74,7 @@
+ 
+ 	config_values_t cv[] = {
+ 		{ "url.redirect",               NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
++		{ "url.redirect-code",          NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
+ 		{ NULL,                         NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
+ 	};
+ 
+@@ -90,6 +93,7 @@
+ 		s->redirect   = pcre_keyvalue_buffer_init();
+ 
+ 		cv[0].destination = s->redirect;
++		cv[1].destination = &(s->redirect_code);
+ 
+ 		p->config_storage[i] = s;
+ 		ca = ((data_config *)srv->config_context->data[i])->value;
+@@ -140,6 +144,7 @@
+ 	plugin_config *s = p->config_storage[0];
+ 
+ 	p->conf.redirect = s->redirect;
++	p->conf.redirect_code = s->redirect_code;
+ 	p->conf.context = NULL;
+ 
+ 	/* skip the first, the global context */
+@@ -157,6 +162,8 @@
+ 			if (0 == strcmp(du->key->ptr, "url.redirect")) {
+ 				p->conf.redirect = s->redirect;
+ 				p->conf.context = dc;
++			} else if (0 == strcmp(du->key->ptr, "url.redirect-code")) {
++				p->conf.redirect_code = s->redirect_code;
+ 			}
+ 		}
+ 	}
+@@ -250,7 +257,7 @@
+ 
+ 			response_header_insert(srv, con, CONST_STR_LEN("Location"), CONST_BUF_LEN(p->location));
+ 
+-			con->http_status = 301;
++			con->http_status = p->conf.redirect_code > 99 && p->conf.redirect_code < 1000 ? p->conf.redirect_code : 301;
+ 			con->file_finished = 1;
+ 
+ 			return HANDLER_FINISHED;
============================================================
--- packages/lighttpd/lighttpd_1.4.18.bb	632e100a9bf487c1c13ab8a725b547925ad9d3b4
+++ packages/lighttpd/lighttpd_1.4.18.bb	87bdba70a8b53a9b74d557c0e814401db916a0b8
@@ -2,10 +2,11 @@ DEPENDS = "libpcre"
 SECTION = "net"
 LICENSE = "BSD"
 DEPENDS = "libpcre"
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "http://www.lighttpd.net/download/lighttpd-${PV}.tar.gz \
 	   file://configure.in.patch;patch=1 \
+	   file://mod_redirect.c.patch;patch=1 \
 	   file://src-server.c.patch;patch=1 \
 	   file://index.html \
 	   file://lighttpd.conf \






More information about the Openembedded-commits mailing list