comparison src/http/ngx_http_core_module.c @ 777:4ab852b691f5

<!--#include virtual=... set=... -->
author Igor Sysoev <igor@sysoev.ru>
date Fri, 13 Oct 2006 15:20:10 +0000
parents c3ebeee31026
children 472cd9768ac2
comparison
equal deleted inserted replaced
776:5622cdd48e5b 777:4ab852b691f5
1283 1283
1284 1284
1285 ngx_int_t 1285 ngx_int_t
1286 ngx_http_subrequest(ngx_http_request_t *r, 1286 ngx_http_subrequest(ngx_http_request_t *r,
1287 ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **psr, 1287 ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **psr,
1288 ngx_chain_t *out, ngx_uint_t flags) 1288 ngx_http_post_subrequest_t *ps, ngx_uint_t flags)
1289 { 1289 {
1290 ngx_connection_t *c; 1290 ngx_connection_t *c;
1291 ngx_http_request_t *sr; 1291 ngx_http_request_t *sr;
1292 ngx_http_log_ctx_t *ctx; 1292 ngx_http_log_ctx_t *ctx;
1293 ngx_http_core_srv_conf_t *cscf; 1293 ngx_http_core_srv_conf_t *cscf;
1351 } 1351 }
1352 1352
1353 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, 1353 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
1354 "http subrequest \"%V?%V\"", uri, &sr->args); 1354 "http subrequest \"%V?%V\"", uri, &sr->args);
1355 1355
1356 if (flags & NGX_HTTP_ZERO_IN_URI) { 1356 sr->zero_in_uri = (flags & NGX_HTTP_ZERO_IN_URI) != 0;
1357 sr->zero_in_uri = 1; 1357 sr->subrequest_in_memory = (flags & NGX_HTTP_SUBREQUEST_IN_MEMORY) != 0;
1358 }
1359 1358
1360 sr->unparsed_uri = r->unparsed_uri; 1359 sr->unparsed_uri = r->unparsed_uri;
1361 sr->method_name = r->method_name; 1360 sr->method_name = r->method_name;
1362 sr->http_protocol = r->http_protocol; 1361 sr->http_protocol = r->http_protocol;
1363 1362
1364 if (ngx_http_set_exten(sr) != NGX_OK) { 1363 if (ngx_http_set_exten(sr) != NGX_OK) {
1365 return NGX_ERROR; 1364 return NGX_ERROR;
1366 } 1365 }
1367 1366
1368 sr->out = out;
1369 sr->main = r->main; 1367 sr->main = r->main;
1370 sr->parent = r; 1368 sr->parent = r;
1369 sr->post_subrequest = ps;
1371 sr->read_event_handler = ngx_http_request_empty_handler; 1370 sr->read_event_handler = ngx_http_request_empty_handler;
1372 sr->write_event_handler = ngx_http_request_empty_handler; 1371 sr->write_event_handler = ngx_http_request_empty_handler;
1373 1372
1374 if (c->data == r) { 1373 if (c->data == r) {
1375 c->data = sr; 1374 c->data = sr;
1429 } 1428 }
1430 1429
1431 return NGX_AGAIN; 1430 return NGX_AGAIN;
1432 } 1431 }
1433 1432
1434 return NGX_OK; 1433 return NGX_DONE;
1435 } 1434 }
1436 1435
1437 1436
1438 ngx_int_t 1437 ngx_int_t
1439 ngx_http_internal_redirect(ngx_http_request_t *r, 1438 ngx_http_internal_redirect(ngx_http_request_t *r,