SSI forwards request method

Igor Sysoev is at rambler-co.ru
Wed Jan 9 18:23:20 MSK 2008


On Wed, Jan 09, 2008 at 10:07:11AM -0500, Larrytheliquid wrote:

> Thank you Igor. Which version is that patch targeted at?
> 
> I tried 0.5.35 and it wouldn't accept the patch:
> /usr/local/src/nginx-0.5.34 # patch -p0 < /root/patch-subrequest
> patching file src/http/ngx_http_core_module.c
> Hunk #1 FAILED at 113.
> Hunk #2 succeeded at 1427 (offset -336 lines).
> 1 out of 2 hunks FAILED -- saving rejects to file
> src/http/ngx_http_core_module.c.rej

The attached patch is against 0.5.35.

> 0.6.25 accepted the patch I but got compile errors:
> cc1: warnings being treated as errors
> src/http/ngx_http_core_module.c:116: warning: pointer targets in
> initialization differ in signedness
> make[1]: *** [objs/src/http/ngx_http_core_module.o] Error 1
> make[1]: Leaving directory `/usr/local/src/nginx-0.6.25'
> make: *** [build] Error 2

I did not test it under gcc 4.2. It should be

-static ngx_str_t  ngx_http_core_get_method = { 3, "GET " };
+static ngx_str_t  ngx_http_core_get_method = { 3, (u_char *) "GET " };


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/http/ngx_http_core_module.c
===================================================================
--- src/http/ngx_http_core_module.c	(revision 1174)
+++ src/http/ngx_http_core_module.c	(working copy)
@@ -90,6 +90,9 @@
 };
 
 
+static ngx_str_t  ngx_http_core_get_method = { 3, (u_char *) "GET " };
+
+
 static ngx_command_t  ngx_http_core_commands[] = {
 
     { ngx_string("variables_hash_max_size"),
@@ -1424,7 +1427,7 @@
     sr->subrequest_in_memory = (flags & NGX_HTTP_SUBREQUEST_IN_MEMORY) != 0;
 
     sr->unparsed_uri = r->unparsed_uri;
-    sr->method_name = r->method_name;
+    sr->method_name = ngx_http_core_get_method;
     sr->http_protocol = r->http_protocol;
 
     if (ngx_http_set_exten(sr) != NGX_OK) {


More information about the nginx mailing list