mirror of
https://github.com/nginx/nginx.git
synced 2025-06-13 06:12:44 +08:00
change variable names
This commit is contained in:
parent
2b92c289d4
commit
a17adae005
@ -628,49 +628,51 @@ ngx_http_fastcgi_handler(ngx_http_request_t *r)
|
|||||||
static ngx_int_t
|
static ngx_int_t
|
||||||
ngx_http_fastcgi_eval(ngx_http_request_t *r, ngx_http_fastcgi_loc_conf_t *flcf)
|
ngx_http_fastcgi_eval(ngx_http_request_t *r, ngx_http_fastcgi_loc_conf_t *flcf)
|
||||||
{
|
{
|
||||||
ngx_url_t u;
|
ngx_url_t url;
|
||||||
|
ngx_http_upstream_t *u;
|
||||||
|
|
||||||
ngx_memzero(&u, sizeof(ngx_url_t));
|
ngx_memzero(&url, sizeof(ngx_url_t));
|
||||||
|
|
||||||
if (ngx_http_script_run(r, &u.url, flcf->fastcgi_lengths->elts, 0,
|
if (ngx_http_script_run(r, &url.url, flcf->fastcgi_lengths->elts, 0,
|
||||||
flcf->fastcgi_values->elts)
|
flcf->fastcgi_values->elts)
|
||||||
== NULL)
|
== NULL)
|
||||||
{
|
{
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
u.no_resolve = 1;
|
url.no_resolve = 1;
|
||||||
|
|
||||||
if (ngx_parse_url(r->pool, &u) != NGX_OK) {
|
if (ngx_parse_url(r->pool, &url) != NGX_OK) {
|
||||||
if (u.err) {
|
if (url.err) {
|
||||||
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
||||||
"%s in upstream \"%V\"", u.err, &u.url);
|
"%s in upstream \"%V\"", url.err, &url.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u.no_port) {
|
if (url.no_port) {
|
||||||
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
||||||
"no port in upstream \"%V\"", &u.url);
|
"no port in upstream \"%V\"", &url.url);
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
r->upstream->resolved = ngx_pcalloc(r->pool,
|
u = r->upstream;
|
||||||
sizeof(ngx_http_upstream_resolved_t));
|
|
||||||
if (r->upstream->resolved == NULL) {
|
u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
|
||||||
|
if (u->resolved == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u.addrs && u.addrs[0].sockaddr) {
|
if (url.addrs && url.addrs[0].sockaddr) {
|
||||||
r->upstream->resolved->sockaddr = u.addrs[0].sockaddr;
|
u->resolved->sockaddr = url.addrs[0].sockaddr;
|
||||||
r->upstream->resolved->socklen = u.addrs[0].socklen;
|
u->resolved->socklen = url.addrs[0].socklen;
|
||||||
r->upstream->resolved->naddrs = 1;
|
u->resolved->naddrs = 1;
|
||||||
r->upstream->resolved->host = u.addrs[0].name;
|
u->resolved->host = url.addrs[0].name;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
r->upstream->resolved->host = u.host;
|
u->resolved->host = url.host;
|
||||||
r->upstream->resolved->port = u.port;
|
u->resolved->port = url.port;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
|
@ -495,49 +495,51 @@ ngx_http_uwsgi_handler(ngx_http_request_t *r)
|
|||||||
static ngx_int_t
|
static ngx_int_t
|
||||||
ngx_http_uwsgi_eval(ngx_http_request_t *r, ngx_http_uwsgi_loc_conf_t * uwcf)
|
ngx_http_uwsgi_eval(ngx_http_request_t *r, ngx_http_uwsgi_loc_conf_t * uwcf)
|
||||||
{
|
{
|
||||||
ngx_url_t u;
|
ngx_url_t url;
|
||||||
|
ngx_http_upstream_t *u;
|
||||||
|
|
||||||
ngx_memzero(&u, sizeof(ngx_url_t));
|
ngx_memzero(&url, sizeof(ngx_url_t));
|
||||||
|
|
||||||
if (ngx_http_script_run(r, &u.url, uwcf->uwsgi_lengths->elts, 0,
|
if (ngx_http_script_run(r, &url.url, uwcf->uwsgi_lengths->elts, 0,
|
||||||
uwcf->uwsgi_values->elts)
|
uwcf->uwsgi_values->elts)
|
||||||
== NULL)
|
== NULL)
|
||||||
{
|
{
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
u.no_resolve = 1;
|
url.no_resolve = 1;
|
||||||
|
|
||||||
if (ngx_parse_url(r->pool, &u) != NGX_OK) {
|
if (ngx_parse_url(r->pool, &url) != NGX_OK) {
|
||||||
if (u.err) {
|
if (url.err) {
|
||||||
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
||||||
"%s in upstream \"%V\"", u.err, &u.url);
|
"%s in upstream \"%V\"", url.err, &url.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u.no_port) {
|
if (url.no_port) {
|
||||||
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
||||||
"no port in upstream \"%V\"", &u.url);
|
"no port in upstream \"%V\"", &url.url);
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
r->upstream->resolved = ngx_pcalloc(r->pool,
|
u = r->upstream;
|
||||||
sizeof(ngx_http_upstream_resolved_t));
|
|
||||||
if (r->upstream->resolved == NULL) {
|
u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
|
||||||
|
if (u->resolved == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u.addrs && u.addrs[0].sockaddr) {
|
if (url.addrs && url.addrs[0].sockaddr) {
|
||||||
r->upstream->resolved->sockaddr = u.addrs[0].sockaddr;
|
u->resolved->sockaddr = url.addrs[0].sockaddr;
|
||||||
r->upstream->resolved->socklen = u.addrs[0].socklen;
|
u->resolved->socklen = url.addrs[0].socklen;
|
||||||
r->upstream->resolved->naddrs = 1;
|
u->resolved->naddrs = 1;
|
||||||
r->upstream->resolved->host = u.addrs[0].name;
|
u->resolved->host = url.addrs[0].name;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
r->upstream->resolved->host = u.host;
|
u->resolved->host = url.host;
|
||||||
r->upstream->resolved->port = u.port;
|
u->resolved->port = url.port;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user