src/http/ngx_http_upstream.c:531: error: Integer Overflow L2
  ([0, `r->uri.len`] - 1):unsigned64 by call to `ngx_http_finalize_request`.

src/http/ngx_http_upstream.c:494:1: Parameter `r->uri.len`
492. 
493. 
494. static void
     ^
495. ngx_http_upstream_init_request(ngx_http_request_t *r)
496. {

src/http/ngx_http_upstream.c:517:14: Call
515.         ngx_int_t  rc;
516. 
517.         rc = ngx_http_upstream_cache(r, u);
                  ^
518. 
519.         if (rc == NGX_BUSY) {

src/http/ngx_http_upstream.c:723:1: Parameter `r->uri.len`
  721. #if (NGX_HTTP_CACHE)
  722. 
  723. static ngx_int_t
       ^
  724. ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)
  725. {

src/http/ngx_http_upstream.c:531:13: Call
529. 
530.         if (rc == NGX_ERROR) {
531.             ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
                 ^
532.             return;
533.         }

src/http/ngx_http_request.c:2252:1: Parameter `r->uri.len`
  2250. 
  2251. 
  2252. void
        ^
  2253. ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
  2254. {

src/http/ngx_http_request.c:2324:38: Call
  2322.         c->write->handler = ngx_http_request_handler;
  2323. 
  2324.         ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc));
                                             ^
  2325.         return;
  2326.     }

src/http/ngx_http_special_response.c:365:1: Parameter `r->uri.len`
    363. 
    364. 
    365. ngx_int_t
         ^
    366. ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
    367. {

src/http/ngx_http_special_response.c:416:24: Call
    414.         for (i = 0; i < clcf->error_pages->nelts; i++) {
    415.             if (err_page[i].status == error) {
    416.                 return ngx_http_send_error_page(r, &err_page[i]);
                                ^
    417.             }
    418.         }

src/http/ngx_http_special_response.c:534:1: Parameter `r->uri.len`
      532. 
      533. 
      534. static ngx_int_t
           ^
      535. ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
      536. {

src/http/ngx_http_special_response.c:570:16: Call
      568.         }
      569. 
      570.         return ngx_http_internal_redirect(r, &uri, &args);
                          ^
      571.     }
      572. 

src/http/ngx_http_core_module.c:2593:1: Parameter `r->uri.len`
        2591. 
        2592. 
        2593. ngx_int_t
              ^
        2594. ngx_http_internal_redirect(ngx_http_request_t *r,
        2595.     ngx_str_t *uri, ngx_str_t *args)

src/http/ngx_http_core_module.c:2623:5: Call
        2621.                    "internal redirect: \"%V?%V\"", uri, &r->args);
        2622. 
        2623.     ngx_http_set_exten(r);
                  ^
        2624. 
        2625.     /* clear the modules contexts */

src/http/ngx_http_core_module.c:1794:1: <LHS trace>
1792. 
1793. 
1794. void
      ^
