ngx_int_t
ngx_http_get_forwarded_addr(ngx_http_request_t *r, ngx_addr_t *addr,
    ngx_array_t *headers, ngx_str_t *value, ngx_array_t *proxies,
    int recursive)
{
    ngx_int_t          rc;
    ngx_uint_t         i, found;
    ngx_table_elt_t  **h;
    if (headers == NULL) {
        return ngx_http_get_forwarded_addr_internal(r, addr, value->data,
                                                    value->len, proxies,
                                                    recursive);
    }
    i = headers->nelts;
    h = headers->elts;
    rc = NGX_DECLINED;
    found = 0;
    while (i-- > 0) {
        rc = ngx_http_get_forwarded_addr_internal(r, addr, h[i]->value.data,
                                                  h[i]->value.len, proxies,
                                                  recursive);
        if (!recursive) {
            break;
        }
        if (rc == NGX_DECLINED && found) {
            rc = NGX_DONE;
            break;
        }
        if (rc != NGX_OK) {
            break;
        }
        found = 1;
    }
    return rc;
}
['ngx_int_t\nngx_http_get_forwarded_addr(ngx_http_request_t *r, ngx_addr_t *addr,\n    ngx_array_t *headers, ngx_str_t *value, ngx_array_t *proxies,\n    int recursive)\n{\n    ngx_int_t          rc;\n    ngx_uint_t         i, found;\n    ngx_table_elt_t  **h;\n    if (headers == NULL) {\n        return ngx_http_get_forwarded_addr_internal(r, addr, value->data,\n                                                    value->len, proxies,\n                                                    recursive);\n    }\n    i = headers->nelts;\n    h = headers->elts;\n    rc = NGX_DECLINED;\n    found = 0;\n    while (i-- > 0) {\n        rc = ngx_http_get_forwarded_addr_internal(r, addr, h[i]->value.data,\n                                                  h[i]->value.len, proxies,\n                                                  recursive);\n        if (!recursive) {\n            break;\n        }\n        if (rc == NGX_DECLINED && found) {\n            rc = NGX_DONE;\n            break;\n        }\n        if (rc != NGX_OK) {\n            break;\n        }\n        found = 1;\n    }\n    return rc;\n}']