Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 677:921a7ce4baf4 release-0.3.60
nginx-0.3.60-RELEASE import
*) Bugfix: a worker process may got caught in an endless loop while an
error redirection; the bug had appeared in 0.3.59.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 18 Aug 2006 14:17:54 +0000 |
parents | e924670896ab |
children | df95dcff753a |
comparison
equal
deleted
inserted
replaced
676:c4d2b8200883 | 677:921a7ce4baf4 |
---|---|
505 | 505 |
506 r->valid_unparsed_uri = 1; | 506 r->valid_unparsed_uri = 1; |
507 r->valid_location = 1; | 507 r->valid_location = 1; |
508 r->uri_changed = 1; | 508 r->uri_changed = 1; |
509 | 509 |
510 r->phase = (r == r->main) ? NGX_HTTP_POST_READ_PHASE: | 510 r->phase = (!r->internal) ? NGX_HTTP_POST_READ_PHASE: |
511 NGX_HTTP_SERVER_REWRITE_PHASE; | 511 NGX_HTTP_SERVER_REWRITE_PHASE; |
512 r->phase_handler = 0; | 512 r->phase_handler = 0; |
513 | 513 |
514 ngx_http_core_run_phases(r); | 514 ngx_http_core_run_phases(r); |
515 } | 515 } |
1322 ngx_http_internal_redirect(ngx_http_request_t *r, | 1322 ngx_http_internal_redirect(ngx_http_request_t *r, |
1323 ngx_str_t *uri, ngx_str_t *args) | 1323 ngx_str_t *uri, ngx_str_t *args) |
1324 { | 1324 { |
1325 ngx_http_core_srv_conf_t *cscf; | 1325 ngx_http_core_srv_conf_t *cscf; |
1326 | 1326 |
1327 r->uri_changes--; | |
1328 | |
1329 if (r->uri_changes == 0) { | |
1330 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
1331 "rewrite or internal redirection cycle"); | |
1332 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | |
1333 return NGX_DONE; | |
1334 } | |
1335 | |
1327 r->uri = *uri; | 1336 r->uri = *uri; |
1328 | 1337 |
1329 if (args) { | 1338 if (args) { |
1330 r->args = *args; | 1339 r->args = *args; |
1331 | 1340 |
1336 | 1345 |
1337 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 1346 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
1338 "internal redirect: \"%V?%V\"", uri, &r->args); | 1347 "internal redirect: \"%V?%V\"", uri, &r->args); |
1339 | 1348 |
1340 if (ngx_http_set_exten(r) != NGX_OK) { | 1349 if (ngx_http_set_exten(r) != NGX_OK) { |
1341 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 1350 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
1351 return NGX_DONE; | |
1342 } | 1352 } |
1343 | 1353 |
1344 /* clear the modules contexts */ | 1354 /* clear the modules contexts */ |
1345 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); | 1355 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); |
1346 | 1356 |
1348 r->loc_conf = cscf->ctx->loc_conf; | 1358 r->loc_conf = cscf->ctx->loc_conf; |
1349 | 1359 |
1350 ngx_http_update_location_config(r); | 1360 ngx_http_update_location_config(r); |
1351 | 1361 |
1352 r->internal = 1; | 1362 r->internal = 1; |
1353 | |
1354 r->uri_changes--; | |
1355 | 1363 |
1356 ngx_http_handler(r); | 1364 ngx_http_handler(r); |
1357 | 1365 |
1358 return NGX_DONE; | 1366 return NGX_DONE; |
1359 } | 1367 } |