ngx_connection_t *c;
ngx_http_request_t *sr;
ngx_http_core_srv_conf_t *cscf;
+ ngx_http_posted_request_t *posted;
ngx_http_postponed_request_t *pr, *p;
if (r->subrequests == 0) {
return NGX_ERROR;
}
+ posted = ngx_palloc(r->pool, sizeof(ngx_http_posted_request_t));
+ if (posted == NULL) {
+ return NGX_ERROR;
+ }
+
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
sr->main_conf = cscf->ctx->main_conf;
sr->srv_conf = cscf->ctx->srv_conf;
}
if (!sr->background) {
- if (c->data == r && r->postponed == NULL) {
- c->data = sr;
- }
-
pr = ngx_palloc(r->pool, sizeof(ngx_http_postponed_request_t));
if (pr == NULL) {
return NGX_ERROR;
pr->out = NULL;
pr->next = NULL;
+ if (c->data == r && r->postponed == NULL) {
+ c->data = sr;
+ }
+
if (r->postponed) {
for (p = r->postponed; p->next; p = p->next) { /* void */ }
p->next = pr;
ngx_http_update_location_config(sr);
}
- return ngx_http_post_request(sr, NULL);
+ return ngx_http_post_request(sr, posted);
}