SOURCES: lighttpd-branch.diff - update to @2061

glen glen at pld-linux.org
Mon Jan 21 09:24:49 CET 2008


Author: glen                         Date: Mon Jan 21 08:24:49 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- update to @2061

---- Files affected:
SOURCES:
   lighttpd-branch.diff (1.29 -> 1.30) 

---- Diffs:

================================================================
Index: SOURCES/lighttpd-branch.diff
diff -u SOURCES/lighttpd-branch.diff:1.29 SOURCES/lighttpd-branch.diff:1.30
--- SOURCES/lighttpd-branch.diff:1.29	Fri Jan 18 18:02:51 2008
+++ SOURCES/lighttpd-branch.diff	Mon Jan 21 09:24:44 2008
@@ -2,8 +2,8 @@
 ===================================================================
 Index: src/configfile-glue.c
 ===================================================================
---- src/configfile-glue.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/configfile-glue.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/configfile-glue.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/configfile-glue.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -341,6 +341,10 @@
  		}
  		break;
@@ -17,8 +17,8 @@
  		break;
 Index: src/base.h
 ===================================================================
---- src/base.h	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/base.h	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/base.h	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/base.h	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -515,6 +515,7 @@
  #ifdef USE_OPENSSL
  	SSL_CTX *ssl_ctx;
@@ -29,8 +29,8 @@
  typedef struct {
 Index: src/array.h
 ===================================================================
---- src/array.h	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/array.h	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/array.h	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/array.h	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -90,6 +90,7 @@
  	COMP_HTTP_COOKIE,
  	COMP_HTTP_REMOTEIP,
@@ -41,8 +41,8 @@
  } comp_key_t;
 Index: src/mod_staticfile.c
 ===================================================================
---- src/mod_staticfile.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/mod_staticfile.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/mod_staticfile.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/mod_staticfile.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -483,8 +483,24 @@
  			/* if the value is the same as our ETag, we do a Range-request,
  			 * otherwise a full 200 */
@@ -71,8 +71,8 @@
  
 Index: src/mod_scgi.c
 ===================================================================
---- src/mod_scgi.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/mod_scgi.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/mod_scgi.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/mod_scgi.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -2694,8 +2694,9 @@
  		if (s_len < ct_len) continue;
  
@@ -87,8 +87,8 @@
  			break;
 Index: src/response.c
 ===================================================================
---- src/response.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/response.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/response.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/response.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -59,7 +59,8 @@
  		ds = (data_string *)con->response.headers->data[i];
  
@@ -109,8 +109,8 @@
  		config_patch_connection(srv, con, COMP_HTTP_REFERER);   /* Referer:     */
 Index: src/mod_userdir.c
 ===================================================================
---- src/mod_userdir.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/mod_userdir.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/mod_userdir.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/mod_userdir.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -21,6 +21,7 @@
  	array *include_user;
  	buffer *path;
@@ -171,8 +171,8 @@
  	BUFFER_APPEND_SLASH(p->temp_path);
 Index: src/mod_proxy.c
 ===================================================================
---- src/mod_proxy.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/mod_proxy.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/mod_proxy.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/mod_proxy.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1093,15 +1093,17 @@
  		if (s_len < ct_len) continue;
  
@@ -199,29 +199,209 @@
  			break;
 Index: src/mod_extforward.c
 ===================================================================
