mirror of
				https://github.com/openresty/openresty.git
				synced 2024-10-13 00:29:41 +00:00 
			
		
		
		
	added the nonbuffered-upstream-truncation patch for nginx 1.2.3 to make ngx_http_upstream provide a way in the context of a subrequest to signal the parent of errors when upstream data truncation happens. thanks Bryan Alger for reporting this issue.
This commit is contained in:
		
							
								
								
									
										28
									
								
								patches/nginx-1.2.3-nonbuffered-upstream-truncation.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								patches/nginx-1.2.3-nonbuffered-upstream-truncation.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,28 @@ | ||||
| --- nginx-1.2.3/src/http/ngx_http_upstream.c	2012-09-05 14:39:33.234197951 -0700 | ||||
| +++ nginx-1.2.3-patched/src/http/ngx_http_upstream.c	2012-09-05 14:39:24.504183525 -0700 | ||||
| @@ -2384,6 +2384,7 @@ | ||||
|      c->log->action = "reading upstream"; | ||||
|   | ||||
|      if (c->read->timedout) { | ||||
| +        r->headers_out.status = NGX_HTTP_GATEWAY_TIME_OUT; | ||||
|          ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out"); | ||||
|          ngx_http_upstream_finalize_request(r, u, 0); | ||||
|          return; | ||||
| @@ -2431,10 +2432,13 @@ | ||||
|   | ||||
|              if (u->busy_bufs == NULL) { | ||||
|   | ||||
| -                if (u->length == 0 | ||||
| -                    || upstream->read->eof | ||||
| -                    || upstream->read->error) | ||||
| -                { | ||||
| +                if (u->length == 0) { | ||||
| +                    ngx_http_upstream_finalize_request(r, u, 0); | ||||
| +                    return; | ||||
| +                } | ||||
| + | ||||
| +                if (upstream->read->eof || upstream->read->error) { | ||||
| +                    r->headers_out.status = NGX_HTTP_BAD_GATEWAY; | ||||
|                      ngx_http_upstream_finalize_request(r, u, 0); | ||||
|                      return; | ||||
|                  } | ||||
| @ -93,6 +93,9 @@ fi | ||||
| echo applying location_if_inherits_proxy.patch ... | ||||
| patch -p1 < $root/patches/nginx-$main_ver-location_if_inherits_proxy.patch | ||||
|  | ||||
| echo applying nonbuffered-upstream-truncation.patch ... | ||||
| patch -p1 < $root/patches/nginx-$main_ver-nonbuffered-upstream-truncation.patch | ||||
|  | ||||
| echo applying dtrace.patch ... | ||||
| patch -p1 < $root/patches/nginx-$main_ver-dtrace.patch | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user