comparison src/http/modules/ngx_http_uwsgi_module.c @ 3610:edcc271f7c4c

change variable names
author Igor Sysoev <igor@sysoev.ru>
date Tue, 08 Jun 2010 16:15:47 +0000
parents 8b55806ceb97
children 395ae91f7a5a
comparison
equal deleted inserted replaced
3609:0ae39a108291 3610:edcc271f7c4c
493 493
494 494
495 static ngx_int_t 495 static ngx_int_t
496 ngx_http_uwsgi_eval(ngx_http_request_t *r, ngx_http_uwsgi_loc_conf_t * uwcf) 496 ngx_http_uwsgi_eval(ngx_http_request_t *r, ngx_http_uwsgi_loc_conf_t * uwcf)
497 { 497 {
498 ngx_url_t u; 498 ngx_url_t url;
499 499 ngx_http_upstream_t *u;
500 ngx_memzero(&u, sizeof(ngx_url_t)); 500
501 501 ngx_memzero(&url, sizeof(ngx_url_t));
502 if (ngx_http_script_run(r, &u.url, uwcf->uwsgi_lengths->elts, 0, 502
503 if (ngx_http_script_run(r, &url.url, uwcf->uwsgi_lengths->elts, 0,
503 uwcf->uwsgi_values->elts) 504 uwcf->uwsgi_values->elts)
504 == NULL) 505 == NULL)
505 { 506 {
506 return NGX_ERROR; 507 return NGX_ERROR;
507 } 508 }
508 509
509 u.no_resolve = 1; 510 url.no_resolve = 1;
510 511
511 if (ngx_parse_url(r->pool, &u) != NGX_OK) { 512 if (ngx_parse_url(r->pool, &url) != NGX_OK) {
512 if (u.err) { 513 if (url.err) {
513 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 514 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
514 "%s in upstream \"%V\"", u.err, &u.url); 515 "%s in upstream \"%V\"", url.err, &url.url);
515 } 516 }
516 517
517 return NGX_ERROR; 518 return NGX_ERROR;
518 } 519 }
519 520
520 if (u.no_port) { 521 if (url.no_port) {
521 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 522 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
522 "no port in upstream \"%V\"", &u.url); 523 "no port in upstream \"%V\"", &url.url);
523 return NGX_ERROR; 524 return NGX_ERROR;
524 } 525 }
525 526
526 r->upstream->resolved = ngx_pcalloc(r->pool, 527 u = r->upstream;
527 sizeof(ngx_http_upstream_resolved_t)); 528
528 if (r->upstream->resolved == NULL) { 529 u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
530 if (u->resolved == NULL) {
529 return NGX_ERROR; 531 return NGX_ERROR;
530 } 532 }
531 533
532 if (u.addrs && u.addrs[0].sockaddr) { 534 if (url.addrs && url.addrs[0].sockaddr) {
533 r->upstream->resolved->sockaddr = u.addrs[0].sockaddr; 535 u->resolved->sockaddr = url.addrs[0].sockaddr;
534 r->upstream->resolved->socklen = u.addrs[0].socklen; 536 u->resolved->socklen = url.addrs[0].socklen;
535 r->upstream->resolved->naddrs = 1; 537 u->resolved->naddrs = 1;
536 r->upstream->resolved->host = u.addrs[0].name; 538 u->resolved->host = url.addrs[0].name;
537 539
538 } else { 540 } else {
539 r->upstream->resolved->host = u.host; 541 u->resolved->host = url.host;
540 r->upstream->resolved->port = u.port; 542 u->resolved->port = url.port;
541 } 543 }
542 544
543 return NGX_OK; 545 return NGX_OK;
544 } 546 }
545 547