---- src/mod_extforward.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/mod_extforward.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
-@@ -379,9 +379,15 @@
+--- src/mod_extforward.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/mod_extforward.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
+@@ -20,6 +20,7 @@
+ /**
+  * mod_extforward.c for lighttpd, by comman.kang <at> gmail <dot> com
+  *                  extended, modified by Lionel Elie Mamane (LEM), lionel <at> mamane <dot> lu
++ *                  support chained proxies by glen at delfi.ee, #1528
+  *
+  * Config example:
+  *
+@@ -33,6 +34,10 @@
+  *       Note that "all" has precedence over specific entries,
+  *       so "all except" setups will not work.
+  *
++ *       In case you have chained proxies, you can add all their IP's to the
++ *       config. However "all" has effect only on connecting IP, as the
++ *       X-Forwarded-For header can not be trusted.
++ *
+  * Note: The effect of this module is variable on $HTTP["remotip"] directives and
+  *       other module's remote ip dependent actions.
+  *  Things done by modules before we change the remoteip or after we reset it will match on the proxy's IP.
+@@ -225,18 +230,16 @@
+ 		char *base, *curr;
+ 		/* state variable, 0 means not in string, 1 means in string */
+ 		int in_str = 0;
+-		for (base = pbuffer->ptr, curr = pbuffer->ptr; *curr; curr++)
+-		{
++		for (base = pbuffer->ptr, curr = pbuffer->ptr; *curr; curr++) {
+ 			if (in_str) {
+-				if ( (*curr > '9' || *curr < '0') && *curr != '.' && *curr != ':' ) {
++				if ((*curr > '9' || *curr < '0') && *curr != '.' && *curr != ':') {
+ 					/* found an separator , insert value into result array */
+-					put_string_into_array_len(result, base, curr-base);
++					put_string_into_array_len(result, base, curr - base);
+ 					/* change state to not in string */
+ 					in_str = 0;
+ 				}
+ 			} else {
+-				if (*curr >= '0' && *curr <= '9')
+-				{
++				if (*curr >= '0' && *curr <= '9') {
+ 					/* found leading char of an IP address, move base pointer and change state */
+ 					base = curr;
+ 					in_str = 1;
+@@ -244,9 +247,8 @@
+ 			}
+ 		}
+ 		/* if breaking out while in str, we got to the end of string, so add it */
+-		if (in_str)
+-		{
+-			put_string_into_array_len(result, base, curr-base);
++		if (in_str) {
++			put_string_into_array_len(result, base, curr - base);
+ 		}
+ 	}
+ 	return result;
+@@ -255,20 +257,42 @@
+ #define IP_TRUSTED 1
+ #define IP_UNTRUSTED 0
+ /*
+-   check whether ip is trusted, return 1 for trusted , 0 for untrusted
+-*/
++ * check whether ip is trusted, return 1 for trusted , 0 for untrusted
++ */
+ static int is_proxy_trusted(const char *ipstr, plugin_data *p)
+ {
+-	data_string* allds = (data_string *) array_get_element(p->conf.forwarder,"all");
++	data_string* allds = (data_string *)array_get_element(p->conf.forwarder, "all");
++
+ 	if (allds) {
+-		if (strcasecmp(allds->value->ptr,"trust") == 0)
++		if (strcasecmp(allds->value->ptr, "trust") == 0) {
+ 			return IP_TRUSTED;
+-		else
++		} else {
+ 			return IP_UNTRUSTED;
++		}
+ 	}
+-	return (data_string *)array_get_element(p->conf.forwarder,ipstr) ? IP_TRUSTED : IP_UNTRUSTED ;
++
++	return (data_string *)array_get_element(p->conf.forwarder, ipstr) ? IP_TRUSTED : IP_UNTRUSTED;
+ }
+ 
++/*
++ * Return char *ip of last address of proxy that is not trusted.
++ * Do not accept "all" keyword here.
++ */
++static const char *last_not_in_array(array *a, plugin_data *p)
++{
++	array *forwarder = p->conf.forwarder;
++
++	for (int i = a->used - 1; i >= 0; i--) {
++		data_string *ds = (data_string *)a->data[i];
++		const char *ip = ds->value->ptr;
++
++		if (!array_get_element(forwarder, ip)) {
++			return ip;
++		}
++	}
++	return NULL;
++}
++
+ struct addrinfo *ipstr_to_sockaddr(const char *host)
+ {
+    struct addrinfo hints, *res0;
+@@ -316,9 +340,8 @@
+ 	struct addrinfo *addrlist = NULL;
+ #endif
+ 	const char *dst_addr_str = NULL;
+-	int i;
+ 	array *forward_array = NULL;
+-	char *real_remote_addr = NULL;
++	const char *real_remote_addr = NULL;
+ #ifdef HAVE_IPV6
+ #endif
+ 
+@@ -342,7 +365,6 @@
+ 		return HANDLER_GO_ON;
+ 	}
+ 
+-	/* if the remote ip itself is not trusted , then do nothing */
+ #ifdef HAVE_IPV6
+ 	dst_addr_str = inet_ntop(con->dst_addr.plain.sa_family,
+ 		      con->dst_addr.plain.sa_family == AF_INET6 ?
+@@ -353,7 +375,9 @@
+ #else
+ 	dst_addr_str = inet_ntoa(con->dst_addr.ipv4.sin_addr);
+ #endif
+-	if (IP_UNTRUSTED == is_proxy_trusted (dst_addr_str, p) ) {
++
++	/* if the remote ip itself is not trusted, then do nothing */
++	if (IP_UNTRUSTED == is_proxy_trusted(dst_addr_str, p)) {
+ 		if (con->conf.log_request_handling) {
+ 			log_error_write(srv, __FILE__, __LINE__, "s",
+ 					"remote address is NOT a trusted proxy, skipping");
+@@ -362,40 +386,34 @@
+ 		return HANDLER_GO_ON;
+ 	}
  
++	/* build forward_array from forwarded data_string */
+ 	forward_array = extract_forward_array(forwarded->value);
++	real_remote_addr = last_not_in_array(forward_array, p);
+ 
+-	/* Testing shows that multiple headers and multiple values in one header
+-	   come in _reverse_ order. So the first one we get is the last one in the request. */
+-	for (i = forward_array->used - 1; i >= 0; i--) {
+-		data_string *ds = (data_string *) forward_array->data[i];
+-		if (ds) {
+-			real_remote_addr = ds->value->ptr;
+-			break;
+-		} else {
+-			/* bug ?  bailing out here */
+-			break;
+-		}
+-	}
+-
  	if (real_remote_addr != NULL) { /* parsed */
  		sock_addr sock;
 -
  		struct addrinfo *addrs_left;
 +		server_socket *srv_sock = con->srv_socket;
-+		data_string *forwarded_proto = (data_string *) array_get_element(con->request.headers,"X-Forwarded-Proto");
++		data_string *forwarded_proto = (data_string *)array_get_element(con->request.headers, "X-Forwarded-Proto");
  
-+		if (forwarded_proto && !strcmp(forwarded_proto->value->ptr, "https"))
++		if (forwarded_proto && !strcmp(forwarded_proto->value->ptr, "https")) {
 +			srv_sock->is_proxy_ssl = 1;
-+		else
++		} else {
 +			srv_sock->is_proxy_ssl = 0;
++		}
 +
  		if (con->conf.log_request_handling) {
-  			log_error_write(srv, __FILE__, __LINE__, "ss",
- 					"using address:", real_remote_addr);
+- 			log_error_write(srv, __FILE__, __LINE__, "ss",
+-					"using address:", real_remote_addr);
++ 			log_error_write(srv, __FILE__, __LINE__, "ss", "using address:", real_remote_addr);
+ 		}
+ #ifdef HAVE_IPV6
+ 		addrlist = ipstr_to_sockaddr(real_remote_addr);
+ 		sock.plain.sa_family = AF_UNSPEC;
+-		for (addrs_left = addrlist; addrs_left != NULL;
+-		     addrs_left = addrs_left -> ai_next) {
++		for (addrs_left = addrlist; addrs_left != NULL; addrs_left = addrs_left -> ai_next) {
+ 			sock.plain.sa_family = addrs_left->ai_family;
+-			if ( sock.plain.sa_family == AF_INET ) {
++			if (sock.plain.sa_family == AF_INET) {
+ 				sock.ipv4.sin_addr = ((struct sockaddr_in*)addrs_left->ai_addr)->sin_addr;
+ 				break;
+-			} else if ( sock.plain.sa_family == AF_INET6 ) {
++			} else if (sock.plain.sa_family == AF_INET6) {
+ 				sock.ipv6.sin6_addr = ((struct sockaddr_in6*)addrs_left->ai_addr)->sin6_addr;
+ 				break;
+ 			}
+@@ -430,7 +448,7 @@
+ 		if (addrlist != NULL ) freeaddrinfo(addrlist);
+ #endif
+ 	}
+-   	array_free(forward_array);
++	array_free(forward_array);
+ 
+ 	/* not found */
+ 	return HANDLER_GO_ON;
 Index: src/Makefile.am
 ===================================================================
---- src/Makefile.am	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/Makefile.am	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/Makefile.am	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/Makefile.am	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -281,4 +281,4 @@
  #ajp_SOURCES = ajp.c
  
@@ -230,8 +410,8 @@
 +EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c SConscript
 Index: src/configparser.y
 ===================================================================
---- src/configparser.y	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/configparser.y	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/configparser.y	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/configparser.y	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -422,6 +422,7 @@
        { COMP_HTTP_COOKIE,        CONST_STR_LEN("HTTP[\"cookie\"]"     ) },
        { COMP_HTTP_REMOTEIP,      CONST_STR_LEN("HTTP[\"remoteip\"]"   ) },
@@ -242,8 +422,8 @@
      size_t i;
 Index: src/mod_status.c
 ===================================================================
---- src/mod_status.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/mod_status.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/mod_status.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/mod_status.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -560,6 +560,8 @@
  	double avg;
  	time_t ts;
@@ -278,8 +458,8 @@
  	response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/plain"));
 Index: src/mod_ssi.c
 ===================================================================
---- src/mod_ssi.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/mod_ssi.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/mod_ssi.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/mod_ssi.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -36,6 +36,11 @@
  #include <sys/filio.h>
  #endif
@@ -347,8 +527,8 @@
  
 Index: src/spawn-fcgi.c
 ===================================================================
---- src/spawn-fcgi.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/spawn-fcgi.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/spawn-fcgi.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/spawn-fcgi.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -37,7 +37,7 @@
  #endif
  
@@ -482,8 +662,8 @@
  int main() {
 Index: src/mod_auth.c
 ===================================================================
---- src/mod_auth.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/mod_auth.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/mod_auth.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/mod_auth.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -238,13 +238,13 @@
  			int auth_type_len = auth_realm - http_authorization;
  
@@ -502,8 +682,8 @@
  						con->http_status = 400;
 Index: src/mod_fastcgi.c
 ===================================================================
---- src/mod_fastcgi.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/mod_fastcgi.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/mod_fastcgi.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/mod_fastcgi.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -162,8 +162,8 @@
  	 * if host is one of the local IP adresses the
  	 * whole connection is local
@@ -665,8 +845,8 @@
  
 Index: src/server.c
 ===================================================================
---- src/server.c	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ src/server.c	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- src/server.c	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ src/server.c	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -759,6 +759,19 @@
  
  			return -1;
@@ -739,8 +919,8 @@
  #ifdef HAVE_SIGACTION
 Index: tests/mod-access.t
 ===================================================================
---- tests/mod-access.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/mod-access.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/mod-access.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/mod-access.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,9 +1,9 @@
  #!/usr/bin/env perl
  BEGIN {
@@ -757,8 +937,8 @@
  use strict;
 Index: tests/mod-auth.t
 ===================================================================
---- tests/mod-auth.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/mod-auth.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/mod-auth.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/mod-auth.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,14 +1,14 @@
  #!/usr/bin/env perl
  BEGIN {
@@ -800,8 +980,8 @@
 ===================================================================
 Index: tests/core-response.t
 ===================================================================
---- tests/core-response.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/core-response.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/core-response.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/core-response.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,10 +1,9 @@
  #!/usr/bin/env perl
 -
@@ -820,11 +1000,11 @@
 Index: tests/mod-extforward.conf
 ===================================================================
 --- tests/mod-extforward.conf	(.../tags/lighttpd-1.4.18)	(revision 0)
-+++ tests/mod-extforward.conf	(.../branches/lighttpd-1.4.x)	(revision 2060)
-@@ -0,0 +1,30 @@
++++ tests/mod-extforward.conf	(.../branches/lighttpd-1.4.x)	(revision 2061)
+@@ -0,0 +1,31 @@
 +debug.log-request-handling   = "enable"
-+debug.log-response-header   = "enable"
-+debug.log-request-header   = "enable"
++debug.log-response-header   = "disable"
++debug.log-request-header   = "disable"
 +
 +server.document-root         = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
 +server.pid-file              = env.SRCDIR + "/tmp/lighttpd/lighttpd.pid"
@@ -851,13 +1031,14 @@
 +
 +extforward.forwarder = (
 +	"127.0.0.1" => "trust",
++	"127.0.30.1" => "trust",
 +)
 Index: tests/symlink.t
 ===================================================================
 Index: tests/request.t
 ===================================================================
---- tests/request.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/request.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/request.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/request.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,9 +1,9 @@
  #!/usr/bin/env perl
  BEGIN {
@@ -874,8 +1055,8 @@
  use strict;
 Index: tests/mod-userdir.t
 ===================================================================
---- tests/mod-userdir.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/mod-userdir.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/mod-userdir.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/mod-userdir.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,9 +1,9 @@
  #!/usr/bin/env perl
  BEGIN {
@@ -892,8 +1073,8 @@
  use strict;
 Index: tests/core-keepalive.t
 ===================================================================
---- tests/core-keepalive.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/core-keepalive.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/core-keepalive.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/core-keepalive.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,10 +1,9 @@
  #!/usr/bin/env perl
 -
@@ -915,8 +1096,8 @@
 ===================================================================
 Index: tests/core-var-include.t
 ===================================================================
---- tests/core-var-include.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/core-var-include.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/core-var-include.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/core-var-include.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,9 +1,9 @@
  #!/usr/bin/env perl
  BEGIN {
@@ -934,8 +1115,8 @@
 Index: tests/mod-extforward.t
 ===================================================================
 --- tests/mod-extforward.t	(.../tags/lighttpd-1.4.18)	(revision 0)
-+++ tests/mod-extforward.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
-@@ -0,0 +1,41 @@
++++ tests/mod-extforward.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
+@@ -0,0 +1,48 @@
 +#!/usr/bin/env perl
 +BEGIN {
 +	# add current source dir to the include-path
@@ -946,7 +1127,7 @@
 +
 +use strict;
 +use IO::Socket;
-+use Test::More tests => 2;
++use Test::More tests => 5;
 +use LightyTest;
 +
 +my $tf = LightyTest->new();
@@ -956,8 +1137,6 @@
 +
 +ok($tf->start_proc == 0, "Starting lighttpd") or die();
 +
-+## check if If-Modified-Since, If-None-Match works
-+
 +$t->{REQUEST} = ( <<EOF
 +GET /ip.pl HTTP/1.0
 +Host: www.example.org
@@ -965,7 +1144,7 @@
 +EOF
 +);
 +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '127.0.10.1' } ];
-+ok($tf->handle_http($t) == 0, 'expect 127.0.10.1');
++ok($tf->handle_http($t) == 0, 'expect 127.0.10.1, from single ip');
 +
 +$t->{REQUEST} = ( <<EOF
 +GET /ip.pl HTTP/1.0
@@ -974,7 +1153,16 @@
 +EOF
 +);
 +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '127.0.20.1' } ];
-+ok($tf->handle_http($t) == 0, 'expect 127.0.20.1');
++ok($tf->handle_http($t) == 0, 'expect 127.0.20.1, from two ips');
++
++$t->{REQUEST} = ( <<EOF
++GET /ip.pl HTTP/1.0
++Host: www.example.org
++X-Forwarded-For: 127.0.10.1, 127.0.20.1, 127.0.30.1
++EOF
++);
++$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '127.0.20.1' } ];
++ok($tf->handle_http($t) == 0, 'expect 127.0.20.1, from chained proxies');
 +
 +ok($tf->stop_proc == 0, "Stopping lighttpd");
 
@@ -985,8 +1173,8 @@
 
 Index: tests/core-request.t
 ===================================================================
---- tests/core-request.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/core-request.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/core-request.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/core-request.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,9 +1,9 @@
  #!/usr/bin/env perl
  BEGIN {
@@ -1003,8 +1191,8 @@
  use strict;
 Index: tests/mod-redirect.t
 ===================================================================
---- tests/mod-redirect.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/mod-redirect.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/mod-redirect.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/mod-redirect.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,9 +1,9 @@
  #!/usr/bin/env perl
  BEGIN {
@@ -1021,8 +1209,8 @@
  use strict;
 Index: tests/mod-cgi.t
 ===================================================================
---- tests/mod-cgi.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/mod-cgi.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/mod-cgi.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/mod-cgi.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,9 +1,9 @@
  #!/usr/bin/env perl
  BEGIN {
@@ -1039,8 +1227,8 @@
  use strict;
 Index: tests/mod-setenv.t
 ===================================================================
---- tests/mod-setenv.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/mod-setenv.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/mod-setenv.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/mod-setenv.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
 @@ -1,10 +1,9 @@
  #!/usr/bin/env perl
 -
@@ -1058,8 +1246,8 @@
  use strict;
 Index: tests/cachable.t
 ===================================================================
---- tests/cachable.t	(.../tags/lighttpd-1.4.18)	(revision 2060)
-+++ tests/cachable.t	(.../branches/lighttpd-1.4.x)	(revision 2060)
+--- tests/cachable.t	(.../tags/lighttpd-1.4.18)	(revision 2061)
++++ tests/cachable.t	(.../branches/lighttpd-1.4.x)	(revision 2061)
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/lighttpd-branch.diff?r1=1.29&r2=1.30&f=u



More information about the pld-cvs-commit mailing list