SOURCES: lighttpd-proxy-fix-redirects.patch - improved patch
aredridel
aredridel at pld-linux.org
Fri Jan 20 17:22:41 CET 2006
Author: aredridel Date: Fri Jan 20 16:22:41 2006 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- improved patch
---- Files affected:
SOURCES:
lighttpd-proxy-fix-redirects.patch (1.3 -> 1.4)
---- Diffs:
================================================================
Index: SOURCES/lighttpd-proxy-fix-redirects.patch
diff -u SOURCES/lighttpd-proxy-fix-redirects.patch:1.3 SOURCES/lighttpd-proxy-fix-redirects.patch:1.4
--- SOURCES/lighttpd-proxy-fix-redirects.patch:1.3 Tue Jan 10 10:14:29 2006
+++ SOURCES/lighttpd-proxy-fix-redirects.patch Fri Jan 20 17:22:36 2006
@@ -1,6 +1,6 @@
-diff -ur lighttpd-1.4.8-o/doc/proxy.txt lighttpd-1.4.8/doc/proxy.txt
---- lighttpd-1.4.8-o/doc/proxy.txt 2005-08-10 16:26:16.000000000 -0600
-+++ lighttpd-1.4.8/doc/proxy.txt 2006-01-10 01:55:04.000000000 -0700
+diff -ur lighttpd-1.4.9-a/doc/proxy.txt lighttpd-1.4.9/doc/proxy.txt
+--- lighttpd-1.4.9-a/doc/proxy.txt 2005-08-10 16:26:16.000000000 -0600
++++ lighttpd-1.4.9/doc/proxy.txt 2006-01-17 15:35:53.000000000 -0700
@@ -67,6 +67,8 @@
:"host": is ip of the proxy server
:"port": is tcp-port on the "host" used by the proxy
@@ -10,9 +10,9 @@
e.g.: ::
-diff -ur lighttpd-1.4.8-o/src/array.h lighttpd-1.4.8/src/array.h
---- lighttpd-1.4.8-o/src/array.h 2005-09-23 12:24:18.000000000 -0600
-+++ lighttpd-1.4.8/src/array.h 2006-01-10 00:38:55.000000000 -0700
+diff -ur lighttpd-1.4.9-a/src/array.h lighttpd-1.4.9/src/array.h
+--- lighttpd-1.4.9-a/src/array.h 2005-09-23 12:24:18.000000000 -0600
++++ lighttpd-1.4.9/src/array.h 2006-01-17 15:35:53.000000000 -0700
@@ -129,6 +129,7 @@
int usage; /* fair-balancing needs the no. of connections active on this host */
@@ -21,9 +21,9 @@
} data_fastcgi;
data_fastcgi *data_fastcgi_init(void);
-diff -ur lighttpd-1.4.8-o/src/data_fastcgi.c lighttpd-1.4.8/src/data_fastcgi.c
---- lighttpd-1.4.8-o/src/data_fastcgi.c 2005-08-23 08:36:12.000000000 -0600
-+++ lighttpd-1.4.8/src/data_fastcgi.c 2006-01-10 00:38:55.000000000 -0700
+diff -ur lighttpd-1.4.9-a/src/data_fastcgi.c lighttpd-1.4.9/src/data_fastcgi.c
+--- lighttpd-1.4.9-a/src/data_fastcgi.c 2005-08-23 08:36:12.000000000 -0600
++++ lighttpd-1.4.9/src/data_fastcgi.c 2006-01-17 15:35:53.000000000 -0700
@@ -57,6 +57,7 @@
ds->host = buffer_init();
ds->port = 0;
@@ -32,9 +32,9 @@
ds->copy = data_fastcgi_copy;
ds->free = data_fastcgi_free;
-diff -ur lighttpd-1.4.8-o/src/mod_proxy.c lighttpd-1.4.8/src/mod_proxy.c
---- lighttpd-1.4.8-o/src/mod_proxy.c 2005-11-18 05:29:36.000000000 -0700
-+++ lighttpd-1.4.8/src/mod_proxy.c 2006-01-10 00:58:18.000000000 -0700
+diff -ur lighttpd-1.4.9-a/src/mod_proxy.c lighttpd-1.4.9/src/mod_proxy.c
+--- lighttpd-1.4.9-a/src/mod_proxy.c 2006-01-03 04:02:29.000000000 -0700
++++ lighttpd-1.4.9/src/mod_proxy.c 2006-01-17 15:36:41.000000000 -0700
@@ -277,6 +277,7 @@
{ "host", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "port", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
@@ -51,7 +51,7 @@
if (0 != config_insert_values_internal(srv, da_host->value, pcv)) {
return HANDLER_ERROR;
-@@ -527,7 +529,7 @@
+@@ -532,7 +534,7 @@
}
@@ -60,25 +60,27 @@
char *s, *ns;
int http_response_status = -1;
-@@ -586,7 +588,17 @@
+@@ -591,7 +593,19 @@
break;
case 8:
if (0 == strncasecmp(key, "Location", key_len)) {
+ buffer *host;
con->parsed_response |= HTTP_LOCATION;
+
-+ host = buffer_init();
-+ buffer_copy_string_len(host, con->request.http_host, strchr(con->request.http_host->ptr, ':') - con->request.http_host->ptr);
++ if(strchr(con->request.http_host->ptr, ':')) {
++ host = buffer_init();
++ buffer_copy_string_len(host, con->request.http_host, strchr(con->request.http_host->ptr, ':') - con->request.http_host->ptr);
+
-+ if(hctx->host->fix_redirects && strncmp(value, "http://", 7) == 0 && strncasecmp(value + 7, host->ptr, host->used) == 0 && *(value + 7 + host->used) == ':' && atoi(value + 7 + host->used + 1) == hctx->host->port) {
-+ value = strchr(value + 7 + host->used, '/');
-+ }
++ if(hctx->host->fix_redirects && strncmp(value, "http://", 7) == 0 && strncasecmp(value + 7, host->ptr, host->used) == 0 && *(value + 7 + host->used) == ':' && atoi(value + 7 + host->used + 1) == hctx->host->port) {
++ value = strchr(value + 7 + host->used, '/');
++ }
+
-+ buffer_free(host);
++ buffer_free(host);
++ }
}
break;
case 10:
-@@ -688,7 +700,7 @@
+@@ -693,7 +707,7 @@
log_error_write(srv, __FILE__, __LINE__, "sb", "Header:", hctx->response_header);
#endif
/* parse the response header */
@@ -87,3 +89,4 @@
/* enable chunked-transfer-encoding */
if (con->request.http_version == HTTP_VERSION_1_1 &&
+Only in lighttpd-1.4.9/src: mod_proxy.c.orig
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/lighttpd-proxy-fix-redirects.patch?r1=1.3&r2=1.4&f=u
More information about the pld-cvs-commit
mailing list