]> git.pld-linux.org Git - packages/lighttpd.git/commitdiff
- better patch
authoraredridel <aredridel@pld-linux.org>
Tue, 10 Jan 2006 09:14:29 +0000 (09:14 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    lighttpd-proxy-fix-redirects.patch -> 1.3

lighttpd-proxy-fix-redirects.patch

index b9cd0c437b0738a40ee31b2faa65200f6eb8b258..a7d92ac200a4fe74aea4735a1699065495b9b1a5 100644 (file)
@@ -1,6 +1,18 @@
+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
+@@ -67,6 +67,8 @@
+   :"host":      is ip of the proxy server
+   :"port":      is tcp-port on the "host" used by the proxy
+                 server (default: 80)
++  :"fix-redirects":  rewrite redirects from proxied servers to reflect this
++                                                                               server's hostname and port
+   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 2005-12-30 03:01:39.000000000 -0700
++++ lighttpd-1.4.8/src/array.h 2006-01-10 00:38:55.000000000 -0700
 @@ -129,6 +129,7 @@
                
        int usage; /* fair-balancing needs the no. of connections active on this host */
@@ -11,7 +23,7 @@ diff -ur lighttpd-1.4.8-o/src/array.h lighttpd-1.4.8/src/array.h
  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  2005-12-30 03:01:39.000000000 -0700
++++ lighttpd-1.4.8/src/data_fastcgi.c  2006-01-10 00:38:55.000000000 -0700
 @@ -57,6 +57,7 @@
        ds->host = buffer_init();
        ds->port = 0;
@@ -22,7 +34,7 @@ diff -ur lighttpd-1.4.8-o/src/data_fastcgi.c lighttpd-1.4.8/src/data_fastcgi.c
        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     2005-12-30 03:05:19.000000000 -0700
++++ lighttpd-1.4.8/src/mod_proxy.c     2006-01-10 00:58:18.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 */
@@ -48,24 +60,25 @@ diff -ur lighttpd-1.4.8-o/src/mod_proxy.c lighttpd-1.4.8/src/mod_proxy.c
        char *s, *ns;
        int http_response_status = -1;
        
-@@ -586,7 +588,16 @@
+@@ -586,7 +588,17 @@
                        break;
                case 8:
                        if (0 == strncasecmp(key, "Location", key_len)) {
-+                              char *host;
++                              buffer *host;
                                con->parsed_response |= HTTP_LOCATION;
 +
-+                              host = strndup(con->request.http_host->ptr, strchr(con->request.http_host->ptr, ':') - 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 && strncasecmp(value, "http://", 7) == 0 && strncasecmp(value + 7, host, strlen(host)) == 0 && *(value + 7 + strlen(host)) == ':' && atoi(value + 7 + strlen(host) + 1) == hctx->host->port) {
-+                                      value = strchr(value + 7 + strlen(host), '/');
++                              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, '/');
 +                              }
 +
-+                              free(host);
++                              buffer_free(host);
                        }
                        break;
                case 10:
-@@ -688,7 +699,7 @@
+@@ -688,7 +700,7 @@
                                log_error_write(srv, __FILE__, __LINE__, "sb", "Header:", hctx->response_header);
  #endif
                                /* parse the response header */
This page took 0.03581 seconds and 4 git commands to generate.