fix segfault if no named location are defined, but are used

This commit is contained in:
Igor Sysoev 2008-12-11 17:32:52 +00:00
parent ac662fbe1b
commit 3dde93ba6c

View File

@ -2017,6 +2017,8 @@ ngx_http_named_location(ngx_http_request_t *r, ngx_str_t *name)
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
if (cscf->named_locations) {
for (clcfp = cscf->named_locations; *clcfp; clcfp++) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@ -2029,7 +2031,8 @@ ngx_http_named_location(ngx_http_request_t *r, ngx_str_t *name)
}
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"using location: %V \"%V?%V\"", name, &r->uri, &r->args);
"using location: %V \"%V?%V\"",
name, &r->uri, &r->args);
r->internal = 1;
r->content_handler = NULL;
@ -2045,6 +2048,7 @@ ngx_http_named_location(ngx_http_request_t *r, ngx_str_t *name)
return NGX_DONE;
}
}
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"could not find named location \"%V\"", name);