Mercurial > hg > nginx-vendor-current
comparison src/http/ngx_http_upstream.c @ 230:38e7b94d63ac NGINX_0_4_0
nginx 0.4.0
*) Change in internal API: the HTTP modules initialization was moved
from the init module phase to the HTTP postconfiguration phase.
*) Change: now the request body is not read beforehand for the
ngx_http_perl_module: it's required to start the reading using the
$r->has_request_body method.
*) Feature: the ngx_http_perl_module supports the DECLINED return code.
*) Feature: the ngx_http_dav_module supports the incoming "Date" header
line for the PUT method.
*) Feature: the "ssi" directive is available inside the "if" block.
*) Bugfix: a segmentation fault occurred if there was an "index"
directive with variables and the first index name was without
variables; bug appeared in 0.1.29.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 30 Aug 2006 00:00:00 +0400 |
parents | 9909a161eb28 |
children | 500a3242dff6 |
comparison
equal
deleted
inserted
replaced
229:1965c8e23be7 | 230:38e7b94d63ac |
---|---|
1132 } | 1132 } |
1133 } | 1133 } |
1134 } | 1134 } |
1135 } | 1135 } |
1136 | 1136 |
1137 umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module); | |
1138 | |
1137 if (r->upstream->headers_in.x_accel_redirect) { | 1139 if (r->upstream->headers_in.x_accel_redirect) { |
1138 ngx_http_upstream_finalize_request(r, u, NGX_DECLINED); | 1140 ngx_http_upstream_finalize_request(r, u, NGX_DECLINED); |
1139 | |
1140 umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module); | |
1141 | 1141 |
1142 part = &r->upstream->headers_in.headers.part; | 1142 part = &r->upstream->headers_in.headers.part; |
1143 h = part->elts; | 1143 h = part->elts; |
1144 | 1144 |
1145 for (i = 0; /* void */; i++) { | 1145 for (i = 0; /* void */; i++) { |
1186 | 1186 |
1187 ngx_http_internal_redirect(r, uri, &args); | 1187 ngx_http_internal_redirect(r, uri, &args); |
1188 return; | 1188 return; |
1189 } | 1189 } |
1190 | 1190 |
1191 ngx_http_upstream_send_response(r, u); | |
1192 } | |
1193 | |
1194 | |
1195 static void | |
1196 ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u) | |
1197 { | |
1198 int tcp_nodelay; | |
1199 ssize_t size; | |
1200 ngx_int_t rc; | |
1201 ngx_uint_t i; | |
1202 ngx_list_part_t *part; | |
1203 ngx_table_elt_t *h; | |
1204 ngx_event_pipe_t *p; | |
1205 ngx_connection_t *c; | |
1206 ngx_pool_cleanup_t *cl; | |
1207 ngx_pool_cleanup_file_t *clf; | |
1208 ngx_http_core_loc_conf_t *clcf; | |
1209 ngx_http_upstream_header_t *hh; | |
1210 ngx_http_upstream_main_conf_t *umcf; | |
1211 | |
1212 umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module); | |
1213 | |
1214 part = &r->upstream->headers_in.headers.part; | 1191 part = &r->upstream->headers_in.headers.part; |
1215 h = part->elts; | 1192 h = part->elts; |
1216 | 1193 |
1217 for (i = 0; /* void */; i++) { | 1194 for (i = 0; /* void */; i++) { |
1218 | 1195 |
1267 u->length = (size_t) r->headers_out.content_length_n; | 1244 u->length = (size_t) r->headers_out.content_length_n; |
1268 | 1245 |
1269 } else { | 1246 } else { |
1270 u->length = NGX_MAX_SIZE_T_VALUE; | 1247 u->length = NGX_MAX_SIZE_T_VALUE; |
1271 } | 1248 } |
1249 | |
1250 ngx_http_upstream_send_response(r, u); | |
1251 } | |
1252 | |
1253 | |
1254 static void | |
1255 ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u) | |
1256 { | |
1257 int tcp_nodelay; | |
1258 ssize_t size; | |
1259 ngx_int_t rc; | |
1260 ngx_event_pipe_t *p; | |
1261 ngx_connection_t *c; | |
1262 ngx_pool_cleanup_t *cl; | |
1263 ngx_pool_cleanup_file_t *clf; | |
1264 ngx_http_core_loc_conf_t *clcf; | |
1272 | 1265 |
1273 rc = ngx_http_send_header(r); | 1266 rc = ngx_http_send_header(r); |
1274 | 1267 |
1275 if (rc == NGX_ERROR || rc > NGX_OK || r->post_action) { | 1268 if (rc == NGX_ERROR || rc > NGX_OK || r->post_action) { |
1276 ngx_http_upstream_finalize_request(r, u, rc); | 1269 ngx_http_upstream_finalize_request(r, u, rc); |