1795. ngx_http_set_exten(ngx_http_request_t *r)
1796. {

src/http/ngx_http_core_module.c:1794:1: Parameter `r->uri.len`
          1792. 
          1793. 
          1794. void
                ^
          1795. ngx_http_set_exten(ngx_http_request_t *r)
          1796. {

src/http/ngx_http_core_module.c:1801:10: Binary operation: ([0, r->uri.len] - 1):unsigned64 by call to `ngx_http_finalize_request` 
          1799.     ngx_str_null(&r->exten);
          1800. 
          1801.     for (i = r->uri.len - 1; i > 1; i--) {
                         ^
          1802.         if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') {
          1803. 

void
ngx_http_set_exten(ngx_http_request_t *r)
{
    ngx_int_t  i;
    ngx_str_null(&r->exten);
    for (i = r->uri.len - 1; i > 1; i--) {
        if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') {
            r->exten.len = r->uri.len - i - 1;
            r->exten.data = &r->uri.data[i + 1];
            return;
        } else if (r->uri.data[i] == '/') {
            return;
        }
    }
    return;
}
['static void\nngx_http_upstream_init_request(ngx_http_request_t *r)\n{\n    ngx_str_t                      *host;\n    ngx_uint_t                      i;\n    ngx_resolver_ctx_t             *ctx, temp;\n    ngx_http_cleanup_t             *cln;\n    ngx_http_upstream_t            *u;\n    ngx_http_core_loc_conf_t       *clcf;\n    ngx_http_upstream_srv_conf_t   *uscf, **uscfp;\n    ngx_http_upstream_main_conf_t  *umcf;\n    if (r->aio) {\n        return;\n    }\n    u = r->upstream;\n#if (NGX_HTTP_CACHE)\n    if (u->conf->cache) {\n        ngx_int_t  rc;\n        rc = ngx_http_upstream_cache(r, u);\n        if (rc == NGX_BUSY) {\n            r->write_event_handler = ngx_http_upstream_init_request;\n            return;\n        }\n        r->write_event_handler = ngx_http_request_empty_handler;\n        if (rc == NGX_DONE) {\n            return;\n        }\n        if (rc == NGX_ERROR) {\n            ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n            return;\n        }\n        if (rc != NGX_DECLINED) {\n            ngx_http_finalize_request(r, rc);\n            return;\n        }\n    }\n#endif\n    u->store = (u->conf->store || u->conf->store_lengths);\n    if (!u->store && !r->post_action && !u->conf->ignore_client_abort) {\n        r->read_event_handler = ngx_http_upstream_rd_check_broken_connection;\n        r->write_event_handler = ngx_http_upstream_wr_check_broken_connection;\n    }\n    if (r->request_body) {\n        u->request_bufs = r->request_body->bufs;\n    }\n    if (u->create_request(r) != NGX_OK) {\n        ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n        return;\n    }\n    u->peer.local = ngx_http_upstream_get_local(r, u->conf->local);\n    clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);\n    u->output.alignment = clcf->directio_alignment;\n    u->output.pool = r->pool;\n    u->output.bufs.num = 1;\n    u->output.bufs.size = clcf->client_body_buffer_size;\n    u->output.output_filter = ngx_chain_writer;\n    u->output.filter_ctx = &u->writer;\n    u->writer.pool = r->pool;\n    if (r->upstream_states == NULL) {\n        r->upstream_states = ngx_array_create(r->pool, 1,\n                                            sizeof(ngx_http_upstream_state_t));\n        if (r->upstream_states == NULL) {\n            ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n            return;\n        }\n    } else {\n        u->state = ngx_array_push(r->upstream_states);\n        if (u->state == NULL) {\n            ngx_http_upstream_finalize_request(r, u,\n                                               NGX_HTTP_INTERNAL_SERVER_ERROR);\n            return;\n        }\n        ngx_memzero(u->state, sizeof(ngx_http_upstream_state_t));\n    }\n    cln = ngx_http_cleanup_add(r, 0);\n    if (cln == NULL) {\n        ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n        return;\n    }\n    cln->handler = ngx_http_upstream_cleanup;\n    cln->data = r;\n    u->cleanup = &cln->handler;\n    if (u->resolved == NULL) {\n        uscf = u->conf->upstream;\n    } else {\n#if (NGX_HTTP_SSL)\n        u->ssl_name = u->resolved->host;\n#endif\n        if (u->resolved->sockaddr) {\n            if (ngx_http_upstream_create_round_robin_peer(r, u->resolved)\n                != NGX_OK)\n            {\n                ngx_http_upstream_finalize_request(r, u,\n                                               NGX_HTTP_INTERNAL_SERVER_ERROR);\n                return;\n            }\n            ngx_http_upstream_connect(r, u);\n            return;\n        }\n        host = &u->resolved->host;\n        umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);\n        uscfp = umcf->upstreams.elts;\n        for (i = 0; i < umcf->upstreams.nelts; i++) {\n            uscf = uscfp[i];\n            if (uscf->host.len == host->len\n                && ((uscf->port == 0 && u->resolved->no_port)\n                     || uscf->port == u->resolved->port)\n                && ngx_strncasecmp(uscf->host.data, host->data, host->len) == 0)\n            {\n                goto found;\n            }\n        }\n        if (u->resolved->port == 0) {\n            ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                          "no port in upstream \\"%V\\"", host);\n            ngx_http_upstream_finalize_request(r, u,\n                                               NGX_HTTP_INTERNAL_SERVER_ERROR);\n            return;\n        }\n        temp.name = *host;\n        ctx = ngx_resolve_start(clcf->resolver, &temp);\n        if (ctx == NULL) {\n            ngx_http_upstream_finalize_request(r, u,\n                                               NGX_HTTP_INTERNAL_SERVER_ERROR);\n            return;\n        }\n        if (ctx == NGX_NO_RESOLVER) {\n            ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                          "no resolver defined to resolve %V", host);\n            ngx_http_upstream_finalize_request(r, u, NGX_HTTP_BAD_GATEWAY);\n            return;\n        }\n        ctx->name = *host;\n        ctx->handler = ngx_http_upstream_resolve_handler;\n        ctx->data = r;\n        ctx->timeout = clcf->resolver_timeout;\n        u->resolved->ctx = ctx;\n        if (ngx_resolve_name(ctx) != NGX_OK) {\n            u->resolved->ctx = NULL;\n            ngx_http_upstream_finalize_request(r, u,\n                                               NGX_HTTP_INTERNAL_SERVER_ERROR);\n            return;\n        }\n        return;\n    }\nfound:\n    if (uscf == NULL) {\n        ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,\n                      "no upstream configuration");\n        ngx_http_upstream_finalize_request(r, u,\n                                           NGX_HTTP_INTERNAL_SERVER_ERROR);\n        return;\n    }\n#if (NGX_HTTP_SSL)\n    u->ssl_name = uscf->host;\n#endif\n    if (uscf->peer.init(r, uscf) != NGX_OK) {\n        ngx_http_upstream_finalize_request(r, u,\n                                           NGX_HTTP_INTERNAL_SERVER_ERROR);\n        return;\n    }\n    u->peer.start_time = ngx_current_msec;\n    if (u->conf->next_upstream_tries\n        && u->peer.tries > u->conf->next_upstream_tries)\n    {\n        u->peer.tries = u->conf->next_upstream_tries;\n    }\n    ngx_http_upstream_connect(r, u);\n}', 'static ngx_int_t\nngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)\n{\n    ngx_int_t          rc;\n    ngx_http_cache_t  *c;\n    c = r->cache;\n    if (c == NULL) {\n        if (!(r->method & u->conf->cache_methods)) {\n            return NGX_DECLINED;\n        }\n        if (r->method & NGX_HTTP_HEAD) {\n            u->method = ngx_http_core_get_method;\n        }\n        if (ngx_http_file_cache_new(r) != NGX_OK) {\n            return NGX_ERROR;\n        }\n        if (u->create_key(r) != NGX_OK) {\n            return NGX_ERROR;\n        }\n        ngx_http_file_cache_create_key(r);\n        if (r->cache->header_start + 256 >= u->conf->buffer_size) {\n            ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                          "%V_buffer_size %uz is not enough for cache key, "\n                          "it should be increased to at least %uz",\n                          &u->conf->module, u->conf->buffer_size,\n                          ngx_align(r->cache->header_start + 256, 1024));\n            r->cache = NULL;\n            return NGX_DECLINED;\n        }\n        u->cacheable = 1;\n        switch (ngx_http_test_predicates(r, u->conf->cache_bypass)) {\n        case NGX_ERROR:\n            return NGX_ERROR;\n        case NGX_DECLINED:\n            u->cache_status = NGX_HTTP_CACHE_BYPASS;\n            return NGX_DECLINED;\n        default:\n            break;\n        }\n        c = r->cache;\n        c->min_uses = u->conf->cache_min_uses;\n        c->body_start = u->conf->buffer_size;\n        c->file_cache = u->conf->cache->data;\n        c->lock = u->conf->cache_lock;\n        c->lock_timeout = u->conf->cache_lock_timeout;\n        c->lock_age = u->conf->cache_lock_age;\n        u->cache_status = NGX_HTTP_CACHE_MISS;\n    }\n    rc = ngx_http_file_cache_open(r);\n    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                   "http upstream cache: %i", rc);\n    switch (rc) {\n    case NGX_HTTP_CACHE_UPDATING:\n        if (u->conf->cache_use_stale & NGX_HTTP_UPSTREAM_FT_UPDATING) {\n            u->cache_status = rc;\n            rc = NGX_OK;\n        } else {\n            rc = NGX_HTTP_CACHE_STALE;\n        }\n        break;\n    case NGX_OK:\n        u->cache_status = NGX_HTTP_CACHE_HIT;\n    }\n    switch (rc) {\n    case NGX_OK:\n        rc = ngx_http_upstream_cache_send(r, u);\n        if (rc != NGX_HTTP_UPSTREAM_INVALID_HEADER) {\n            return rc;\n        }\n        break;\n    case NGX_HTTP_CACHE_STALE:\n        c->valid_sec = 0;\n        u->buffer.start = NULL;\n        u->cache_status = NGX_HTTP_CACHE_EXPIRED;\n        break;\n    case NGX_DECLINED:\n        if ((size_t) (u->buffer.end - u->buffer.start) < u->conf->buffer_size) {\n            u->buffer.start = NULL;\n        } else {\n            u->buffer.pos = u->buffer.start + c->header_start;\n            u->buffer.last = u->buffer.pos;\n        }\n        break;\n    case NGX_HTTP_CACHE_SCARCE:\n        u->cacheable = 0;\n        break;\n    case NGX_AGAIN:\n        return NGX_BUSY;\n    case NGX_ERROR:\n        return NGX_ERROR;\n    default:\n        u->cache_status = NGX_HTTP_CACHE_HIT;\n        return rc;\n    }\n    r->cached = 0;\n    return NGX_DECLINED;\n}', 'void\nngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)\n{\n    ngx_connection_t          *c;\n    ngx_http_request_t        *pr;\n    ngx_http_core_loc_conf_t  *clcf;\n    c = r->connection;\n    ngx_log_debug5(NGX_LOG_DEBUG_HTTP, c->log, 0,\n                   "http finalize request: %d, \\"%V?%V\\" a:%d, c:%d",\n                   rc, &r->uri, &r->args, r == c->data, r->main->count);\n    if (rc == NGX_DONE) {\n        ngx_http_finalize_connection(r);\n        return;\n    }\n    if (rc == NGX_OK && r->filter_finalize) {\n        c->error = 1;\n    }\n    if (rc == NGX_DECLINED) {\n        r->content_handler = NULL;\n        r->write_event_handler = ngx_http_core_run_phases;\n        ngx_http_core_run_phases(r);\n        return;\n    }\n    if (r != r->main && r->post_subrequest) {\n        rc = r->post_subrequest->handler(r, r->post_subrequest->data, rc);\n    }\n    if (rc == NGX_ERROR\n        || rc == NGX_HTTP_REQUEST_TIME_OUT\n        || rc == NGX_HTTP_CLIENT_CLOSED_REQUEST\n        || c->error)\n    {\n        if (ngx_http_post_action(r) == NGX_OK) {\n            return;\n        }\n        if (r->main->blocked) {\n            r->write_event_handler = ngx_http_request_finalizer;\n        }\n        ngx_http_terminate_request(r, rc);\n        return;\n    }\n    if (rc >= NGX_HTTP_SPECIAL_RESPONSE\n        || rc == NGX_HTTP_CREATED\n        || rc == NGX_HTTP_NO_CONTENT)\n    {\n        if (rc == NGX_HTTP_CLOSE) {\n            ngx_http_terminate_request(r, rc);\n            return;\n        }\n        if (r == r->main) {\n            if (c->read->timer_set) {\n                ngx_del_timer(c->read);\n            }\n            if (c->write->timer_set) {\n                ngx_del_timer(c->write);\n            }\n        }\n        c->read->handler = ngx_http_request_handler;\n        c->write->handler = ngx_http_request_handler;\n        ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc));\n        return;\n    }\n    if (r != r->main) {\n        if (r->buffered || r->postponed) {\n            if (ngx_http_set_write_handler(r) != NGX_OK) {\n                ngx_http_terminate_request(r, 0);\n            }\n            return;\n        }\n        pr = r->parent;\n        if (r == c->data) {\n            r->main->count--;\n            r->main->subrequests++;\n            if (!r->logged) {\n                clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);\n                if (clcf->log_subrequest) {\n                    ngx_http_log_request(r);\n                }\n                r->logged = 1;\n            } else {\n                ngx_log_error(NGX_LOG_ALERT, c->log, 0,\n                              "subrequest: \\"%V?%V\\" logged again",\n                              &r->uri, &r->args);\n            }\n            r->done = 1;\n            if (pr->postponed && pr->postponed->request == r) {\n                pr->postponed = pr->postponed->next;\n            }\n            c->data = pr;\n        } else {\n            ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,\n                           "http finalize non-active request: \\"%V?%V\\"",\n                           &r->uri, &r->args);\n            r->write_event_handler = ngx_http_request_finalizer;\n            if (r->waited) {\n                r->done = 1;\n            }\n        }\n        if (ngx_http_post_request(pr, NULL) != NGX_OK) {\n            r->main->count++;\n            ngx_http_terminate_request(r, 0);\n            return;\n        }\n        ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,\n                       "http wake parent request: \\"%V?%V\\"",\n                       &pr->uri, &pr->args);\n        return;\n    }\n    if (r->buffered || c->buffered || r->postponed || r->blocked) {\n        if (ngx_http_set_write_handler(r) != NGX_OK) {\n            ngx_http_terminate_request(r, 0);\n        }\n        return;\n    }\n    if (r != c->data) {\n        ngx_log_error(NGX_LOG_ALERT, c->log, 0,\n                      "http finalize non-active request: \\"%V?%V\\"",\n                      &r->uri, &r->args);\n        return;\n    }\n    r->done = 1;\n    r->write_event_handler = ngx_http_request_empty_handler;\n    if (!r->post_action) {\n        r->request_complete = 1;\n    }\n    if (ngx_http_post_action(r) == NGX_OK) {\n        return;\n    }\n    if (c->read->timer_set) {\n        ngx_del_timer(c->read);\n    }\n    if (c->write->timer_set) {\n        c->write->delayed = 0;\n        ngx_del_timer(c->write);\n    }\n    if (c->read->eof) {\n        ngx_http_close_request(r, 0);\n        return;\n    }\n    ngx_http_finalize_connection(r);\n}', 'ngx_int_t\nngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)\n{\n    ngx_uint_t                 i, err;\n    ngx_http_err_page_t       *err_page;\n    ngx_http_core_loc_conf_t  *clcf;\n    ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                   "http special response: %i, \\"%V?%V\\"",\n                   error, &r->uri, &r->args);\n    r->err_status = error;\n    if (r->keepalive) {\n        switch (error) {\n            case NGX_HTTP_BAD_REQUEST:\n            case NGX_HTTP_REQUEST_ENTITY_TOO_LARGE:\n            case NGX_HTTP_REQUEST_URI_TOO_LARGE:\n            case NGX_HTTP_TO_HTTPS:\n            case NGX_HTTPS_CERT_ERROR:\n            case NGX_HTTPS_NO_CERT:\n            case NGX_HTTP_INTERNAL_SERVER_ERROR:\n            case NGX_HTTP_NOT_IMPLEMENTED:\n                r->keepalive = 0;\n        }\n    }\n    if (r->lingering_close) {\n        switch (error) {\n            case NGX_HTTP_BAD_REQUEST:\n            case NGX_HTTP_TO_HTTPS:\n            case NGX_HTTPS_CERT_ERROR:\n            case NGX_HTTPS_NO_CERT:\n                r->lingering_close = 0;\n        }\n    }\n    r->headers_out.content_type.len = 0;\n    clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);\n    if (!r->error_page && clcf->error_pages && r->uri_changes != 0) {\n        if (clcf->recursive_error_pages == 0) {\n            r->error_page = 1;\n        }\n        err_page = clcf->error_pages->elts;\n        for (i = 0; i < clcf->error_pages->nelts; i++) {\n            if (err_page[i].status == error) {\n                return ngx_http_send_error_page(r, &err_page[i]);\n            }\n        }\n    }\n    r->expect_tested = 1;\n    if (ngx_http_discard_request_body(r) != NGX_OK) {\n        r->keepalive = 0;\n    }\n    if (clcf->msie_refresh\n        && r->headers_in.msie\n        && (error == NGX_HTTP_MOVED_PERMANENTLY\n            || error == NGX_HTTP_MOVED_TEMPORARILY))\n    {\n        return ngx_http_send_refresh(r);\n    }\n    if (error == NGX_HTTP_CREATED) {\n        err = 0;\n    } else if (error == NGX_HTTP_NO_CONTENT) {\n        err = 0;\n    } else if (error >= NGX_HTTP_MOVED_PERMANENTLY\n               && error < NGX_HTTP_LAST_3XX)\n    {\n        err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_OFF_3XX;\n    } else if (error >= NGX_HTTP_BAD_REQUEST\n               && error < NGX_HTTP_LAST_4XX)\n    {\n        err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_OFF_4XX;\n    } else if (error >= NGX_HTTP_NGINX_CODES\n               && error < NGX_HTTP_LAST_5XX)\n    {\n        err = error - NGX_HTTP_NGINX_CODES + NGX_HTTP_OFF_5XX;\n        switch (error) {\n            case NGX_HTTP_TO_HTTPS:\n            case NGX_HTTPS_CERT_ERROR:\n            case NGX_HTTPS_NO_CERT:\n            case NGX_HTTP_REQUEST_HEADER_TOO_LARGE:\n                r->err_status = NGX_HTTP_BAD_REQUEST;\n                break;\n        }\n    } else {\n        err = 0;\n    }\n    return ngx_http_send_special_response(r, clcf, err);\n}', 'static ngx_int_t\nngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)\n{\n    ngx_int_t                  overwrite;\n    ngx_str_t                  uri, args;\n    ngx_table_elt_t           *location;\n    ngx_http_core_loc_conf_t  *clcf;\n    overwrite = err_page->overwrite;\n    if (overwrite && overwrite != NGX_HTTP_OK) {\n        r->expect_tested = 1;\n    }\n    if (overwrite >= 0) {\n        r->err_status = overwrite;\n    }\n    if (ngx_http_complex_value(r, &err_page->value, &uri) != NGX_OK) {\n        return NGX_ERROR;\n    }\n    if (uri.data[0] == \'/\') {\n        if (err_page->value.lengths) {\n            ngx_http_split_args(r, &uri, &args);\n        } else {\n            args = err_page->args;\n        }\n        if (r->method != NGX_HTTP_HEAD) {\n            r->method = NGX_HTTP_GET;\n            r->method_name = ngx_http_get_name;\n        }\n        return ngx_http_internal_redirect(r, &uri, &args);\n    }\n    if (uri.data[0] == \'@\') {\n        return ngx_http_named_location(r, &uri);\n    }\n    location = ngx_list_push(&r->headers_out.headers);\n    if (location == NULL) {\n        return NGX_ERROR;\n    }\n    if (overwrite != NGX_HTTP_MOVED_PERMANENTLY\n        && overwrite != NGX_HTTP_MOVED_TEMPORARILY\n        && overwrite != NGX_HTTP_SEE_OTHER\n        && overwrite != NGX_HTTP_TEMPORARY_REDIRECT)\n    {\n        r->err_status = NGX_HTTP_MOVED_TEMPORARILY;\n    }\n    location->hash = 1;\n    ngx_str_set(&location->key, "Location");\n    location->value = uri;\n    ngx_http_clear_location(r);\n    r->headers_out.location = location;\n    clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);\n    if (clcf->msie_refresh && r->headers_in.msie) {\n        return ngx_http_send_refresh(r);\n    }\n    return ngx_http_send_special_response(r, clcf, r->err_status\n                                                   - NGX_HTTP_MOVED_PERMANENTLY\n                                                   + NGX_HTTP_OFF_3XX);\n}', 'ngx_int_t\nngx_http_internal_redirect(ngx_http_request_t *r,\n    ngx_str_t *uri, ngx_str_t *args)\n{\n    ngx_http_core_srv_conf_t  *cscf;\n    r->uri_changes--;\n    if (r->uri_changes == 0) {\n        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                      "rewrite or internal redirection cycle "\n                      "while internally redirecting to \\"%V\\"", uri);\n        r->main->count++;\n        ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n        return NGX_DONE;\n    }\n    r->uri = *uri;\n    if (args) {\n        r->args = *args;\n    } else {\n        ngx_str_null(&r->args);\n    }\n    ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                   "internal redirect: \\"%V?%V\\"", uri, &r->args);\n    ngx_http_set_exten(r);\n    ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);\n    cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);\n    r->loc_conf = cscf->ctx->loc_conf;\n    ngx_http_update_location_config(r);\n#if (NGX_HTTP_CACHE)\n    r->cache = NULL;\n#endif\n    r->internal = 1;\n    r->valid_unparsed_uri = 0;\n    r->add_uri_to_alias = 0;\n    r->main->count++;\n    ngx_http_handler(r);\n    return NGX_DONE;\n}', "void\nngx_http_set_exten(ngx_http_request_t *r)\n{\n    ngx_int_t  i;\n    ngx_str_null(&r->exten);\n    for (i = r->uri.len - 1; i > 1; i--) {\n        if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') {\n            r->exten.len = r->uri.len - i - 1;\n            r->exten.data = &r->uri.data[i + 1];\n            return;\n        } else if (r->uri.data[i] == '/') {\n            return;\n        }\n    }\n    return;\n}"]